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

Re: rev-parse doesn't take pwd into consideration

From
TLTeemu Likonen <tlikonen@iki.fi>
Date
May 26, 2008, 20:18 UTC
Message-ID
<20080526201842.GA8194@mithlond.arda.local>
In-Reply-To
<20080526195812.GA23396@bit.office.eurotux.com>
Luciano Rocha wrote (2008-05-26 20:58 +0100):
> Is it difficult to make rev-parse accept relative path specifications?

I don't know but let's consider this: The revision user is asking for with "git show <commit>:<path>" may not even contain the directory user is currently in. Also, there may not be any working directory at all, or user may be completely outside the repository and using "git --git-dir=/somewhere/else". I guess the system is much simpler as the "<commit>:" always refers to repository's root.

If you are using Git's bash completions it's easy to complete paths with "git show <commit>:". For example, try

  $ git show HEAD~10:Docum<tab>
and the path is completed.
Previous: Johannes SchindelinNext: Luciano Rocha
Message 10 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.