All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: KES <kes-kes@yandex.ua>
Cc: git@vger.kernel.org
Subject: Re: Feature request: implement '--follow' option for `git blame`
Date: Tue, 07 Apr 2015 19:48:36 -0700	[thread overview]
Message-ID: <xmqqvbh7baij.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <4215491428322362@web26m.yandex.ru> (KES's message of "Mon, 06 Apr 2015 15:12:42 +0300")

KES <kes-kes@yandex.ua> writes:

> **UPDATE:** Short answer
>
> `git blame` follow renames but not for `git blame COMMIT^ -- <filename>`

Suppose you have file A and file B in your version v1.0.

Six month down the road, the code was much refactored, and you do
not need the contents of these two files separately.  You have
removed A and B and much of what they had is now in file C.  That is
the current state.

    git blame -C HEAD -- C

may follow the contents from both just fine, but if you _were_
allowed to say

    git blame v1.0 -- C

what does it even mean?  C did not exist v1.0 at all.  Are you
asking to follow the contents of A back then, or B?  How did you
tell you meant A and not B when you told it C in this command?

"git blame" follows content movements, and never treats "renames" in
any special way, as it is a stupid thing to do to think a rename is
somehow special ;-)

The way you tell what content to start digging from to the command
from its command line is to give starting point commit (defaults to
HEAD but you may give COMMIT^ as your example) and the path in that
starting point.  As it does not make any sense to tell C to Git and
then magically make it guess you meant A in some cases and B in some
other.  If v1.0 did not have C, the only sensible thing to do is to
exit instead of making a guess (and without telling the user how it
guessed).

  parent reply	other threads:[~2015-04-08  2:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-06 12:12 Feature request: implement '--follow' option for `git blame` KES
2015-04-07 17:26 ` Fwd: " KES
2015-04-08  2:48 ` Junio C Hamano [this message]
2015-04-10  6:40   ` Re[2]: " Eugen Konkov
2015-04-13  5:32     ` Junio C Hamano
2015-04-13 19:07       ` Re[2]: " Eugen Konkov

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=xmqqvbh7baij.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=kes-kes@yandex.ua \
    /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.