Git diff --no-index --no-prefix output loses leading slash in paths

3 messages, 2 authors, 2018-06-18 · open the first message on its own page

Git diff --no-index --no-prefix output loses leading slash in paths

From: George King <hidden>
Date: 2018-06-18 14:33:37

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

Re: Git diff --no-index --no-prefix output loses leading slash in paths

From: Duy Nguyen <hidden>
Date: 2018-06-18 14:59:32

On Mon, Jun 18, 2018 at 4:36 PM George King [off-list ref] 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?
quoted hunk
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

Re: Git diff --no-index --no-prefix output loses leading slash in paths

From: George King <hidden>
Date: 2018-06-18 15:01:20

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 [off-list ref] wrote:

On Mon, Jun 18, 2018 at 4:36 PM George King [off-list ref] wrote:
quoted
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?
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help