git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* git rev-parse --show-toplevel doesn't work inside git-dir
@ 2013-06-05  7:34 Orgad Shaneh
  2013-06-05 16:17 ` Jeff King
  0 siblings, 1 reply; 2+ messages in thread
From: Orgad Shaneh @ 2013-06-05  7:34 UTC (permalink / raw)
  To: git

Running "git rev-parse --show-toplevel" doesn't print anything when it
is run inside .git dir (on all levels)

- Orgad

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: git rev-parse --show-toplevel doesn't work inside git-dir
  2013-06-05  7:34 git rev-parse --show-toplevel doesn't work inside git-dir Orgad Shaneh
@ 2013-06-05 16:17 ` Jeff King
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff King @ 2013-06-05 16:17 UTC (permalink / raw)
  To: Orgad Shaneh; +Cc: git

On Wed, Jun 05, 2013 at 10:34:11AM +0300, Orgad Shaneh wrote:

> Running "git rev-parse --show-toplevel" doesn't print anything when it
> is run inside .git dir (on all levels)

This is by design. "--show-toplevel" does not print anything when you
do not have a working tree, and you do not have one if you are inside
the .git directory. If you were to do:

  cd .git
  git --work-tree=.. rev-parse --show-toplevel

(or use GIT_WORK_TREE, or set core.worktree, etc), you would get back
the toplevel of the working tree.

-Peff

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-06-05 16:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-05  7:34 git rev-parse --show-toplevel doesn't work inside git-dir Orgad Shaneh
2013-06-05 16:17 ` Jeff King

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).