threads / bug / 27076

Possible bug with multiple mv's and diff output

Subject: Possible bug with multiple mv's and diff output

## tl;dr

2 messages between Apr 12, 2011 and Apr 12, 2011.

replies: 1people: 2as markdown or json

Kent Leonard· Apr 12, 2011, 17:58 UTC · lore
Hi all,
When I do this in repo with files a and b:
  git mv b c
  git mv a b
  git commit -m shuffle
  git diff --summary master^ master
I get output:
  delete mode 100644 a
  create mode 100644 c
Which does not indicate that the contents of b changed.
  git diff --summary --find-copies --find-renames master^ master
gives output
  delete mode 100644 a
  copy b => c (100%)
which also doesn't show that b changed.
"git diff --raw" shows more complete information.
I am misunderstanding what should happen, or is this incorrect?

Thanks, Kent Leonard

Junio C Hamano· Apr 12, 2011, 20:45 UTC · re: Kent Leonard · lore

Re: Possible bug with multiple mv's and diff output

Kent Leonard <kleonard@accurev.com> writes:
Show 10 quoted lines
> When I do this in repo with files a and b:
>   git mv b c
>   git mv a b
>   git commit -m shuffle
>   git diff --summary master^ master
>
> I get output:
>   delete mode 100644 a
>   create mode 100644 c
> Which does not indicate that the contents of b changed.

Isn't that because --summary is only about tree-structural changes? If b was in preimage and b still is in postimage, as far as b is concerned that path stayed in the tree across the change, and there is nothing to report.

> "git diff --raw" shows more complete information.

Try something more sensible like "--summary --stat" instead of "--summary" alone, perhaps?

← back to recent threads