Bug 253949

Summary: cgit implies commit touches file when it doesn't
Product: Services Reporter: John-Mark Gurney <jmg>
Component: Git IntegrationAssignee: Git Admin <git-admin>
Status: Closed FIXED    
Severity: Affects Some People CC: emaste, git-admin, imp, linimon, uqs
Priority: ---    
Version: unspecified   
Hardware: Any   
OS: Any   

Description John-Mark Gurney freebsd_committer freebsd_triage 2021-03-01 22:41:41 UTC
If you navigate to a file, such as:
https://cgit.freebsd.org/src/tree/lib/libc/amd64/string/strlen.S

And then click on commit, to get the latest commit for that file:
https://cgit.freebsd.org/src/commit/lib/libc/amd64/string/strlen.S

Instead of showing the latest commit for that file, it shows you the latest commit for the entire tree.  This is quite surprising, and not clear that is what happens.
Comment 1 Ulrich Spörlein freebsd_committer freebsd_triage 2021-03-02 10:12:55 UTC
You probably have to take this up with the cgit folks.

The tree view always browses at head (as you can see by not having a hash in the URL) and the commit view also browses at head (I didn't know you could give it a path).

cgit URLs are wonky and it's not a terribly good UI that you can click on the various tabs and have partial stuff (like the path) transferred.

Anyway, this is not something we can or will likely fix. Maybe browsing via the GitHub or Gitlab UI is better? There are also tools like gitk (or tig or whatever) for your local browsing needs.

IOW, what is the actual information you're looking at? Did you maybe want to go from https://cgit.freebsd.org/src/tree/lib/libc/amd64/string/strlen.S to the "blame" view?
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2023-09-28 19:35:40 UTC
To submitter: was this problem ever addressed?
Comment 3 Warner Losh freebsd_committer freebsd_triage 2023-09-28 19:44:07 UTC
If I understand the bug report, it's been fixed and deployed.
Comment 4 Ed Maste freebsd_committer freebsd_triage 2024-01-19 16:31:41 UTC
(In reply to Warner Losh from comment #3)
I don't believe so, the example is still reproducible:

Start at
https://cgit.freebsd.org/src/tree/lib/libc/amd64/string/strlen.S
click commit, which goes to
https://cgit.freebsd.org/src/commit/lib/libc/amd64/string/strlen.S

but the commit returned (i.e., https://cgit.freebsd.org/src/commit/?id=dfe30e41967f9b5112c42ca20ec2c366db74cef9) does not affect strlen.S.

That said, I think this is a legitimate desire for information that cgit just doesn't provide. I imaging jmg@ is looking for something like https://github.com/freebsd/freebsd-src/commits/main/lib/libc/amd64/string/strlen.S