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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux