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

Re: [PATCH] checkout: indicate when a detached head is checked out for a branch

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Jul 21, 2014, 13:03 UTC
Message-ID
<53CD0FA0.1030600@drmicha.warpmail.net>
In-Reply-To
<xmqqpph2l39d.fsf@gitster.dls.corp.google.com>
Junio C Hamano venit, vidit, dixit 19.07.2014 00:18:
Show 14 quoted lines
> Dennis Kaarsemaker <dennis@kaarsemaker.net> writes:
> 
>> My use case for this is checking out the same branch (or commit, so
>> already on a detached HEAD) in multiple different places to run
>> independent actions (e.g. make test with different compiler options, or
>> creating several different packages) and I would really appreciate it if
>> that would keep working.
> 
> I do not have any problem if multiple working trees have the same
> commit checked out on their own detached HEADs at all.  The "should
> error out" was solely for the case where the user asked not to detach
> but to obtain a state where a named branch is checked out.  In such
> a case, the command should not turn it into a detached HEAD, with or
> without a warning.
Exactly, all of that, plus:
* "git checkout --detach --to foo bar" could/should be a way to spell out
"git checkout --to foo bar^0".
* In the case of erroring out, "git checkout" could suggest one of the
above two commands.
Michael
Previous: Junio C Hamano
Message 8 of 8 in “checkout: indicate when a detached head is checked out for a branch”
  1. checkout: indicate when a detached head is checked out for a branchMichael J Gruber, Jul 18, 2014
  2. Duy NguyenJul 18, 2014
  3. Michael J GruberJul 18, 2014
  4. Max KirillovJul 18, 2014
  5. Junio C HamanoJul 18, 2014
  6. Dennis KaarsemakerJul 18, 2014
  7. Junio C HamanoJul 18, 2014
  8. Michael J GruberJul 21, 2014

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.