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

Re: How to verify that lines were only moved, not edited?

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Oct 20, 2011, 06:20 UTC
Message-ID
<4E9FBDA7.3000904@viscovery.net>
In-Reply-To
<20111019163354.GB3157@sigill.intra.peff.net>
Am 10/19/2011 18:33, schrieb Jeff King:
Show 10 quoted lines
>   git init
>   seq 1 5000 >foo
>   git add foo
>   git commit -m initial
>   sed -i '/^2..$/d' foo
>   seq 200 299 >>foo
>   git commit -a -m 'move 200-299 to end'
> 
> I get the expected result from "git blame -M" (i.e., everything
> attributed to the root commit).
I see. My example is more like this:
 for i in `seq 1 20`; do md5sum - <<< $i; done > foo
 git commit -a -m foo
 for i in `seq 1 20`; do md5sum - <<< $i; done | sort > foo
 git commit -a -m foo\ sorted

i.e., the sort order of a block of lines was changed "in place". Here, most of the lines are attributed to the last commit. Am I expecting too much from git-blame to detect line motions in such a case?

-- Hannes
Previous: Jeff KingNext: Junio C Hamano
Message 3 of 5 in “How to verify that lines were only moved, not edited?”
  1. Johannes SixtOct 19, 2011
  2. Jeff KingOct 19, 2011
  3. Johannes SixtOct 20, 2011
  4. Junio C HamanoOct 19, 2011
  5. Johannes SixtOct 20, 2011

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.