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

[BUG] git diff --(src|dst)-prefix=// causes spurious "(new|deleted) file mode"

From
Noam Postavsky <npostavs@users.sourceforge.net>
Date
May 28, 2014, 01:55 UTC
Message-ID
<CAM-tV-9vQPPj+TemYnzjRMTjaHqwo3qq=WWJ89VnRMAeYXHZZw@mail.gmail.com>
% git init
Initialized empty Git repository in /home/npostavs/tmp/scratch/.git/
% echo foo > x
% git add x
% git commit -m x
[master (root-commit) 41be1f2] x
 1 file changed, 1 insertion(+)
 create mode 100644 x
% echo bar > x
% git diff  | head -3
diff --git i/x w/x
index 257cc56..5716ca5 100644
--- i/x
% git diff --dst-prefix=// | head -3
diff --git i/x //x
deleted file mode 100644
index 257cc56..5716ca5 100644
% git diff --src-prefix=// | head -3
diff --git //x w/x
new file mode 100644
index 257cc56..5716ca5 100644
% git diff --src-prefix=// --dst-prefix=// | head -3
diff --git //x //x
new file mode 100644
index 257cc56..5716ca5 100644
% git --version
git version 1.9.2

Background: trying to find a prefix that can't show up in file names
in order to make parsing easier.
https://github.com/magit/magit/pull/1379
https://github.com/magit/magit/pull/1383
Next: Junio C Hamano
Message 1 of 2 in “[BUG] git diff --(src|dst)-prefix=// causes spurious "(new|deleted) file mode"”
  1. Noam PostavskyMay 28, 2014
  2. Junio C HamanoMay 28, 2014

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.