All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: "Sokolov\, Konstantin" <konstantin.sokolov.ext@siemens.com>,
	"git\@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: Inconsistent results of git blame --porcelain when detecting copies from other files
Date: Mon, 20 Feb 2017 22:08:19 -0800	[thread overview]
Message-ID: <xmqqzihggjos.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20170220221540.6vemjdvyvwonpqyt@sigill.intra.peff.net> (Jeff King's message of "Mon, 20 Feb 2017 17:15:40 -0500")

Jeff King <peff@peff.net> writes:

> 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 ;-)


  reply	other threads:[~2017-02-21  6:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-20 17:59 Inconsistent results of git blame --porcelain when detecting copies from other files Sokolov, Konstantin
2017-02-20 21:30 ` Junio C Hamano
2017-02-20 22:15   ` Jeff King
2017-02-21  6:08     ` Junio C Hamano [this message]
2017-02-21 12:25     ` AW: " Sokolov, Konstantin
2017-02-21 17:48       ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqzihggjos.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=konstantin.sokolov.ext@siemens.com \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.