From: Junio C Hamano <gitster@pobox.com>
To: Max Kirillov <max@max630.net>
Cc: Jeff King <peff@peff.net>,
Eric Sunshine <sunshine@sunshineco.com>,
git@vger.kernel.org
Subject: Re: [PATCH v4 1/3] Add test to describe expectation of blame --reverse with branched history
Date: Sun, 25 Oct 2015 23:27:32 -0700 [thread overview]
Message-ID: <xmqqeggijga3.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <1445837217-4252-3-git-send-email-max@max630.net> (Max Kirillov's message of "Mon, 26 Oct 2015 07:26:55 +0200")
Max Kirillov <max@max630.net> writes:
> If history contains merges from feature branches, `blame --reverse`
> reports not the commit when the line was actually edited, but head of
> the last merged branch which was created before the edit.
>
> As a workaround, `blame --reverse --first-parent` could be used to find
> the merge of branch containing the edit, but it was disabled in
> 95a4fb0eac, because incorrectly specified range could produce in
> unexpected and meaningless result.
>
> Add tests which describe ideal functionality with and without
> `--first-parent`.
>
> Signed-off-by: Max Kirillov <max@max630.net>
I _think_ I know why it would be useful to allow "--first-parent" to
the command; it is useful the same way why "git log --first-parent
$path" would be a good way to get an overview.
But I am puzzled by your complaints (I'd characterise the statement
as such, given your second paragraph calls the combination a
"workaround") in the first paragraph. I honestly do not understand
where it comes from at all.
The reverse blame begins from an old state and shows the most recent
child in the history that each line survived to, and it does not
show what commit removed the line from the original state. And that
does not have anything to do with the presence of any merges or
forks in the history. The command will always report "not the
commit that edited the line." There is nothing special about "If
the history contains merges".
If you have this history, for example:
D---E---F
/ \*
O X---Y
\ /
A---B---C
where O had the original file, which was not touched by any commits
on the branch on the upper side, and commit B rewrote all lines of
the file, running blame in reverse may show A as the last point
where all lines survived up to, if the "reversed" history happened
to consider A as the earlier "parent" (in reality it is a child but
blame is about assigning blame for each line from child to parents
so in the reversed history, real children becomes parents). Or it
may show F as the last point where all lines survived up to, if D
was picked as the earlier "parent". Because there is no inherent
ordering between A and D, both of which are children of O, your
result is not necessarily "head of the last merged branch".
But I do not see how "first-parent" would be a workaround for that.
The option would be useful to force the assignment of blame (in
reverse) along the first-parent chain O---D---E---F---X---Y so that
you can get a bird's-eye view of the history, i.e. squashing all
that happened in A---B---C as if that happened at X.
The explanation of the first paragraph needs to be rewritten to make
it understandable, but I am not sure what relevance it has with this
change.
Thanks.
next prev parent reply other threads:[~2015-10-26 6:27 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-21 4:08 [PATCH 0/2] blame: allow blame --reverse --first-parent when it makes sense Max Kirillov
2015-10-21 4:08 ` [PATCH 1/2] Add test to describe expectation of blame --reverse with branched history Max Kirillov
2015-10-21 4:08 ` [PATCH 2/2] blame: allow blame --reverse --first-parent when it makes sense Max Kirillov
2015-10-21 4:29 ` Eric Sunshine
2015-10-22 3:52 ` Max Kirillov
2015-10-22 3:51 ` [PATCH v2 0/2] " Max Kirillov
2015-10-22 3:51 ` [PATCH v2 1/2] Add test to describe expectation of blame --reverse with branched history Max Kirillov
2015-10-22 4:19 ` Junio C Hamano
2015-10-22 14:37 ` Max Kirillov
2015-10-22 14:56 ` Max Kirillov
2015-10-22 3:51 ` [PATCH v2 2/2] blame: allow blame --reverse --first-parent when it makes sense Max Kirillov
2015-10-22 4:25 ` Junio C Hamano
2015-10-22 14:56 ` Max Kirillov
2015-10-22 19:11 ` Junio C Hamano
2015-10-25 12:43 ` Max Kirillov
2015-10-25 16:52 ` Junio C Hamano
2015-10-22 4:07 ` [PATCH v3 0/2] " Max Kirillov
2015-10-22 4:07 ` [PATCH v3 1/2] Add test to describe expectation of blame --reverse with branched history Max Kirillov
2015-10-22 4:07 ` [PATCH v3 2/2] blame: allow blame --reverse --first-parent when it makes sense Max Kirillov
2015-10-26 5:26 ` [PATCH v4 0/4] " Max Kirillov
2015-10-26 5:26 ` [PATCH v4 1/3] Add test to describe expectation of blame --reverse with branched history Max Kirillov
2015-10-26 5:41 ` Max Kirillov
2015-10-26 6:27 ` Junio C Hamano [this message]
2015-10-27 4:40 ` Max Kirillov
2015-10-27 17:57 ` Junio C Hamano
2015-10-26 5:26 ` [PATCH v4 2/3] blame: extract find_single_final Max Kirillov
2015-10-26 5:26 ` [PATCH v4 3/3] blame: allow blame --reverse --first-parent when it makes sense Max Kirillov
2015-10-30 5:01 ` [PATCH v5 0/3] " Max Kirillov
2015-10-30 5:01 ` [PATCH v5 1/3] blame: test to describe use of blame --reverse --first-parent Max Kirillov
2015-10-30 22:30 ` Junio C Hamano
2015-10-30 5:01 ` [PATCH v5 2/3] blame: extract find_single_final Max Kirillov
2015-10-30 5:01 ` [PATCH v5 3/3] blame: allow blame --reverse --first-parent when it makes sense Max Kirillov
2015-10-26 5:26 ` [PATCH v4 0/4] " Max Kirillov
2015-10-26 5:31 ` Max Kirillov
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=xmqqeggijga3.fsf@gitster.mtv.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=max@max630.net \
--cc=peff@peff.net \
--cc=sunshine@sunshineco.com \
/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.