Hacker News new | past | comments | ask | show | jobs | submit login

The example of writing a commit message breaking flow state is an interesting one, which ties flow to a related word: fluency.

For the first year or two of using git, I treated it as an undo buffer, with a nice bonus that I could try things out on distinct branches. Commit messages were frequently pro forma, because I wasn't thinking in terms of units of change.

There are still projects I approach this way, "latest firmware" is all I really need if I'm changing things around on my keyboard firmware, for instance.

But with a bit of mentoring several years ago, at a job with expectations for how git should be used, I've come to think of changes to a codebase in terms of a commit. I'm not just writing software, I'm writing a commit on a specific branch.

So writing a commit message doesn't take me out of my flow, because it's part of it: that's what the work was flowing towards. I don't let git drive the work, so there are definitely commits of the form "add $specific-thing\nAlso (minor bugfix/change)", but every time I'm working on a complex project, it's toward a specific commit-sized goal.

I'd love a revision system (probably based on pijul) which created a patch every time I save, which I do every minute or so. With a tool which removed patch lines which never show up in the final diff, and displayed the total change in a way which makes it easy to pick those unrelated changes off into their own patch, so I could break the commit into logical pieces. I wouldn't need it often, but when I'm working on something specific, and I see something else which is wrong, or just easy to change, it would take me out of flow to, idk, write it on a Post-it and do it after the commit is fixed. But commits with unrelated work in them create a sense of creative disorder, one which I would happily take a minute to resolve if the tool made it easy.




That's pretty much how I use git. My text editor auto saves, I work on a task, doing refactors, or throw away wishful code along the way. When I feel like I'm at a good point for a commit, I repeatedly use `git status`, `git diff`, and `git add -p` to split the sum of changes into a reasonable set of commits. A commit does not need to be all-or-nothing.


martinvonz/jj - it's primary use case is as you've described, while using git as backend (i.e. other devs can still use git). But it's line-oriented, non ast-oriented.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: