git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git -p does not detect a bare repository
@ 2008-08-13 13:51 Johannes Sixt
  2008-08-13 16:51 ` Jeff King
  0 siblings, 1 reply; 2+ messages in thread
From: Johannes Sixt @ 2008-08-13 13:51 UTC (permalink / raw)
  To: Git Mailing List; +Cc: Jeff King

If $PWD is a bare repository, is it expected behavior that

  $ git diff-tree master^ master

works as expected, but

  $ git -p diff-tree master^ master

errors out:

  fatal: ambiguous argument 'master^': unknown revision or path blabla...

-- Hannes

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

* Re: git -p does not detect a bare repository
  2008-08-13 13:51 git -p does not detect a bare repository Johannes Sixt
@ 2008-08-13 16:51 ` Jeff King
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff King @ 2008-08-13 16:51 UTC (permalink / raw)
  To: Johannes Sixt; +Cc: Git Mailing List

On Wed, Aug 13, 2008 at 03:51:21PM +0200, Johannes Sixt wrote:

> If $PWD is a bare repository, is it expected behavior that
> 
>   $ git diff-tree master^ master
> 
> works as expected, but
> 
>   $ git -p diff-tree master^ master
> 
> errors out:
> 
>   fatal: ambiguous argument 'master^': unknown revision or path blabla...

Yep. This has been broken for some time, too. I bisected it down to
cad3a205 from last year, which is in v1.5.3.

It's yet another incarnation of the same bug we keep seeing (which I
suppose is why you cc'd me). Anytime you look at the config before
running setup_git_directory, it screws up the GIT_DIR calculation for
bare repositories. AFAIK it's a bad interaction between the lazy setup
in setup_git_env and the magic in setup_git_directory.

I'm sure there is a "right" solution but I haven't had time to figure it
out yet. In this case, we are looking at the config to get the value of
core.pager. As a workaround, you could try doing that lookup in the
forked pager child (however, I don't think that would work on platforms
where run_command doesn't use fork).

-Peff

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

end of thread, other threads:[~2008-08-13 16:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-13 13:51 git -p does not detect a bare repository Johannes Sixt
2008-08-13 16:51 ` Jeff King

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 NNTP newsgroup(s).