3 ms·
I don't plan my commits. I start writing whatever seems necessary. It's kind of impossible to draw a map for a terrain you haven't seen yet. If I feel like, ok,
by jordigh 9y ago
I don't plan my commits. I start writing whatever seems necessary. It's kind of impossible to draw a map for a terrain you haven't seen yet. If I feel like, ok, now it's time to record what I've done, I use `hg commit --interactive` to pick apart my working directory into relevant things using a very pleasant curses interface for diff selection. I can always later on `hg amend` any commit that I think may need it.
Then there's the awesome `hg absorb` that will let me amend a whole stack of commits at once, automatically. It figures out which commit on earlier in my stack should get whatever change is in my working directory and automatically cherry-picks the right fix from my working directory to the right commit.
http://files.lihdd.net/hgabsorb-note.pdf http://files.lihdd.net/hgabsorb-note.pdf
If I need to change gears, I make a temporary commit, labelled by some bookmark, and move to a different branch of my repo. If I want to throw out part of my working directory, I use `hg revert --interactive` or `hg shelve --interactive` depending on how permanent I want the throwing out to be. This uses the exact same curses interface as `hg commit --interactive`. I also rebase (i.e. change the base only, not rewrite the commit), fold/squash, and edit commit messages, authors or dates as needed. The best part is this all propagates metahistorically via changeset evolution (available now as an open beta on Bitbucket). It's all really nice, and I wish all of the Mercurial workflows for polishing commits were more well-known.