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

Re: [PATCH] checkout: Don't crash when switching away from an invalid branch.

From
AJAlexandre Julliard <julliard@winehq.org>
Date
Nov 8, 2008, 10:07 UTC
Message-ID
<87k5bea5uq.fsf@wine.dyndns.org>
In-Reply-To
<7vbpwrf85x.fsf@gitster.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
> For that matter, dying without removing the trace of that funny state
> might be even preferrable if you need to do postmortem to figure out why
> you got into such a funny state to begin with, but not everybody uses git
> to debug git.

It turns out to be user error, that was a tree I hadn't used in a long time and I didn't realize it was using alternates, so HEAD was pointing to a commit that had been rebased and garbage-collected in the source repository.

Most other commands die with a "bad object HEAD" in that situation, and checkout could certainly do that too, but I think it's nicer to provide an easy way of getting out of that broken state. I'll resend an updated patch.

-- 
Alexandre Julliard
julliard@winehq.org
Previous: Junio C Hamano
Message 5 of 5 in “checkout: Don't crash when switching away from an invalid branch.”
  1. checkout: Don't crash when switching away from an invalid branch.Alexandre Julliard, Nov 7, 2008
  2. Johannes SchindelinNov 7, 2008
  3. Alexandre JulliardNov 7, 2008
  4. Junio C HamanoNov 7, 2008
  5. Alexandre JulliardNov 8, 2008

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.