git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [FEATURE] Proposal: git format-patch with `--with-line-numbers` flag
@ 2025-08-18 10:08 Seyi Kuforiji
  2025-08-18 17:02 ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Seyi Kuforiji @ 2025-08-18 10:08 UTC (permalink / raw)
  To: git; +Cc: Patrick Steinhardt, Phillip Wood, Taylor Blau, Christian Couder

Hi Everyone,

While working on converting unit tests and sending patches, I ran into a
pain point during review. The reviews by Junio, Patrick, and others pointed out
issues in my patches, but without line numbers in the emailed code
context, it was sometimes hard to know exactly which line was being
referenced. I had to manually count through the diff hunks, which slowed
things down.

To address this, I’d like to propose adding an option to `git
format-patch` (e.g., `--with-line-numbers`) that would include line numbers
numbers alongside context lines in the generated patch. This would not
affect patch application (`git am` / `git apply`), but would be a visual
aid for mailing list readers.

Benefits:
- Makes reviews on the mailing list clearer and faster.
- Let reviewers point out "line 52 has an off-by-one" for easy review.
- Reduces friction for new contributors.

Possible concerns:
- Could clutter diffs if not formatted cleanly.

I wanted to ask for feedback: would this kind of feature be welcomed?
If so, I’d be happy to draft a patch implementing it.

Best regards,
Seyi Kuforiji

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-08-21 19:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-18 10:08 [FEATURE] Proposal: git format-patch with `--with-line-numbers` flag Seyi Kuforiji
2025-08-18 17:02 ` Junio C Hamano
2025-08-21 12:04   ` Seyi Kuforiji
2025-08-21 19:50     ` Junio C Hamano

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).