git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Philip Patsch <philip@decentsoftwa.re>
Cc: git@vger.kernel.org, "Jean-Noël Avila" <jn.avila@free.fr>
Subject: Re: [PATCH 1/1] docs/git-blame: describe sourceline and resultline
Date: Fri, 10 Oct 2025 11:19:42 -0700	[thread overview]
Message-ID: <xmqqldli8vr5.fsf@gitster.g> (raw)
In-Reply-To: <20251010152204.815520-2-philip@decentsoftwa.re> (Philip Patsch's message of "Fri, 10 Oct 2025 17:21:59 +0200")

Philip Patsch <philip@decentsoftwa.re> writes:

>  - 40-byte SHA-1 of the commit the line is attributed to;
> +- the line number of the line in the original file,
> +  from when the commit was made;

Sorry, but "from when the commit was made" does not really add
anything meaningful at least to me.  Which commit does "the commit"
refer to in this sentence in the first place?

> +- the line number of the line in the final file,
> +  from the current state of the file;

We avoided to say "current" here because the state you are trying to
explain (i.e., the commit that has a file each of whose lines you
are trying to find the origin of) may not be current at all (e.g.,
"In the code that was current five years ago, we had this helper
function.  Where did it come from?").  "git blame --help" says
"start annotating from the given revision" in its very early part of
the doucumentation, so it might make it easier to understand if this
"final state" were referred to as the "annotated state"?

Perhaps this is easier to understand?

 - 40-byte SHA-1 of the commit the line is attributed to;

 - the line number in the file in the above blamed commit, where the
   line came from;

 - the line number in the file, where the line is found in the
   stating <rev>;

I dunno.

Regardless, the first one that is SHA-1 centric should probably be
updated in this age where SHA-256 repositories are reality.  Perhaps
replace the "40-byte" thing with something like

 - the hex object name of the commit the line is attributed to

but that would be a separate topic.

The same comment wrt "current" and "original" applies to the other
hunk.

Thanks.


> @@ -214,6 +216,9 @@ annotated.
>  	<40-byte-hex-sha1> <sourceline> <resultline> <num-lines>
>  +
>  Line numbers count from 1.
> ++
> +<sourceline> is where this line shows up in the original source commit.
> +<resultline> is where this line shows up in the current state of the file.
>  
>  . The first time that a commit shows up in the stream, it has various
>    other information about it printed out with a one-word tag at the


  reply	other threads:[~2025-10-10 18:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-10 15:21 [PATCH 0/1] docs/git-blame: describe sourceline and resultline Philip Patsch
2025-10-10 15:21 ` [PATCH 1/1] " Philip Patsch
2025-10-10 18:19   ` Junio C Hamano [this message]
2025-10-10 19:46     ` Junio C Hamano
2025-10-14 13:33       ` Philip Patsch

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=xmqqldli8vr5.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=jn.avila@free.fr \
    --cc=philip@decentsoftwa.re \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).