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

Re: Inconsistent results of git blame --porcelain when detecting copies from other files

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 21, 2017, 06:08 UTC
Message-ID
<xmqqzihggjos.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20170220221540.6vemjdvyvwonpqyt@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 11 quoted lines
> The simplest way (IMHO) to parse --porcelain output is:
>
>   - maintain a mapping of commit sha1s to the commit's details
>
>   - whenever you see a "<sha1> <line_nr> <orig_nr> [<size-of-hunk>]"
>     line, any key-value fields which follow impact _only_ that sha1, and
>     you should update the details for that map entry
>
>   - when you see the actual tab-indented line content, you have gotten
>     all of the key-value updates for that sha1. You can now safely do
>     what you like with the line entry.

Yup, that was how the output was meant to be read. At least in the mind of the person who designed the output format ;-)

Previous: Jeff KingNext: Sokolov, Konstantin
Message 4 of 6 in “Inconsistent results of git blame --porcelain when detecting copies from other files”
  1. Sokolov, KonstantinFeb 20, 2017
  2. Junio C HamanoFeb 20, 2017
  3. Jeff KingFeb 20, 2017
  4. Junio C HamanoFeb 21, 2017
  5. AW: Inconsistent results of git blame --porcelain when detecting copies from other filesSokolov, Konstantin, Feb 21, 2017
  6. Jeff KingFeb 21, 2017

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.