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, 08:46 UTC
Message-ID
<4CA44E7D.7090901@dbservice.com>
In-Reply-To
<AANLkTi=Zz-1dSC0imJ3NZXWcdvhXWXt-Kk94zwKe8+6Y@mail.gmail.com>
On 9/30/10 7:02 AM, Geoff Russell wrote:
> Hi,
> 
> $ git show XXXX:data/path/object.c
Show me the contents of the file at data/path/object.c in revision XXXX.
Show 5 quoted lines
> Gives me what I want, a cat of the objects contents. However
> for some files I get a message about ambiguous argument telling me to
> separate paths from revisions with '--'. Okay so I try that:
> 
> $ git show -- XXXX:data/path/object.c

Show me the commit HEAD but limit the diff to the path XXXX:data/path/object.c.

There is an implicit HEAD before the double dash. You probably want the double dash *after* the object, to force git to parse that string as an object and not a path:

$ git show XXXX:data/path/object.c --
> But it gives me nothing
> 
> $ git show XXXX -- data/path/object.c
Show me the commit XXXX but limit the diff to the path data/path/object.c.
Show 6 quoted lines
> Gives me a git diff output for the object.
> 
> 
> This is all with git 1.6.2.3
> 
> What's happening here? Why aren't all these equivalent?
no.
tom
Previous: Geoff RussellNext: Tomas Carnecky
Message 2 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.