sindresorhus/refined-github

More information about forks #3638

payne911 posted onGitHub

This is always hard to navigate:

image

Maybe there's something I don't know, but shouldn't it be easy to:

  1. Filter out all the forks which are equal to or behind the master that was forked
  2. See how many Watchers, Stars, and Forks a fork has
  3. Display the amount of commits ahead and behind the master that was forked

Note: There is another project that started going in that direction.


Then… what's the problem with using that project?

As suggested in the issue template:

1. It doesn't already exist as a userscript or extension.

Use it, support it, extend it. Not everything needs to be part of Refined GitHub.

posted by fregante over 4 years ago

what's the problem with using that project?

It only provides the 2nd point out of the 3 mentioned.

EDIT: You edited your post. I did click the userscript link and was slightly confused. Didn't see what I was looking for in there, so I thought this was a worthy request.

posted by payne911 over 4 years ago

You edited your post

Yes sorry, I thought I could make my answer less rude 🤭

provides the 2nd point out of the 3 mentioned

Compared to Refined GitHub, the project is in a better position to add the other 2 rather than writing the whole thing from scratch. This was the meaning of:

Use it, support it, extend it

posted by fregante over 4 years ago

In general, forks are treated as second-class citizens by GitHub (https://github.com/sindresorhus/refined-github/issues/3613), so people tend to create whole new projects. This makes your situation a rare occurrence.

I also contributed to lovely-forks years ago, but I probably never needed to use it afterwards.

Therefore, I don't think it belongs to Refined GitHub in the first place:

  • there's an extension that does most of what you need
  • it's something most people don't need
  • it's not trivial to implement
  • we already have 190 features
posted by fregante over 4 years ago

it's something most people don't need

My personal experience with this is that I stumble upon a nice but dead Open Source project with >500 forks: it's never fun to find where the action is happening in there. :(

posted by payne911 over 4 years ago

My personal experience with this is that I stumble upon a nice but dead Open Source project with >500 forks: it's never fun to find where the action is happening in there. :(

Yup, I totally feel this. But there's also Network graph that you can look it which is a bit better than the forks view.

For example, clsid2/mpc-hc is an actively maintained fork of mpc-hc/mpc-hc, but doesn't even show up in GitHub search, and only after scrolling a couple of view in the forks section of the original repo.

I would hate to see this, but IMO sorting this forks view with the number of stars or "activity" on that fork could be pretty decent option.

I understand that this feature would be rarely used, but would provide better discoverability of active forks than what GitHub does. But I might be wrong again, and network graph could be a better solution to this case.

posted by notlmn over 4 years ago

I don't like the Network graph much: I find it hard to navigate as well.

In the meantime, I forked the project I had linked in the OP and started improving it:

image

I got the recursive "forks of forks" working, but I've yet to add some caching. Then scan other branches than master, I guess.

posted by payne911 over 4 years ago

Looks great! What do you think about turning it into a plain page that anyone can link to as forks.github.io/user/repo, like:

https://download-directory.github.io/

I think more people would be inclined to use it without having to install an extension. Refined GitHub could also link to it like we do for a couple other features.

The page could make API queries with or without a token.

Regarding the UI, I think you can extrapolate and list/highlight 3 repositories:

  • most starred
  • most recent(ly pushed to)
  • most ahead
posted by fregante over 4 years ago

(Just released v0.3 which covers paginated results, so now all the forks are actually scanned. That, by the way, made me realize lovely-forks actually doesn't cover all the forks.)

What do you think about turning it into a plain page that anyone can link to

I'm not sure I understand properly: are you offering a server with a sub-domain name?

The page could make API queries with or without a token.

The amount of API calls made goes up pretty quickly: for each fork, there is a minimum of 1 API call (more calls if there are sub-forks). This would render a token-less version rather unfunctional.

Regarding the UI, I think you can extrapolate and list/highlight 3 repositories

Yeah, I thought about using clickable table headers to allow sorting based on whatever field you want.

posted by payne911 over 4 years ago

I'm not sure I understand properly

Look at the service I linked. It’s a plain GitHub Pages page that makes API calls once you enter the URL. This could be built the same way.

posted by fregante over 4 years ago

It’s a plain GitHub Pages page

Oh! Hadn't realized that. Not a bad idea!

posted by payne911 over 4 years ago

Google helped me find this service, it already exists, no token necessary: http://gitpop2.herokuapp.com/ocornut/imgui

<img width="736" alt="" src="https://user-images.githubusercontent.com/1402241/96396457-e03b2c00-118c-11eb-8f9f-cd7fd231dc5d.png">

PR welcome

to add a link to it somewhere on https://github.com/sindresorhus/refined-github/network/members

The feature is basically:

function init(): void {
    select('container or something').append(
        <a href={'http://gitpop2.herokuapp.com/' + getRepoURL()}>
            Find most popular fork
        </a>
    );
}

plus, maybe some positioning classes.

posted by fregante over 4 years ago

Google helped me find this service, it already exists, no token necessary: http://gitpop2.herokuapp.com/ocornut/imgui

I'm against it. There is no intelligence in their algorithm (hence why it doesn't require a Token).

Let's compare my current work with theirs on the top 15 results:

image

versus

image


The advantages of my algorithm:

  • Recursive search (to find meaningful results in forks of forks too!)
  • Goes through the whole list of results, rather than only the first page which is maxed at a 100 results
  • Filters out all the forks which have never seen even a single commit on their master branch
  • I display the behind by and ahead by amount which is more meaningful then the last modification info

Also, adding a last modification metric would be trivial.

Analysis:

  1. The fact that the other tool's results are missing that fork with 21 stars because it is a fork of a fork is what convinces me the most (it is a fork I'm personally using in a project of mine, that's why I was aware of that glitch in most of the other tools). Not requiring a token is a dead give-away that it isn't doing any type of recursive search.
  2. The fact that you see all those 1-star repos listed is also a give-away that the search isn't "intelligent": you do not see most of them in my results because they never have seen any activity after having been forked. Why do they have a star, then? Most probably they starred their own repo.

Conclusion: I genuinely believe my tool is better.


Follow-up : I like the idea of having a website for the project, but GitHub Pages being static websites, I need to do some experiments before being certain that the thing is doable.


EDIT: I also just noticed the very last result listed by that other tool is the actual repo itself.

image

There is actually an "error" with the last modification date since that project has actually not seen any activity in a while. It says 5 days ago, but it's actually:

image

The thing picked up on an automatic commit on another branch created by dependabot:

image

posted by payne911 over 4 years ago

As far as Refined GitHub is concerned, we'll just use a URL. We can point to GitPop until a better service appears.

posted by fregante over 4 years ago
  1. because it is a fork of a fork is what convinces me the most

I agree on this, another example: https://github.com/WL-Amigo/waifu2x-converter-cpp -> https://github.com/tanakamura/waifu2x-converter-cpp -> https://github.com/DeadSix27/waifu2x-converter-cpp

posted by kidonng over 4 years ago

Here is my first prototype: https://payne911.github.io/useful-forks/

I haven't figured out yet how to detect when all the XMLHttpRequests have completed, which seems to be the last piece of the puzzle. If anyone has ideas, feel free to let me know! I'm a backend Java developer, so doing frontend JavaScript gets me slightly lost some times.

Also, please do share your feedback on the current setup.

posted by payne911 over 4 years ago

Looks great! I suggest using fetch instead of the antiquated XMLHttpRequest, it's much easier to handle since it returns a promise, but it works very differently so you'll have to rewrite the entire API code.

If you create a GitHub organization named useful-forks you can have the URL useful-forks.github.io

Example: https://github.com/download-directory

posted by fregante over 4 years ago

I suggest using fetch instead of the antiquated XMLHttpRequest, it's much easier to handle since it returns a promise, but it works very differently so you'll have to rewrite the entire API code.

Yeah, I'm using XMLHttpRequest because that's how the initial code I forked was set up: I just went with it. I'll look into refactoring that. There are only 2 API calls coded in: hopefully that won't be too hard.

But knowing a bit the Promise API, I'm still puzzled by the task of knowing when the query has completed if all the requests are asynchronous: I was thinking I could use a counter which increments and decrements and watch when its value reaches 0, but there are edge-cases where it'll go back down to 0 while other requests won't have had their chance to increment it.

If you create a GitHub organization [...]

Oh, interesting. Is there a restriction on the amount of organizations a free account can create?

posted by payne911 over 4 years ago

I was thinking I could use a counter

Why do you need the counter specifically? Do you want to display it?

I'd use something simple like:

counter ++;
if (counter === 1) {
  // Start
}
const request = fetch(...).then(r => r.json());
request.finally(() => {
  counter --;
  if (counter === 0) {
    // End
  }
})

Oh, interesting. Is there a restriction on the amount of organizations a free account can create?

Not as far as I know

posted by fregante over 4 years ago

Why do you need the counter specifically? Do you want to display it?

It's not that I need it, but rather that it seemed like a possible solution to my problem. But like I said, I'm not sure it's sufficient. Take your example, and add more asynchronous requests as part of the .then() on your fetch(): what guarantees that those requests would begin (and thus increment the counter) before that initial one finished? Basically, the if (counter === 0) condition will often be met without all the requests actually being done.

Not as far as I know

I tried it out. Transferred ownership and all. The url ends up looking like https://useful-forks.github.io/useful-forks. Not sure I like it. Is there a way to remove that trailing useful-forks so that it isn't repetitive? For now, I re-transferred back to my personal account.

Apparently I can subscribe to the Developer Program which would allow the Organization to be subscribed as an Enterprise on GitHub, but some links are broken on the page...

posted by payne911 over 4 years ago

Is there a way to remove that trailing useful-forks

Yes, move the repo to the useful-forks organization and rename the repo to useful-forks.github.io

Also add a repository URL parameter so anyone can link directly to the results. Example:

https://useful-forks.github.io?repository=WL-Amigo/waifu2x-converter-cpp
posted by fregante over 4 years ago

Feature request moved to #3682 since this issue became chat. Further discussion should happen on the https://github.com/payne911/useful-forks repo if you enable the Issues.

posted by fregante over 4 years ago

If you create a GitHub organization named useful-forks you can have the URL useful-forks.github.io

@fregante I just wanted to get your take on this: https://docs.github.com/en/github/setting-up-and-managing-billing-and-payments-on-github/about-billing-for-github-sponsors

GitHub Sponsors does not charge any fees for sponsorships from user accounts, so 100% of these sponsorships go to the sponsored developer or organization. The 10% fee for sponsorships from organizations is waived during the beta.

"sponsorhips from organizations" : that does mean that it's in the eventuality that useful-forks sponsors another project, right?

If I was to apply for the GitHub Sponsors program, the donations to my organization wouldn't be affected by that clause, right?

posted by payne911 about 4 years ago

Fund this Issue

$0.00
Funded

Pull requests