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

Detached HEAD and "git log --all"

From
Jakub Narebski <jnareb@gmail.com>
Date
Oct 22, 2009, 20:37 UTC
Message-ID
<200910222237.04056.jnareb@gmail.com>

When discussing differences between concept and implementation of branches in Git and in Mercurial on StackOverflow[1] (abusing SO comment system a bit), Steve Losh[2] wrote that he was surprised by the fact that "git log --all" doesn't include commits made on detached HEAD.

While documentation clearly states:
  --all  Pretend as if all the refs in `$GIT_DIR/refs/` are listed
         on the command line as <commit>.

and HEAD is in `$GIT_DIR/HEAD`, which is outside `$GIT_DIR/refs/`, it is nevertheless a bit strange that "git log --all" doesn't list all (everything).

This is of course only an issue if we are on detached HEAD; I guess that semantics of `--all` option to git-log predates this feature.

[1] http://stackoverflow.com/questions/1598759/git-and-mercurial-compare-and-contrast/1599930#1599930 [2] http://stevelosh.com/blog/entry/2009/8/30/a-guide-to-branching-in-mercurial/

-- 
Jakub Narębski      http://stackoverflow.com/users/46058/jakub-narebski
Next: Michael J Gruber
Message 1 of 3 in “Detached HEAD and "git log --all"”
  1. Jakub NarebskiOct 22, 2009
  2. Michael J GruberOct 23, 2009
  3. Michael J GruberOct 23, 2009

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.