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

sporadic git failures on interactive rebase

From
HMHenning Moll <newsscott@gmx.de>
Date
Jan 13, 2015, 10:54 UTC
Message-ID
<trinity-5098e61e-b59a-4225-9d4c-8879dc78bb53-1421146472532@3capp-gmx-bs08>
Hi,
(git version 2.2.0)
I am currently developing/testing a script for a "history surgery" on a quite big repository (~30000 commits). The script always runs against exactly the same copy of a git repository. So things should be reproducable, but sometimes i get failures for the following sequence of commands:  

$ git checkout some_branch $ GIT_SEQUENCE_EDITOR="sed -i '1s/^pick /edit /'" git rebase -i $MERGETARGET~1 $ git rm -rf some_files $ git commit --amend --no-edit -c $MERGETARGET $ git rebase --continue

(where MERGETARGET is a valid commit id in the history of some_branch)
Here is an example output where things went wrong (MERGETARGET is 6185ac39299a740dc9bc6c5906dd1f229b3f046b). The interesting parts are the messages "c4095c1: not a commit that can be picked" and "error: short SHA1 c4095c1 is ambiguous.":

. Switched to branch 'master-flat' . c4095c1: not a commit that can be picked . 80f99bd: not a commit that can be picked . Stopped at 6185ac39299a740dc9bc6c5906dd1f229b3f046b... some_comment . You can amend the commit now, with . . git commit --amend . . Once you are satisfied with your changes, run . . git rebase --continue . rm 'some_files' . [detached HEAD 56675a06316345ac121997dde2b9eddb649d0539] some_comment . Author: user <foo.bar@com.com> . Date: Wed Sep 26 09:11:17 2012 +0000 . [more info about that commit] . error: short SHA1 c4095c1 is ambiguous. . fatal: Needed a single revision . Invalid commit name: c4095c1

Now that the command failed, i checked for ambigous c4095c1. But there is only one: $ git log -1 c4095c1 . commit c4095c1f5e7c126accf93ba68e2fa72bb055f567 . ...

Just as a test: $ git log -1 c409 . error: short SHA1 c409 is ambiguous. . error: short SHA1 c409 is ambiguous.

As i said above this issue is not strictly reproducable. I have a full backup of the working dir including the .git folder from just before the command sequence above. If i rollback and execute the commands again, everything works fine. Up to now i didn't had the situation the the sequence failed twice two in a row.
I also have the backup of the directory from directly after the sequence failure. So i can still test some commands if you need more information.
Does anybody have an idea of what's going on here?

Best regards Henning

Next: Jeff King
Message 1 of 10 in “sporadic git failures on interactive rebase”
  1. Henning MollJan 13, 2015
  2. Jeff KingJan 14, 2015
  3. Jeff KingJan 14, 2015
  4. Junio C HamanoJan 14, 2015
  5. Jeff KingJan 14, 2015
  6. Eric SunshineJan 14, 2015
  7. Eric SunshineJan 14, 2015
  8. Jeff KingJan 14, 2015
  9. Eric SunshineJan 14, 2015
  10. Junio C HamanoJan 14, 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.