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

rev-parse doesn't take pwd into consideration

From
LRLuciano Rocha <luciano@eurotux.com>
Date
May 26, 2008, 19:58 UTC
Message-ID
<20080526195812.GA23396@bit.office.eurotux.com>
Hello,

I was frustrated for some minutes trying to get the HEAD version of a file, as is in the documentation. Using git's source as an example: git/Documentation$ git show HEAD:docbook.xsl fatal: ambiguous argument 'HEAD:docbook.xsl': unknown revision or path not in the working tree. Use '--' to separate paths from revisions

<hmmm>

$ git show HEAD -- docbook.xsl <nil> $

Seeing in the documentation that the parsing was made by git-rev-parse, I tried running git-rev-parse directly, ending with the same error.

I tried with the full path, just in case, but it didn't work also ($PWD/docbook.xsl).

Until finally I tried the absolute path as git is concerned, and it worked.

It works anywhere: git$ git show HEAD:Documentation/docbook.xsl <contents> git/Documentation$ git show HEAD:Documentation/docbook.xsl <contents> ...

Is it difficult to make rev-parse accept relative path specifications?
-- 
Luciano Rocha <luciano@eurotux.com>
Eurotux Informática, S.A. <http://www.eurotux.com/>
Next: Junio C Hamano
Message 1 of 11 in “rev-parse doesn't take pwd into consideration”
  1. Luciano RochaMay 26, 2008
  2. Junio C HamanoMay 26, 2008
  3. しらいしななこMay 26, 2008
  4. Johannes SchindelinMay 26, 2008
  5. Junio C HamanoMay 26, 2008
  6. しらいしななこMay 27, 2008
  7. Luciano RochaMay 26, 2008
  8. Luciano RochaMay 26, 2008
  9. Johannes SchindelinMay 26, 2008
  10. Teemu LikonenMay 26, 2008
  11. Luciano RochaMay 26, 2008

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.