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

Re: wierd git show syntax

From
Tomas Carnecky <tom@dbservice.com>
Date
Sep 30, 2010, 09:02 UTC
Message-ID
<4CA4520F.30809@dbservice.com>
In-Reply-To
<4CA44E7D.7090901@dbservice.com>
On 9/30/10 10:46 AM, Tomas Carnecky wrote:
>> What's happening here? Why aren't all these equivalent?
> 
> no.
A 'no' does not really fit a 'why?' question. I should explain.

Someone (Linus?) long ago decided that the revision parsing work that way. It's pretty powerful, even the smallest colon and double dash have a meaning. But it can be complicated for someone new to git to understand. See 'man gitrevisions' to understand how git parses revisions. Sadly the effect of double bash is not described in the git-show man page. But in most commands it's used to separate revisions from paths. Example: if you have a file and branch both named master, 'git log master --' will show you the log of that branch while 'git log -- master' will show you the log of HEAD but limit it to commits which touched the file master. Again, there's an implicit HEAD before the double dash.

tom
Previous: Tomas CarneckyNext: Matthieu Moy
Message 3 of 5 in “wierd git show syntax”
  1. Geoff RussellSep 30, 2010
  2. Tomas CarneckySep 30, 2010
  3. Tomas CarneckySep 30, 2010
  4. Matthieu MoySep 30, 2010
  5. Geoff RussellOct 4, 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.