Re: [PATCH] diff: don't attempt to strip prefix from absolute Windows paths

2018-10-18 Thread Junio C Hamano
Johannes Sixt writes: > Use is_absolute_path() to detect Windows style absolute paths. When cd676a51 ("diff --relative: output paths as relative to the current subdirectory", 2008-02-12) was done, neither "is_dir_sep()" nor "has_dos_drive_prefix()" existed---the latter had to wait until

Re: [PATCH] diff: don't attempt to strip prefix from absolute Windows paths

2018-10-18 Thread Johannes Sixt
Am 18.10.18 um 20:49 schrieb Stefan Beller: > On Thu, Oct 18, 2018 at 11:38 AM Johannes Sixt wrote: > >> There is one peculiarity, though: [...] > > The explanation makes sense, and the code looks good. > Do we want to have a test for this niche case? > Good point. That would be the

Re: [PATCH] diff: don't attempt to strip prefix from absolute Windows paths

2018-10-18 Thread Stefan Beller
On Thu, Oct 18, 2018 at 11:38 AM Johannes Sixt wrote: > There is one peculiarity, though: [...] The explanation makes sense, and the code looks good. Do we want to have a test for this niche case?

[PATCH] diff: don't attempt to strip prefix from absolute Windows paths

2018-10-18 Thread Johannes Sixt
git diff can be invoked with absolute paths. Typically, this triggers the --no-index case. Then the absolute paths remain in the file names that are printed in the output. There is one peculiarity, though: When the command is invoked from a a sub-directory in a repository, then it is attempted to