Make line numbers in diffs clickable anchors

Open
#152 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
frontend

Research direction

Start by locating the diff view and the code that renders its line numbers. Check how both sides of each hunk are represented, then verify that line numbers display as links with anchors that target the requested original or new line in a multi-file diff.

Written by the indexing model from the issue text.

Description

enhancement

It would be nice if the diff view showed line numbers, and if they were also anchors, so you could share a link to a particular line of a diff.

This is possible on github, eg. the following link:

https://github.com/torvalds/linux/commit/bc976233a872c0f20f018fb1e89264a541584e25#diff-bfdbce36d815c6829b32b5eebc17923fL372

https://github.com/torvalds/linux/commit/bc976233a872c0f20f018fb1e89264a541584e25#diff-bfdbce36d815c6829b32b5eebc17923fL372

Takes you to line 372 of the left side (original) of a particular hunk of the multi-file diff.

And this link takes you to line 381 on the right side (new) of another hunk:

https://github.com/torvalds/linux/commit/bc976233a872c0f20f018fb1e89264a541584e25#diff-bfdbce36d815c6829b32b5eebc17923fR381

Dominant language
Python
Stars
317
Forks
91
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from getpatchwork/patchwork

All issues in getpatchwork/patchwork

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.