question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add a button to jump to first and latest commit

See original GitHub issue

Hey! I’m the one who opened the issue to add the repo-age feature, because I think it’s really interesting to know how a project was… in the beginning, and what was done first. Sometimes I spend a lot of time spamming the “Older” button to see what the first commits were. So if we could add these buttons it would be really really useful: Capture d’écran 2020-08-12 à 17 30 19 (or first page/last page, some websites use this term)

It would be very easy to make them, as we could just get the first commit hash, the number of commits and then generate an URL like https://github.com/Androz2091/AtlantaBot/commits/master?after=FIRSTCOMMITHASH+NUMBEROFCOMMITS&branch=master.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
yakov116commented, Aug 19, 2020
1reaction
fregantecommented, Aug 14, 2020

If we extract this part of the function, this feature would come for free since the commitCount would already be cached:

https://github.com/sindresorhus/refined-github/blob/6bba1c5de1e8b609e010f252d72ff9c63af431a6/source/features/repo-age.tsx#L46-L63

Probably:

export const getLatestCommitInfo = cache.function(async () => {
	const {repository} = await api.v4(`
		repository(${getRepoGQL()}) {
			defaultBranchRef {
				target {
					... on Commit {
						hash: oid
						date: committedDate
						path: resourcePath
						commitCount: history {
							totalCount
						}
					}
				}
			}
		}
	`);

	const {target} = repository.defaultBranchRef;
	target.commitCount = target.commitCount.totalCount;
	return target;
}, {
	cacheKey: () => 'latest-commit-info:' + getRepoURL()
});
Read more comments on GitHub >

github_iconTop Results From Across the Web

Add a button to jump to first and latest commit #3455 - GitHub
Hey! I'm the one who opened the issue to add the repo-age feature, because I think it's really interesting to know how a...
Read more >
How do you jump to the first commit in git? - Stack Overflow
To go the first commit of the repo, do. git checkout master; git log --reverse; The first entry in the output is the...
Read more >
Commit and push changes to Git repository - JetBrains
If you want to append local changes to the latest commit instead of creating a separate commit, select the Amend option.
Read more >
Git: Commits in Visual Studio Code - YouTube
Your browser can't play this video. Learn more. Switch camera.
Read more >
Tutorial: Make your first Git commit - GitLab Docs
Before we jump into steps, let's go over some basic Git concepts. ... Above the README.md file, view the text in the Last...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found