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

Re: [PATCH] checkout: do not corrupt HEAD on empty repo

From
Junio C Hamano <gitster@pobox.com>
Date
May 8, 2012, 17:13 UTC
Message-ID
<7v8vh2wq8u.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CABPQNSbyh8oMfz8GbDDn_bdLc8RpEt5sq7wxtVFh61ekD_j8yQ@mail.gmail.com>
Erik Faye-Lund <kusmabite@gmail.com> writes:
Show 14 quoted lines
> On Tue, May 8, 2012 at 6:43 PM, Junio C Hamano <gitster@pobox.com> wrote:
> ...
>> Hrm, I am of two minds.  Yes, we may want checkout to fail, but at the
>> same time, we would want to make sure that a failed checkout does not
>> corrupt the HEAD.
>
> Good point.
>
>>  Perhaps it would make it more palatable if you replaced
>> "cat .git/HEAD" with "git symbolic-ref HEAD" in the original?
>
> Ah, yes. That's much better. Do you want me to resend (improving the
> test and replacing "CRT" with "vsnprintf")? I also spotted a typo in
> the commit message ("crasheed" vs "crashed")...
Surely.

By the way, notice I said "we *may* want checkout to fail"? With the discussion "why is it wrong to allow 'git checkout' to be no-op in a freshly created repository" stemming from your other "I do not claim it is correct but it makes the test pass" message, we may actually want to make that 'checkout' in the test pass, and then 'test_must_fail git checkout' in the test would have to go when that happens.

Previous: Erik Faye-LundNext: Junio C Hamano
Message 5 of 10 in “checkout: do not corrupt HEAD on empty repo”
  1. checkout: do not corrupt HEAD on empty repoErik Faye-Lund, May 8, 2012
  2. Erik Faye-LundMay 8, 2012
  3. Junio C HamanoMay 8, 2012
  4. Erik Faye-LundMay 8, 2012
  5. Junio C HamanoMay 8, 2012
  6. Junio C HamanoMay 8, 2012
  7. Erik Faye-LundMay 8, 2012
  8. Junio C HamanoMay 8, 2012
  9. Erik Faye-LundMay 8, 2012
  10. Andreas SchwabMay 8, 2012

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.