[15:19] <qengho> Hi ho. Suppose that a dozen commits ago I screwed something up, and I'd like to go repair it.  What's the best way?
[15:20] <mgz> generally, just fix it and commit
[15:22] <qengho> Yeah, I could append a new change, but if Joe wants to take only the first five commits, he doesn't get my fix that's on the end.
[15:22] <mgz> if it's something along the lines of "accidentally committed your password" then, then you probably need to rewrite history
[15:22] <qengho> I think I can do it with some ugly (bzr uncommit; bzr shelve -m ...;) and (bzr unshelve; bzr commit -m...), but getting the log message in and out isn't automatic, sadly.
[15:23] <mgz> your joe example is the same regardless. people with older versions of software don't have the bug fixes (and bugs) since then
[15:23] <LeoNerd> You can possibly pull it out a bit via   LOGMESSAGE=$(some scriptery here $(bzr log --line -r-1)); bzr uncommit; bzr shelve -m $LOGMESSAGE
[15:23] <mgz> with dvcs you generally assume people know to pull
[15:24] <qengho> There's no one else with the commits I'm talking about, mgz.
[15:26] <mgz> what I'd do to rewrite is just `bzr branch -rLASTGOOD trunk pristine && bzr merge -rLASTGOOD..-1 -d pristine trunk` then fixup the changes and commit with a summary message noting it's a history rewrite
[15:27] <mgz> if it's my own branch, I generally don't care too much about the intermeduary commits and their messages, but it's reasonably trivial to preserve them via a little scripting as LeoNerd suggested
[15:28] <mgz> you just do -rLASTGOOD..(LASTGOOD+1) as the cherrypick+fixup then replay the subsequent changes afterwards
[15:30] <mgz> the `bzr replay` command provided by rebase is enough for that
[15:30] <mgz> sorry, bzr-rewrite
[15:31] <qengho> Thanks, guys.
[15:32] <mgz> having two branches is helpful because if you screw up you just nuke the new one and try again.
[15:33] <LeoNerd> Yah.
[16:19] <qengho> Not perfect, but a first try on pushing/popping.  lp:~cmiller/+junk/bzr-pushpop