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

"git am --abort" screwing up index?

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Aug 16, 2015, 19:46 UTC
Message-ID
<CA+55aFwDkQAS8ULiLt9N5NVOYJ242Nd2MOWeiRX8HrVHXf2zog@mail.gmail.com>

So I just noticed while applying a patch with "git am" when I had a dirty tree, and I ended up getting a failure and starting over:

   [torvalds@i7 linux]$ git am --abort
   [torvalds@i7 linux]$ git reset --hard
   Checking out files: 100% (50794/50794), done.0794)
   HEAD is now at 1efdb5f0a924 Merge tag 'scsi-fixes' of
git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi

and the thing I reacted to is that the "git reset --hard" re-checked out all the files.

That implies that "git am --abort" ended up leaving the index in a bad state, presumably it re-did the index entirely from HEAD, without filling it in with the stat() details from the old index.

Maybe it has always done this, and I just haven't noticed (I usually _just_ do the "git reset --hard" thing, don't ask me why I wanted to be doubly sure this time). But maybe it's an effect of the new built-in "am".

I'm about to go out and don't have time to debug this any further right now, but I'll try to get back to it later. I thought I'd send out this email in case it makes Paul goes "ahh, yes.. obvious"

Not a big deal - things *work* fine. But forcing checking out every file obviously also means that subsequent builds end up being slowed down etc.,.

                  Linus
Next: Linus Torvalds
Message 1 of 9 in “"git am --abort" screwing up index?”
  1. Linus TorvaldsAug 16, 2015
  2. Linus TorvaldsAug 16, 2015
  3. Johannes SchindelinAug 17, 2015
  4. am --abort: merge ORIG_HEAD tree into indexPaul Tan, Aug 17, 2015
  5. Johannes SchindelinAug 17, 2015
  6. Linus TorvaldsAug 17, 2015
  7. Junio C HamanoAug 17, 2015
  8. am --skip/--abort: merge HEAD/ORIG_HEAD tree into indexPaul Tan, Aug 19, 2015
  9. Junio C HamanoAug 19, 2015

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.