git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC PATCH] am: do not do any reset on --abort

From
Jeff King <peff@peff.net>
Date
May 25, 2009, 16:00 UTC
Message-ID
<20090525160020.GA5449@coredump.intra.peff.net>
In-Reply-To
<32541b130905250854v981277oe093ee4990726a2a@mail.gmail.com>
On Mon, May 25, 2009 at 11:54:36AM -0400, Avery Pennarun wrote:
Show 7 quoted lines
> On Mon, May 25, 2009 at 8:17 AM, Johannes Sixt <j.sixt@viscovery.net> wrote:
> >   $ git am --abort
> >   OUTCH! other-branch was reset!
> 
> If *that's* your problem, then presumably you could avoid it just by
> checking whether the right branch corresponds to HEAD before doing a
> reset.

But that only covers one problem. How about you forgot that you had a failed am in progress, waited hours or days, made some commits on the same branch, tried to am a series, got the "in progress" message and then did an "--abort"?

And yes, I have done that.

In both examples, an alternative method for dealing with this is to try to alert the user that we are in the middle of an am when doing potentially suspicious things (like switching branches or making commits outside of "git am --resolved"). I don't know how well that would work in practice.

-Peff
Previous: Avery PennarunNext: Jeff King
Message 11 of 14 in “Bug: 'git am --abort' can silently reset the wrong branch”
  1. Eduardo HabkostMay 6, 2009
  2. Jeff KingMay 8, 2009
  3. Sverre RabbelierMay 8, 2009
  4. Junio C HamanoMay 8, 2009
  5. Jeff KingMay 8, 2009
  6. am: do not do any reset on --abortJeff King, May 25, 2009
  7. Johannes SchindelinMay 25, 2009
  8. Jeff KingMay 25, 2009
  9. Johannes SixtMay 25, 2009
  10. Avery PennarunMay 25, 2009
  11. Jeff KingMay 25, 2009
  12. Jeff KingMay 25, 2009
  13. Avery PennarunMay 25, 2009
  14. Junio C HamanoMay 25, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.