git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
George King <george.w.king@gmail.com>
Date
Jun 18, 2018, 14:33 UTC
Message-ID
<DFDB0568-9543-4135-A56D-821D4244DC8A@gmail.com>
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
Next: Duy Nguyen
Message 1 of 3 in “Git diff --no-index --no-prefix output loses leading slash in paths”
  1. George KingJun 18, 2018
  2. Duy NguyenJun 18, 2018
  3. George KingJun 18, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.