Comment 8 for bug 243150

Revision history for this message
Kirill Müller (krlmlr) wrote :

I'm missing rebase -i from git enough that I want to try to implement an alternative in bzr. I am planning to implement a histedit command that would allow reordering the last n commits (using a --revision parameter). Rewording commit messages, editing commits and squashing commits will follow, although I'm not certain that squashing will be easy to implement.

The UI would be just like in git rebase -i. A human-readable git-style 'todo' list like

pick 1 added file a
pick 2 added file b
pick 3 edited file a

would be opened in $EDITOR (the same way like commit without -m opens one), the result will then be formatted as a .bzr/checkout/rebase-plan file, and the existing machinery will perform the heavy lifting. The numbers will be the numeric revno-s, which are unique within the branch. Users can reorder or leave out commits, later changing the command to "reword", "edit", "squash" or "fixup" with git semantics will be supported, too.

Suggestions and comments are welcome.

I have a technical question. Using the class collections.OrderedDict would simplify the implementation; however, it's available in Python 2.7 only. Does bzrlib already have a substitute for this functionality?