3 ms·
I have a basic script I wrote that uses inotify and commits on every save. Then I can easily just use the interactive rebase and squash commits together and ha
by tombert 10y ago
I have a basic script I wrote that uses inotify and commits on every save. Then I can easily just use the interactive rebase and squash commits together and have a clean history.
- fiatjaf 10y agoWHAT? ON EVERY SAVE? This is not serious, is it? If it is, what do you assign to each commit?
- tombert 10y agoYes, every save. The commit message is a timestamp and the file touched, which is usually enough for me to figure out what I did there, making the squashing relatively straightforward. This isn't as bad as it sounds because git has tools built in to handle merging commits together and deleting unwanted commits through `git rebase -i`
- yjftsjthsd-h 10y agoProbably a timestamp, plus "auto commit" or something. Think of it as cheap time travel.
- chx 10y agoThis is the right answer. This makes easier to stay in flow because you are not distracted by side tasks like committing and have no worries about code getting lost. SVN was doing great here with autoversioning via WebDAV but git is even better because before you put in a PR you can squash your entire "run". As for what the commit message is, who cares. I use uuidgen -r but whatever works. If the proverbial manure hits the circular cooling device and you need to back to a working version, you will work your way back via git log -p and similar tools anyways. It's more of a controlled undo than anything else.