Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prev/Next commit buttons on every commit page #2124

Closed
corysimmons opened this issue Jun 6, 2019 · 9 comments
Closed

Prev/Next commit buttons on every commit page #2124

corysimmons opened this issue Jun 6, 2019 · 9 comments
Labels
enhancement impossible Features requests that are impossible or impractical to implement

Comments

@corysimmons
Copy link

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.

@fregante fregante changed the title Feat req: Prev/Next commit buttons on every commit page Prev/Next commit buttons on every commit page Jun 6, 2019
@fregante
Copy link
Member

fregante commented Jun 6, 2019

For the record, a "previous" link is already there, called "parent"

@corysimmons
Copy link
Author

True. Might be nice to wrap it up in a pretty [ Previous ] button next to the [ Next ] button as well.

@sindresorhus
Copy link
Member

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.

@fregante
Copy link
Member

fregante commented Jun 7, 2019

To keep in mind also: merge commits have two parents

@ProLoser
Copy link

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.

@corysimmons
Copy link
Author

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? 🤷‍♂️

@fregante
Copy link
Member

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: 45e4323

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)

@corysimmons
Copy link
Author

corysimmons commented Nov 14, 2019

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?

@fregante
Copy link
Member

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

@fregante fregante added impossible Features requests that are impossible or impractical to implement and removed help wanted labels Mar 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement impossible Features requests that are impossible or impractical to implement
Development

No branches or pull requests

4 participants