Shouldn't git-ls-files --others use $GIT_DIR?

3 messages, 2 authors, 2016-08-11 · open the first message on its own page

Shouldn't git-ls-files --others use $GIT_DIR?

From: Nikolai Weibull <hidden>
Date: 2016-08-11 19:34:28

If I do

GIT_DIR=$HOME/projects/<project>/.git git ls-files --others

from, e.g., $HOME, I get a list of all the files in $HOME and its
subdirectories that aren't in said git repository.  Shouldn't --others
use $GIT_DIR, instead of ".", or am I missing something here?

Re: Shouldn't git-ls-files --others use $GIT_DIR?

From: Petr Baudis <hidden>
Date: 2016-08-11 20:13:41

On Sun, Nov 19, 2006 at 02:37:42PM CET, Nikolai Weibull wrote:
If I do

GIT_DIR=$HOME/projects/<project>/.git git ls-files --others

from, e.g., $HOME, I get a list of all the files in $HOME and its
subdirectories that aren't in said git repository.  Shouldn't --others
use $GIT_DIR, instead of ".", or am I missing something here?
git-ls-files --others lists untracked files in the current directory by
comparing it to the index stored in $GIT_DIR/index and listing files
present in the current directory but not in the index.

GIT_DIR is a path to the Git repository the commands should work with,
but if they work on working tree, they look at the current directory for
it.

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
The meaning of Stonehenge in Traflamadorian, when viewed from above, is:
"Replacement part being rushed with all possible speed."

Re: Shouldn't git-ls-files --others use $GIT_DIR?

From: Nikolai Weibull <hidden>
Date: 2016-08-11 20:45:21

On 11/19/06, Petr Baudis [off-list ref] wrote:
On Sun, Nov 19, 2006 at 02:37:42PM CET, Nikolai Weibull wrote:
quoted
If I do

GIT_DIR=$HOME/projects/<project>/.git git ls-files --others

from, e.g., $HOME, I get a list of all the files in $HOME and its
subdirectories that aren't in said git repository.  Shouldn't --others
use $GIT_DIR, instead of ".", or am I missing something here?
git-ls-files --others lists untracked files in the current directory by
comparing it to the index stored in $GIT_DIR/index and listing files
present in the current directory but not in the index.
Ah, of course; how silly of me.  Thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help