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

Re: git -p does not detect a bare repository

From
Jeff King <peff@peff.net>
Date
Aug 13, 2008, 16:51 UTC
Message-ID
<20080813165135.GA19490@sigill.intra.peff.net>
In-Reply-To
<48A2E6D9.5000609@viscovery.net>
On Wed, Aug 13, 2008 at 03:51:21PM +0200, Johannes Sixt wrote:
Show 11 quoted lines
> 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
Previous: Johannes Sixt
Message 2 of 2 in “git -p does not detect a bare repository”
  1. Johannes SixtAug 13, 2008
  2. Jeff KingAug 13, 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.