git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 21, 2025, 19:50 UTC
Message-ID
<xmqqa53s1mk5.fsf@gitster.g>
In-Reply-To
<CAGedMtf2CW_L8uSc1KRqmAoJ=2Sw4t5AL2AC0uKQJb5keX63ZA@mail.gmail.com>
Seyi Kuforiji <kuforiji98@gmail.com> writes:
Show 18 quoted lines
>> 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/xmqqikla86id.fsf@gitster.g/
>>
>> 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.
Previous: Seyi Kuforiji
Message 4 of 4 in “[FEATURE] Proposal: git format-patch with `--with-line-numbers` flag”
  1. Seyi KuforijiAug 18, 2025
  2. Junio C HamanoAug 18, 2025
  3. Seyi KuforijiAug 21, 2025
  4. Junio C HamanoAug 21, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.