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

Re: behaviour of git diff, GIT_DIR & checked out tree

From
DTDavid Tweed <david.tweed@gmail.com>
Date
Sep 24, 2007, 13:16 UTC
Message-ID
<e1dab3980709240616p5badae12t23ffd323a0d873d@mail.gmail.com>
In-Reply-To
<Pine.LNX.4.64.0709241400410.28395@racer.site>
On 9/24/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> Yes, this is fully expected.
>
> The @{time} notation accesses the _reflogs_, which are purely local
> beasts.  They are not transmitted when cloning.

Thanks of your reply; however I suspect this isn't the problem here since I just tried with just master and I get the same thing. To be clear, I'm doing this on the same machine with the same user account as the git directory, just from a directory outside the git tree, eg, the git tracked tree is in $HOME/V and I'm in $HOME/A running

env GIT_DIR=$HOME/V/.git git diff master

As a guess without looking at the code, what I imagine is happening is that git diff limits showing changes to the directory tree below $PWD, and when $PWD isn't actually within the git dir that ends up somehow as an empty tree.

-- 
cheers, dave tweed__________________________
david.tweed@gmail.com
Rm 124, School of Systems Engineering, University of Reading.
"we had no idea that when we added templates we were adding a Turing-
complete compile-time language." -- C++ standardisation committee
Previous: Johannes SchindelinNext: Junio C Hamano
Message 3 of 6 in “behaviour of git diff, GIT_DIR & checked out tree”
  1. David TweedSep 24, 2007
  2. Johannes SchindelinSep 24, 2007
  3. David TweedSep 24, 2007
  4. Junio C HamanoSep 24, 2007
  5. David TweedSep 24, 2007
  6. Junio C HamanoSep 24, 2007

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.