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

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:43:57

Jakub Narebski [off-list ref] writes:
"git diff --numstat" used the same format as "git diff --stat" for
renamed (and copied) files, except that filenames were not shortened
when they didn't fit in the column width.  This format is suitable for
human consumption, but it cannot be unambiguously parsed.
Agreed about the (un)parsability, and --numstat is all about parsability
so I would not object.  A fix is really needed there.

I do not have time to look at the patch right now, but if the changed
output is in line with what --name-status would show, that would be
great.  I'd call that "the format that should have been from day one".

I.e. no '=>' rename marker, but show two names c-quoted (unless -z is
used) and separated with inter_name_termination).  IIRC, that is how
rename/copy is shown with --name-status.

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

From: Jakub Narebski <hidden>
Date: 2016-06-15 22:43:57

Junio C Hamano wrote:
Jakub Narebski [off-list ref] writes:
quoted
"git diff --numstat" used the same format as "git diff --stat" for
renamed (and copied) files, except that filenames were not shortened
when they didn't fit in the column width.  This format is suitable for
human consumption, but it cannot be unambiguously parsed.
Agreed about the (un)parsability, and --numstat is all about parsability
so I would not object.  A fix is really needed there.

I do not have time to look at the patch right now, but if the changed
output is in line with what --name-status would show, that would be
great.  I'd call that "the format that should have been from day one".

I.e. no '=>' rename marker, but show two names c-quoted (unless -z is
used) and separated with inter_name_termination).  IIRC, that is how
rename/copy is shown with --name-status.
Unfortunately this is not possible, at least if we want to retain
the assertion that -z output looks like normal output, only without
quoting.

diff --name-status has _status_ field which can be used to distinguish
if the NUL (for -z output) is the end of source filename, or the end
of record.

The patch send changes --numstat to use only _destination_ name.
What you want I'd left for futore --numstat-extended (basically --numstat,
but with status field.

-- 
Jakub Narebski
Poland
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help