[Wish] commit --amend (aka. recommit, related to uncommit)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Confirmed
|
Medium
|
Unassigned | ||
Breezy |
In Progress
|
Low
|
Jelmer Vernooij |
Bug Description
I would wish for a feature similar to "git commit --amend".
The use of this would be twofold: to change (re-edit) a commit message, or to commit additional changes to the tree like added files or content modifications. Of course these two kinds of amendments (message and tree) might be used together.
Currently I fairly often do this:
1. make additional modifications to tree (if required)
2. bzr uncommit
3. bzr commit
4. paste old message from output of 1.
5. remove added indentation
6. edit message (if required) and save it
The "commit --amend" should work like the above, but should do steps 2 through 5 in one go, i.e. it should uncommit and then commit again, and when presenting an editor for the commit message, it should display the old commit message as a default. Giving the message on the command line should work as well, and simply replace the old commit message. Of course if the user were to cancel committing, e.g. by leaving an empty commit message, then the required uncommit probably shouldn't be done in the first place. Therefore the order should be "edit - uncommit - commit" or something equivalent.
I'd suggest "bzr commit --amend" in correspondence with git, and because most options applicable to a commit should work for this command as well. Of course, a new command (perhaps "bzr recommit" or "bzr amend") would be just as acceptable.
The same restrictions that apply to "uncommit", i.e. that removing revisions from a public branch is probably a bad idea, of course hold for amending as well. They haven't prevented uncommit from becoming part of the ui, so they are no reason against amending. Just like uncommit, amending the tip should leave a dead head in the repository. That's a feature, I believe.
Related branches
- Martin Packman: Approve
-
Diff: 323 lines (+106/-35)6 files modifiedbreezy/builtins.py (+30/-11)
breezy/commit.py (+28/-14)
breezy/msgeditor.py (+11/-3)
breezy/mutabletree.py (+8/-6)
breezy/tests/blackbox/test_commit.py (+26/-1)
doc/en/release-notes/brz-3.1.txt (+3/-0)
Changed in bzr: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
tags: | added: commit |
Changed in brz: | |
status: | New → Triaged |
importance: | Undecided → Low |
tags: | added: git-world |
Changed in brz: | |
status: | Triaged → In Progress |
assignee: | nobody → Jelmer Vernooij (jelmer) |
milestone: | none → 3.1.0 |
Oh, I forgot to mention: there was a discussion about a feature like this back in 2007: thread. gmane.org/ gmane.comp. version- control. bazaar- ng.general/ 21558 /lists. ubuntu. com/archives/ bazaar/ 2007q1/ thread. html#21660
http://
or https:/
Some discussion, but not much in the way of results, and certainly no patch.