if commit fails commit message draft is lost

Bug #32054 reported by Martin Pool
4
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Medium
Martin Pool

Bug Description

 affects /products/bzr

Alexander writes:

If working tree have conflicts or another reasons that leads to fail of
commit then commit message did not stored and lost. I think bzr should
store commit message (at least from external editor and maybe from
command line with -m option) in the text file in the root of tree (or
in ./bzr/commit.log file?) for later commit.

--
Martin

Revision history for this message
Martin Pool (mbp) wrote : Re: BUG: If commit fails commit message is lost

On Sat, 2006-02-18 at 23:26 +0200, Alexander Belchenko wrote:
> If working tree have conflicts or another reasons that leads to fail of
> commit then commit message did not stored and lost. I think bzr should
> store commit message (at least from external editor and maybe from
> command line with -m option) in the text file in the root of tree (or in
> ./bzr/commit.log file?) for later commit.

Yes, I agree it's a bug

  https://launchpad.net/malone/bugs/32054

I wonder if that should be the default message for future commits or if
you should need to give it with -F?

--
Martin

Revision history for this message
David Allouche (ddaa) wrote :

I would not like to "bzr commit" to ever go and commit without "-m" or starting an editor, that would break least surprise.

Though "commit -F" (standing for, what?) to use the message specified on the last commit attempt if it failed sounds useful.

Revision history for this message
Michael Ellerman (michael-ellerman) wrote : Re: [Bug 32054] if commit fails commit message draft is lost

I'd suggest:

# bzr commit
<editor starts, _long_ message gets typed in>
Error: Something is wrong!
# fix something
# bzr commit
<editor starts, message is populated with message from previous attempt>

# bzr commit -m "foo bar"
Error: Something is wrong!
# bzr commit
<editor starts, message is populated with message from previous attempt>

OR

# bzr commit --last-message
<commit with message from previous attempt>

Not sure about "--last-message" though.

Revision history for this message
David Allouche (ddaa) wrote :

--last-message should not be required to retrieve the message from the previous failed attempt. It is a matter of sensible defaults.

An option (-L, -F, --last-message, whatever) would be useful to just commit with the message from the previous failed attempt. The typical use case would be something like "oops, network was down, trying again" (cannot be really caught before the commit is actually attempted) or "duh, forgot bzr resolve" (could be caught before starting the editor, but that would still happen when using the "-m" option).

Of course, this option must cause "commit" to fail if the last commit was successful.

Revision history for this message
Martin Pool (mbp) wrote :

Confirmed.

Changed in bzr:
status: Unconfirmed → Confirmed
Revision history for this message
John A Meinel (jameinel) wrote :

There is a patch available for this, which sort of got dropped:
http://news.gmane.org/find-root.php?group=gmane.comp.version-control.bazaar-ng.general&article=16270

It should be simple to fix this for 0.12.

Changed in bzr:
assignee: nobody → jameinel
Revision history for this message
John A Meinel (jameinel) wrote :

Martin has Cheuksan Edward Wang's patch, which he wants to make 1 cleanup before merging. Pushing it back to 0.13, though.

Changed in bzr:
assignee: jameinel → mbp
status: Confirmed → Fix Committed
Revision history for this message
Wouter van Heyst (larstiq) wrote :

merged in r2113

Changed in bzr:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.