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

git rev-parse --git-dir does report yield relative path to git directory, per documentation

From
Jon Seymour <jon.seymour@gmail.com>
Date
May 17, 2012, 09:03 UTC
Message-ID
<CAH3Anrrb243zdRJJEqDcWrHBVBDdYkGB=sTG7BbjTzsUHvWY-w@mail.gmail.com>
Per this advice in git-rev-parse(1):
     Show $GIT_DIR if defined. Otherwise show the path to the .git
directory, relative to the current directory.
I had expected this:

cd /tmp && rm -rf foobar && mkdir foobar && cd foobar && git init && mkdir tmp && :> tmp/.gitignore && git add tmp && cd tmp && git rev-parse --git-dir

to report:

Initialized empty Git repository in /tmp/foobar/.git/ ../.git

but in actual fact it reports:

Initialized empty Git repository in /tmp/foobar/.git/ /tmp/foobar/.git

git version 1.7.10.1.514.ge33c7ea
Am I misunderstanding the meaning of the term "relative" in quote above?
jon.
Next: Junio C Hamano
Message 1 of 7 in “git rev-parse --git-dir does report yield relative path to git directory, per documentation”
  1. Jon SeymourMay 17, 2012
  2. Junio C HamanoMay 17, 2012
  3. Jonathan NiederMay 17, 2012
  4. Documentation: git-rev-parse: clarify that --git-dir does not necessarily show relative pathsJon Seymour, May 18, 2012
  5. Jonathan NiederMay 18, 2012
  6. Junio C HamanoMay 18, 2012
  7. Nguyen Thai Ngoc DuyMay 18, 2012

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.