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

rename tracking and file-name swapping

From
YDYuri D'Elia <wavexx@users.sf.net>
Date
Sep 13, 2009, 11:17 UTC
Message-ID
<wavexx-2ECE7F.13171313092009@ger.gmane.org>
Hi everyone. Does rename tracking recognize two file names being swapped?
% ls -l
total 24
-rw-rw-r--   1 wavexx  wavexx  5952 Sep 13 13:09 file1.txt
-rw-rw-r--   1 wavexx  wavexx  3330 Sep 13 13:09 file2.txt
% mv file1.txt file3.txt 
% mv file2.txt file1.txt
% mv file3.txt file2.txt
% git add file1.txt file2.txt 
% git diff -M --stat --cached
 file1.txt |  150 +++++++++++++++++++++++-------------------------------------
 file2.txt |  150 +++++++++++++++++++++++++++++++++++++-----------------------
 2 files changed, 150 insertions(+), 150 deletions(-)
I would expect at least to see
  file1.txt => file2.txt
  file2.txt => file1.txt
if the contents are totally unchanged.
Am I doing something wrong?
Thanks
Next: Junio C Hamano
Message 1 of 7 in “rename tracking and file-name swapping”
  1. Yuri D'EliaSep 13, 2009
  2. Junio C HamanoSep 13, 2009
  3. Yuri D'EliaSep 13, 2009
  4. Johannes SixtSep 14, 2009
  5. [Bug?] "diff -B --color" output doesn't show space errorsNanako Shiraishi, Sep 15, 2009
  6. Junio C HamanoSep 15, 2009
  7. diff --whitespace: fix blank lines at endJunio C Hamano, Sep 15, 2009

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.