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

Re: git-reflog bails if branch points to bad commit

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Sep 23, 2010, 20:35 UTC
Message-ID
<AANLkTimzQ5Jdw5oqiE17859YBiM0EQ6fnTp5+x6JR48k@mail.gmail.com>
In-Reply-To
<F628129C-56AE-4BB5-9227-4282763C5B7E@sb.org>
On Thu, Sep 23, 2010 at 20:13, Kevin Ballard <kevin@sb.org> wrote:
Show 10 quoted lines
> Attempting to use `git reflog show foo` or `git log -g foo` will
> bail with "bad object: foo" if the tip commit of foo is
> invalid. This seems incredibly non-useful. Why should reflog care if
> foo points to a valid commit? This bug prevents reflog from being
> used in a time of great need, which someone just ran into on the
> #git IRC channel. Their power cut out and they ended up with a
> corrupt commit on the tip of their branch, and they simply could not
> view the reflog, which would have enabled them to roll the branch
> back to a previous commit. Does anybody know why reflog has this
> behavior?

As you say the repository is probably corrupted, and recovering from that may be hard, not much you can do with corrupted data.

Can this person provide a tar-ed copy of the repository so we can look at it and be of help, instead of speculating?

Previous: Kevin BallardNext: Kevin Ballard
Message 2 of 4 in “git-reflog bails if branch points to bad commit”
  1. Kevin BallardSep 23, 2010
  2. Ævar Arnfjörð BjarmasonSep 23, 2010
  3. Kevin BallardSep 23, 2010
  4. Kevin BallardSep 23, 2010

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.