Right now Prev/next buttons only appear on PR commits only. It'd be really nice if they appeared on any commit. For example, if I wanted to look at React's first commit, then click Next btn and see how the project evolved.
For the record, a "previous" link is already there, called "parent"
True. Might be nice to wrap it up in a pretty [ Previous ] button next to the [ Next ] button as well.
I also think Previous and Next buttons would be useful. Sometimes when checking out new projects, I just open a bunch of commits in new tabs. Would be nice to just press buttons instead. It should also support keyboard shortcuts for going forward/backward.
To keep in mind also: merge commits have two parents
Also how do you calculate children (next)? There's infinite variation unless you're on a branch or tag to specify what branch you want to take.
I think both problems COULD be solved with a dropdown when a fork is encountered (left or right) with the SHAs listed. I don't know a clear way to pick a label for each SHA since it could be in a lot of branches or tags. You'd need to kind of pick a branch who's timeline you can move along and if you want to split off that branch what branch names do you show for the subsequent forks you encounter?
A very complicated feature indeed lol.
lol sorry I didn't think of branching and all that, I just thought go prev/next on whatever branch you're currently looking at.
Maybe add a dropdown/fuzzy-search thing later since that does sound more complicated? 🤷♂️
There's infinite variation unless you're on a branch or tag to specify what branch you want to take.
My idea is that we can fetch the current branch's commit list and follow it. The current branch is found right under the commit title: https://github.com/sindresorhus/refined-github/commit/45e432317347f5fb8eb8cedd9c83e57e5b83354a
The problem is actually querying that _next_ commit efficiently because we can't fetch the whole commit list until we find it (in this repo there are 1500 commits for example)
https://stackoverflow.com/a/23796565/175825 it looks like you can do that git fu and get the next commit in whatever branch master equals in the HEAD..master bit of it.
Might be able to convince some OSS friendly host to let us set up a free lambda that plucks the branch name from whatever URL path the user is at?
It'd only run when they explicitly hit the "next" button so it wouldn't be like we'd be slamming the host with 50k requests hourly or anything.
Happy to make a WIP lambda if a solution like this interests you. Netlify has lambdas and is pretty OSS friendly so I bet they'd be interested and we could plop their logo in the readme as a sponsor or something.
This seems like it might be useful for the complicated bit as well. User picks branch they want in fuzzy search, and that lambda gets HEAD..whatever-branch-they-picked?
Might be able to convince some OSS friendly host to let us set up a free lambda that plucks the branch name from whatever URL path the user is at?
That requires doing a git pull of a whole repo on our servers, that's a whole can of worms I don't want to open. I'd say this is impossible via API
Most helpful comment
I also think Previous and Next buttons would be useful. Sometimes when checking out new projects, I just open a bunch of commits in new tabs. Would be nice to just press buttons instead. It should also support keyboard shortcuts for going forward/backward.