Re: [PATCH 1/2] diff: document behavior of relative diff.orderFile
On 2017-01-10 01:58, Jeff King wrote:
Show 23 quoted lines
> On Mon, Jan 09, 2017 at 07:40:30PM -0500, Richard Hansen wrote:
>
>> Document that a relative pathname for diff.orderFile is interpreted as
>> relative to the top-level work directory.
>>
>> Signed-off-by: Richard Hansen <hansenr@google.com>
>> ---
>> Documentation/diff-config.txt | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/Documentation/diff-config.txt b/Documentation/diff-config.txt
>> index 58f4bd6af..875212045 100644
>> --- a/Documentation/diff-config.txt
>> +++ b/Documentation/diff-config.txt
>> @@ -101,6 +101,8 @@ diff.noprefix::
>> diff.orderFile::
>> File indicating how to order files within a diff, using
>> one shell glob pattern per line.
>> + If `diff.orderFile` is a relative pathname, it is treated as
>> + relative to the top of the work tree.
>> Can be overridden by the '-O' option to linkgit:git-diff[1].
>
> What happens in a bare repository?
I didn't know which is why this patch is silent on that topic. :)
>
> I'm guessing it's relative to the top-level of the repository,
I just tried it out and it's relative to $PWD.
> but we should probably spell it out.
Do we want it to be relative to $PWD? I think relative to $GIT_DIR is more useful. If we want it to be relative to $GIT_DIR, then I think we should stay silent regarding bare repositories so that the behavior remains unspecified until we update the logic.
>
> The other case is --no-index when we are not in a repository at all, but
> that should just be relative to the current directory,
> which isn't really worth mentioning.
Agreed.
I'll post a re-roll if people prefer the current behavior over relative to $GIT_DIR.
Thanks for reviewing, Richard
>
> -Peff