You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
repo-age should display the date of the first commit #2660
"Disabled by default" means most people don't need it, so it doesn't belong to Refined GitHub. In that case, it's best to keep it as a standalone userscript or extension. #2625 (comment)
I think the tootip says it all "Repository Created...." is has nothing to do with the commit date. Its when the github project was created
Not at all. Most of the today's well-established projects were hosted somewhere else. A lot of them survived multiple migrations and CVSs.
I think (IMHO) the repo age is most beneficial for repo's that are not widely known and the user would like to know its age. For the large projects there is no real benefit knowing when they went into existence.
Again JMO
Edge case or not, if it was easy to get the first commit date I’d prefer that over “repo created”, which is just a GitHub event rather than the source’s birth date.
We could still also display the Created date in the tooltip for clarity
Yeah, that is there but wouldn't that be okay? Since it would be a one-time request and first commit isn't supposed to change so we can cache it forever. What do you think?
@fregante Not sure which one can be more frequent. Migrated repos vs different default branches. 🤔 Also, Not sure if we should do it, but a thought, we can fetch both the repo created date using API and fetch the date of first commit, whichever is older we can display that. But then it will be 2 requests.
In this situation specifically, you're talking about force-pushes and default branch updates that change the very first commit. I'd say that's so rare it's not even worth discussing.
I'm not particularly worried about displaying slightly-off age information in that situation, it's not critical information.
Ideally yes, we'd show the earliest date between first commit and createdAt, but it's not worth 2 requests.
Ideally yes, we'd show the earliest date between first commit and createdAt, but it's not worth 2 requests.
I get your point but the request will be made only for the first time (and when the cache expires that is 30 days). Also, the requests are independent of each other.
Activity
yakov116 commentedon Dec 30, 2019
see
#2526 (comment)
webknjaz commentedon Dec 30, 2019
Well, I'm okay with an extra query. Plus this mode could be disabled by default if this many queries is too much for someone.
yakov116 commentedon Dec 30, 2019
sindresorhus commentedon Dec 30, 2019
Projects imported to GitHub is too much of an edge-case. What we could do is to add a tooltip that says that the age is the GitHub repo ago.
fregante commentedon Dec 31, 2019
And/or this issue can stay open as a wish to improve on the feature if possible.
[-]Option to show the project age[/-][+]`repo-age` should display the date of the first commit[/+]webknjaz commentedon Dec 31, 2019
Not at all. Most of the today's well-established projects were hosted somewhere else. A lot of them survived multiple migrations and CVSs.
A good example would be CPython: migrated ~2 years ago, first commit ~20 years ago. python/cpython@7f777ed
yakov116 commentedon Jan 1, 2020
I think the tootip says it all "Repository Created...." is has nothing to do with the commit date. Its when the github project was created
I think (IMHO) the repo age is most beneficial for repo's that are not widely known and the user would like to know its age. For the large projects there is no real benefit knowing when they went into existence.
Again JMO
fregante commentedon Jan 4, 2020
Edge case or not, if it was easy to get the first commit date I’d prefer that over “repo created”, which is just a GitHub event rather than the source’s birth date.
We could still also display the Created date in the tooltip for clarity
hardikmodha commentedon Jan 5, 2020
Just stumbled upon this and after a quick Google search, found a way to fetch the first commit date for a repository. Reference: https://stackoverflow.com/a/49647826/4248342
This certainly is not feasible with 1 HTTP request, we need to make 2 HTTP requests.
e.g. I tried it for https://github.com/python/cpython/ and it seems to be working fine. Number of commits:
106075(Count is available on the repo code page)Olderbutton which is https://github.com/python/cpython/commits/master?after=b19c0d77e6f25ea831ab608c71f15d0d9266c8c4+34.+with 106075 - 34 - 1 (last commit) = 106040New URL: https://github.com/python/cpython/commits/master?after=b19c0d77e6f25ea831ab608c71f15d0d9266c8c4+106040 and visit it. (2nd request)
1990-08-09T14:25:15ZWhat do you all think?
yakov116 commentedon Jan 5, 2020
@hardikmodha You have the last commit and count on the repo page.
See https://github.com/bpceee/oldest/blob/master/oldest.js
hardikmodha commentedon Jan 5, 2020
Haha..just realized it after your comment. We do have the last commit. It will be only 1 HTTP request.
yakov116 commentedon Jan 5, 2020
@hardikmodha but it will have to wait until the page loaded
hardikmodha commentedon Jan 5, 2020
Yeah, that is there but wouldn't that be okay? Since it would be a one-time request and first commit isn't supposed to change so we can cache it forever. What do you think?
yakov116 commentedon Jan 5, 2020
@hardikmodha maybe a loader? like https://github.com/hardikmodha/refined-github/blob/fix_tags_dropdown/source/features/tags-dropdown.tsx#L26-L28
fregante commentedon Jan 5, 2020
🎉 Indeed it takes one HTTP request if you have the latest commit and commit count:
https://github.com/sindresorhus/refined-github/commits/master?after=a76ed868a84cd0078d8423999faaba7380b0df1b+1571
a76ed86 is the latest commit and 1573 is the visible commit count (-2)
hardikmodha commentedon Jan 5, 2020
@yakov116 I don't think that would be feasible here since we need to wait for the
.overall-summaryto load to figure out a place to append the repo age. https://github.com/sindresorhus/refined-github/blob/master/source/features/repo-age.tsx#L44 So I'm not sure where to display the loader.Use first commit to get the repo age. Closes refined-github#2660
yakov116 commentedon Jan 5, 2020
Maybe say Loading...
Use first commit to get the repo age. Closes refined-github#2660
webknjaz commentedon Jan 5, 2020
It can change because it can be force-pushed or the default branch can be switched to a different tree.
hardikmodha commentedon Jan 14, 2020
@webknjaz Yeah, it is possible. If default branch is changed then it will display wrong first commit date. E.g. Just found out that ydkjs has changed it's default branch from
masterto2nd-edhttps://github.com/getify/You-Dont-Know-JS. If we have some way of knowing the oldest branch then this would be correct.@fregante Not sure which one can be more frequent. Migrated repos vs different default branches. 🤔 Also, Not sure if we should do it, but a thought, we can fetch both the repo created date using API and fetch the date of first commit, whichever is older we can display that. But then it will be 2 requests.
fregante commentedon Jan 15, 2020
In this situation specifically, you're talking about force-pushes and default branch updates that change the very first commit. I'd say that's so rare it's not even worth discussing.
I'm not particularly worried about displaying slightly-off age information in that situation, it's not critical information.
Ideally yes, we'd show the earliest date between first commit and
createdAt, but it's not worth 2 requests.hardikmodha commentedon Jan 18, 2020
I get your point but the request will be made only for the first time (and when the cache expires that is 30 days). Also, the requests are independent of each other.