Thread (1 message) 1 message, 1 author, 2016-06-15

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:43:36

"David Tweed" [off-list ref] writes:
... I'm just asking if there's a way to say
"the `working dir' associated with this git dir" explicitly (in the same
way I can use `HEAD' to refer to the topmost commit on the
current branch) when you're not somewhere within the 'working dir'.
Not for "git diff <one-tree>" which is a way to diff the _part_
of work tree you are _currently in_ with the given tree, nor for
"git diff" which is to do the same with the index.  With these
commands (and others that error out when you run without GIT_DIR
outside the work tree), you are really expected to be _in_ the
subdirectory you are interested in.

GIT_WORK_TREE is somewhat related but is a different issue, by
the way.  It is to let you say where the top level of the work
tree is.  It does not change the fact that the way for you to
express which subdirectory in the work tree you are interested
in to work tree commands is by your $PWD relative to the top of
the work tree.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help