git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Git diff --no-index --no-prefix output loses leading slash in paths
@ 2018-06-18 14:33 George King
  2018-06-18 14:59 ` Duy Nguyen
  0 siblings, 1 reply; 3+ messages in thread
From: George King @ 2018-06-18 14:33 UTC (permalink / raw)
  To: git

As of 2.17.1, `git diff --no-index --no-prefix relative/path /absolute/path` produces the following:

diff --git relative/path absolute/path
index XXXXXXX..YYYYYYY ZZZZZZ
--- relative/path
+++ absolute/path

The leading slash on `absolute/path` is lost. This is unfortunate; my use case is a diff highlighter that parses and reformats paths so that code editors can autodetect them and link to the files. 

Would the maintainers please consider fixing the output to preserve absolute paths?

Thank you,
George King


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Git diff --no-index --no-prefix output loses leading slash in paths
  2018-06-18 14:33 Git diff --no-index --no-prefix output loses leading slash in paths George King
@ 2018-06-18 14:59 ` Duy Nguyen
  2018-06-18 15:01   ` George King
  0 siblings, 1 reply; 3+ messages in thread
From: Duy Nguyen @ 2018-06-18 14:59 UTC (permalink / raw)
  To: george.w.king; +Cc: Git Mailing List

On Mon, Jun 18, 2018 at 4:36 PM George King <george.w.king@gmail.com> wrote:
>
> As of 2.17.1, `git diff --no-index --no-prefix relative/path /absolute/path` produces the following:

I checked as far back as v1.4.0 and git behaved the same way too. What
version did it work for you? Or is this not a regression, rather a
feature request?

> diff --git relative/path absolute/path
> index XXXXXXX..YYYYYYY ZZZZZZ
> --- relative/path
> +++ absolute/path
>
> The leading slash on `absolute/path` is lost. This is unfortunate; my use case is a diff highlighter that parses and reformats paths so that code editors can autodetect them and link to the files.
>
> Would the maintainers please consider fixing the output to preserve absolute paths?
>
> Thank you,
> George King
>
-- 
Duy

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Git diff --no-index --no-prefix output loses leading slash in paths
  2018-06-18 14:59 ` Duy Nguyen
@ 2018-06-18 15:01   ` George King
  0 siblings, 0 replies; 3+ messages in thread
From: George King @ 2018-06-18 15:01 UTC (permalink / raw)
  To: Duy Nguyen; +Cc: Git Mailing List

This is a feature request; sorry for the confusion. My guess is that it's a corner case that was not considered due to the default prefixing.


> On Jun 18, 2018, at 10:59 AM, Duy Nguyen <pclouds@gmail.com> wrote:
> 
> On Mon, Jun 18, 2018 at 4:36 PM George King <george.w.king@gmail.com> wrote:
>> 
>> As of 2.17.1, `git diff --no-index --no-prefix relative/path /absolute/path` produces the following:
> 
> I checked as far back as v1.4.0 and git behaved the same way too. What
> version did it work for you? Or is this not a regression, rather a
> feature request?
> 
>> diff --git relative/path absolute/path
>> index XXXXXXX..YYYYYYY ZZZZZZ
>> --- relative/path
>> +++ absolute/path
>> 
>> The leading slash on `absolute/path` is lost. This is unfortunate; my use case is a diff highlighter that parses and reformats paths so that code editors can autodetect them and link to the files.
>> 
>> Would the maintainers please consider fixing the output to preserve absolute paths?
>> 
>> Thank you,
>> George King
>> 
> -- 
> Duy


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-06-18 15:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-18 14:33 Git diff --no-index --no-prefix output loses leading slash in paths George King
2018-06-18 14:59 ` Duy Nguyen
2018-06-18 15:01   ` George King

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).