Subject: Re: [FEATURE] Proposal: git format-patch with `--with-line-numbers` flag

From: Junio C Hamano <[email-masked]>
Date: Thu, 21 Aug 2025 12:50:34 -0700

Seyi Kuforiji <[email-masked]> writes:

>> One things I try in my reviews is, even though I trim my quotes
>> heavily and leave only the part I comment on, I try to leave the
>> filename part (i.e. "diff --git" line) and the hunk header (i.e. "@@
>> -L,K +M,N @@" line) in.  See
>>
>>     https://lore.kernel.org/git/[email-masked]/
>>
>> for an example.
>>
> Ah, thanks for the clarification; that makes sense now. Up until this
> point, I didn't know the hunk headers "(@@ -L,K +M,N @@ lines)"
> provided enough context in terms of the lines the changes were made. I
> just never read them and usually just jump to the reviews on the code
> changes, and I try to locate the changes locally :(. I agree this
> already provides sufficient context, and I've definitely learned
> something new here :). I am wondering if a description of this is
> covered in our documentation. If not, maybe I could add it, since I
> imagine others might have the same question.

I do not think our documentation (documentation proper, not
handholding newbies tutorials) wants to repeat what is in

https://pubs.opengroup.org/onlinepubs/9799919799/utilities/diff.html#tag_20_34_10_07

and explain what different parts of a "patch" output look like, but
perhaps MyFirstContribution would be a good place to add it, if not
done already.

Thanks.