Allow to take a link to line number in comparison of files #1740

Open
opened 2025-11-02 04:11:49 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @InExtremaRes on GitHub (Apr 29, 2018).

I am using gitea inside Docker from gitea/gitea. The relevant part of docker inspect gitea/gitea:latest output is:

{
    "Id": "sha256:f50274d2fddab78c52ef199c6d42b06af6defd3e5fcfc890d46618a1546a51c0",
    "RepoTags": [
        "gitea/gitea:latest"
    ],
    "RepoDigests": ["gitea/gitea@sha256:0367cde3c4e6041e0e63042f22e4787edd441e42976a64d698e8b9387f72dd75"],
    "Parent": "",
    "Comment": "",
    "Created": "2018-04-29T06:50:27.057796146Z"
    /** ... */
}

Description

When have a file open in gitea you can click the line number to get a direct link to that line, but if you have a comparison of two files (both in unified or split view) you can't even click the line number.

Is it possible to implement a link to line number in compare mode? I think it would be great if the link goes to line in the comparison itself, but if it points just to the line in each file at the right commit could be ok, thought.

Since we don't have yet the possibility of comment in changes of pull requests at least a link to file at a particular line could be very useful, as when you click in "Files changed".

Sreenshots

Here you can see the cursor change and click gives me to that line in that file in that particular commit:
image

When comparing two files you can't click line number of any file:
image

For instance, GitHub gives you a link to that line in the comparison: see here

Originally created by @InExtremaRes on GitHub (Apr 29, 2018). - Gitea version (or commit ref): 7ea4bfc - Can you reproduce the bug at https://try.gitea.io: - [x] Yes - [ ] No - [ ] Not relevant I am using gitea inside Docker from `gitea/gitea`. The relevant part of `docker inspect gitea/gitea:latest` output is: ~~~{json} { "Id": "sha256:f50274d2fddab78c52ef199c6d42b06af6defd3e5fcfc890d46618a1546a51c0", "RepoTags": [ "gitea/gitea:latest" ], "RepoDigests": ["gitea/gitea@sha256:0367cde3c4e6041e0e63042f22e4787edd441e42976a64d698e8b9387f72dd75"], "Parent": "", "Comment": "", "Created": "2018-04-29T06:50:27.057796146Z" /** ... */ } ~~~ ## Description When have a file open in gitea you can click the line number to get a direct link to that line, but if you have a comparison of two files (both in unified or split view) you can't even click the line number. Is it possible to implement a link to line number in compare mode? I think it would be great if the link goes to line in the comparison itself, but if it points just to the line in each file at the right commit could be ok, thought. Since we don't have yet the possibility of comment in changes of pull requests at least a link to file at a particular line could be very useful, as when you click in "Files changed". ## Sreenshots Here you can see the cursor change and click gives me to that line in that file in that particular commit: ![image](https://user-images.githubusercontent.com/1635491/39409603-60f70106-4bc0-11e8-9c41-5d2eec2b6300.png) When comparing two files you can't click line number of any file: ![image](https://user-images.githubusercontent.com/1635491/39409643-0caecf7e-4bc1-11e8-861e-848eaba16778.png) For instance, GitHub gives you a link to that line in the comparison: [see here](https://github.com/go-gitea/gitea/commit/ab4eacd15f44e228834a8edc67fd139263fb5347#diff-f7c5b4068637e2def526f9bbc7200c4eR3)
GiteaMirror added the issue/confirmedtype/enhancement labels 2025-11-02 04:11:49 -06:00
Author
Owner

@stale[bot] commented on GitHub (Jan 27, 2019):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale[bot] commented on GitHub (Jan 27, 2019): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
Author
Owner

@Spongman commented on GitHub (May 6, 2021):

bump

@Spongman commented on GitHub (May 6, 2021): bump
Author
Owner

@HammyHavoc commented on GitHub (Apr 20, 2024):

Is this possible yet?

@HammyHavoc commented on GitHub (Apr 20, 2024): Is this possible yet?
Author
Owner

@lunny commented on GitHub (Apr 21, 2024):

Not yet right now. Contributions are welcome.

@lunny commented on GitHub (Apr 21, 2024): Not yet right now. Contributions are welcome.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#1740