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

Re: [PATCH (amend)] diff: Make numstat machine friendly also for renames (and copies)

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 12, 2007, 19:07 UTC
Message-ID
<7v4pen91fn.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<200712121131.01471.jnareb@gmail.com>
Jakub Narebski <jnareb@gmail.com> writes:
Show 10 quoted lines
> BTW. I have noticed something strange with current (after my two
> patches) diffstat code:
>
>  3606:[gitweb/web@git]# ./git diff-tree -C -C -r --stat gitweb/test~8 
>  0456a2ba58efb0e1d5f7421d5a8a2278e3b15ebc
>   .../test/file with spaces\tand\ttabs"              |    4 +++-
>   1 files changed, 3 insertions(+), 1 deletions(-)
>  3607:[gitweb/web@git]# ./git diff-tree -C -C -r --numstat gitweb/test~8
>  0456a2ba58efb0e1d5f7421d5a8a2278e3b15ebc
>  3       1       gitweb/test/file with spaces    "gitweb/test/file with spaces\tand\ttabs"

If you are wondering about the lack of => in --stat when --numstat is showing rename, there is nothing strange going on. "filename scaling" done in --stat happens way later than pprint_rename() in the current code structure (essentially, it chomps at the last slash to keep the long "path" fit within the given space). --stat (not --numstat) is for human consumption and showing longer part of the name of postimage is more important if we do not have enough room, and most tools that enable rename use --summary with --stat anyway, so the rename information for such an oddball long path can be found out elsewhere in the output if needed.

Previous: Jakub NarebskiNext: Junio C Hamano
Message 10 of 12 in “diff: Make numstat machine friendly also for renames (and copies)”
  1. diff: Make numstat machine friendly also for renames (and copies)Jakub Narebski, Dec 10, 2007
  2. diff: Make numstat machine friendly also for renames (and copies)Jakub Narebski, Dec 10, 2007
  3. Junio C HamanoDec 11, 2007
  4. Jakub NarebskiDec 11, 2007
  5. Junio C HamanoDec 11, 2007
  6. Jakub NarebskiDec 11, 2007
  7. Junio C HamanoDec 12, 2007
  8. Jakub NarebskiDec 12, 2007
  9. Jakub NarebskiDec 12, 2007
  10. Junio C HamanoDec 12, 2007
  11. Junio C HamanoDec 10, 2007
  12. Jakub NarebskiDec 10, 2007

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.