git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* How to verify that lines were only moved, not edited?
@ 2011-10-19 14:34 Johannes Sixt
  2011-10-19 16:33 ` Jeff King
  2011-10-19 17:07 ` Junio C Hamano
  0 siblings, 2 replies; 5+ messages in thread
From: Johannes Sixt @ 2011-10-19 14:34 UTC (permalink / raw)
  To: git

I thought there was a way to use git-blame to find out whether a change
only shuffled lines, but otherwise did not modify them. I tried "git blame
-M -- the/file", but it does not work as expected, neither with a toy file
nor with a 5000+ lines file (with 55 lines moved).

git init
echo A > foo
echo B >> foo
git add foo
git commit -m initial
echo B > foo
echo A >> foo
git commit -a -m swapped

The results are:
$ git blame -M -s -- foo
^e3abca2 1) B
6189cb46 2) A

I would have expected:
^e3abca2 1) B
^e3abca2 2) A

Oh, look! This produces the expected result:
$ git blame -M1 -s -- foo

while this produces the same as with just -M:
$ git blame -M2 -s -- foo

But neither helps with my 5000+ lines file. Does it mean that the lines
were changed? But I'm sure they were just moved! Please help!

-- Hannes

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-10-20  6:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-19 14:34 How to verify that lines were only moved, not edited? Johannes Sixt
2011-10-19 16:33 ` Jeff King
2011-10-20  6:20   ` Johannes Sixt
2011-10-19 17:07 ` Junio C Hamano
2011-10-20  6:25   ` Johannes Sixt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).