#1485 File history view
Closed: Fixed by pingou. Opened by tibbs.

It would be nice to have a way to see a file's history. Github does this with the history button, which takes you to a list of commits which have touched the file. That's at least mildly useful.

What I'd find really useful is a way to walk a file's history, stepping from the current version to the next or previous one. Of course, I know that git doesn't have any concept of a linear history but I believe that for any commit it's possible to find the ancestor commits, so it should theoretically be possible to find them. The problem is that knowing the ancestor commit doesn't tell you whether any of those ancestors actually modified the file, so it's probably more trouble than benefit. But maybe I'm wrong.


This is how track does it:

trac.png

https://trac.edgewall.org/log/mercurial-plugin/tracext/hg/backend.py

+1 , git log "file that we are investigating" , doesn't seems hard, for example in [1] I missed history (of commits) button .

Thanks.

[1]
https://src.fedoraproject.org/rpms/akmods/blob/master/f/akmods-shutdown

This is something that has been brought up by a few other folks (esp. Xfce devs) as something they want to see too.

GitHub has a distinct view for this: https://github.com/Pagure/pagure/commits/master/setup.py

I remember looking into it at one point and iirc, pygit2 has no support for
this, so there would be two options:
- a) iterate through the commits and check if the file was changed in it
- b) call git directly

I wonder if a third option relying on git blame could also work but :/

Would dulwich help any here?

BTW, GitLab also have story button ! [1]

[1]
https://gitlab.com/soundtouch/soundtouch/

This is being worked on with #4716.

Metadata Update from @pingou:
- Issue assigned to pingou

Metadata Update from @pingou:
- Issue set to the milestone: 5.9

Metadata Update from @pingou:
- Issue close_status updated to: Fixed
- Issue status updated to: Closed (was: Open)

Nice , thank you :)

Metadata
Related Pull Requests