# Re: [PATCH v2] git prompt: Use toplevel to find untracked files.

2 messages from 2015-03-16 to 2015-03-21. Participants: Cody Taylor, SZEDER Gábor.
Thread: https://gitlist.dev/t/38818

## Cody Taylor, 2015-03-16 00:54

Subject: Re: [PATCH v2] git prompt: Use toplevel to find untracked files.
Message-ID: <CAHWMk2aq7dW5nBW1f8T4TWfRC70hp-6kR5P79m_E4zccuy53aA@mail.gmail.com>
URL: https://gitlist.dev/e/CAHWMk2aq7dW5nBW1f8T4TWfRC70hp-6kR5P79m_E4zccuy53aA%40mail.gmail.com

```
SZEDER Gábor <szeder@ira.uka.de> writes:
> Somehow I had a hard time making sense out of "when the current working
> directory was not a parent of the untracked file".  Perhaps "when the
> untracked files are outside of the current working directory" would be
> easier to grok?

That description doesn't cover all cases.

Scenario #1: Let's say there is an untracked file at `$ROOT/file`.
When your CWD is `$ROOT/`, all is well. If you cd to `$ROOT/src/` the
ls-files command failed to find the untracked file.

Scenario #2: Let's say there is an untracked file at `$ROOT/src/file`.
The ls-files command would find the file if the CWD is `$ROOT/` or
`$ROOT/src/`, but not if the CWD is `$ROOT/bin/` or
`$ROOT/src/folder/`.

Your description may be easier to understand, but I don't agree it's accurate.

```

## SZEDER Gábor, 2015-03-21 08:46

Subject: Re: [PATCH v2] git prompt: Use toplevel to find untracked files.
Message-ID: <20150321094612.Horde.fk34YSFwRX2Ew3gKIdyzPw5@webmail.informatik.kit.edu>
URL: https://gitlist.dev/e/20150321094612.Horde.fk34YSFwRX2Ew3gKIdyzPw5%40webmail.informatik.kit.edu
In-Reply-To: <CAHWMk2aq7dW5nBW1f8T4TWfRC70hp-6kR5P79m_E4zccuy53aA@mail.gmail.com>

```

Quoting Cody Taylor <cody.taylor@maternityneighborhood.com>:

> SZEDER Gábor <szeder@ira.uka.de> writes:
>> Somehow I had a hard time making sense out of "when the current working
>> directory was not a parent of the untracked file".  Perhaps "when the
>> untracked files are outside of the current working directory" would be
>> easier to grok?
>
> That description doesn't cover all cases.

I'm not sure I understand.
I think we both say the same, though from different views: you  
describe what cwd is not relative to the untracked file in the  
problematic case, while I describe where the untracked file is  
relative to cwd in the same case.

> Scenario #1: Let's say there is an untracked file at `$ROOT/file`.
> When your CWD is `$ROOT/`, all is well. If you cd to `$ROOT/src/` the
> ls-files command failed to find the untracked file.

After cd to '$ROOT/src' the untracked file '$ROOT/file' is outside  
cwd, which matches my description and is what your patch covers.

> Scenario #2: Let's say there is an untracked file at `$ROOT/src/file`.
> The ls-files command would find the file if the CWD is `$ROOT/` or
> `$ROOT/src/`, but not if the CWD is `$ROOT/bin/` or
> `$ROOT/src/folder/`.

Again, after cd to '$ROOT/bin' the untracked file '$ROOT/src/file' is  
outside cwd, so my description and your patch cover it.

> Your description may be easier to understand, but I don't agree it's  
> accurate.

Well, I think it's accurate, but now I doubt that it's easier to understand :)


Gábor

```
