frost-nzcr4 / find_forks Goto Github PK
View Code? Open in Web Editor NEWFinds all forks of user/repo on github
License: MIT License
Finds all forks of user/repo on github
License: MIT License
Thanks for publishing this! In case you'd like to make your repo more findable), you could add that topic ;-) Thank you!
I have several forks to look for updates:
Can somehow I make it run from my forks, so it can find the upstream and all the other forks and check for updates? Perhaps a list of upstreams could help.
Update:
Running:
https://api.github.com/repos/evandrocoan/Packages/forks?per_page=1&page=1
On my fork, return empty from the github api. I need to pass the user name for the original repository owner sublimehq
, instead of the one of my fork.
Possible interesting forks
| forks | stargazers | watchers
----------------------------------------------------------------
some-user-1 | 3 | 1 | 1
some-user-2 | 2 | 1 | 1
some-user-3 | 1 | 1 | 1
some-user-4 | 0 | 1 | 0
Users with forks > 0
should be checked and their forks added to remotes, because forks API of main repo doesn't get all forks (forks of fork).
Hello again,
I think I found an edge case (related to #2).
The repo I was running find_forks
against was https://github.com/tjerkw/Android-SlideExpandableListView.
The remote setup:
[11:09 am] ~/dev/Android-SlideExpandableListView (master) $ git remote -v
origin [email protected]:tjerkw/Android-SlideExpandableListView.git (fetch)
origin [email protected]:tjerkw/Android-SlideExpandableListView.git (push)
The error when I run find_forks
:
[11:09 am] ~/dev/Android-SlideExpandableListView (master) $ python3 ../git/find_forks
git config --get remote.origin.url
Open https://api.github.com/repos/jerkw/Android-SlideExpandableListView/forks?per_page=100
Error: Not Found
git fetch --all
Fetching origin
There are no interesting forks
The username is tjerkw
but the URL is attempting to access jerkw
Changing it to https fixes the problem:
[11:10 am] ~/dev/Android-SlideExpandableListView (master) $ git remote set-url origin https://github.com/tjerkw/Android-SlideExpandableListView.git
[11:10 am] ~/dev/Android-SlideExpandableListView (master) $ python3 ../git/find_forksgit config --get remote.origin.url
Open https://api.github.com/repos/tjerkw/Android-SlideExpandableListView/forks?per_page=100
<output omitted>
I am import this like this:
import os
import sys
current_directory = os.path.dirname( os.path.realpath( __file__ ) )
sys.path.insert( 0, os.path.join( current_directory, 'find_forks/six' ) )
sys.path.insert( 0, os.path.join( current_directory, 'find_forks/find_forks' ) )
from find_forks import find_forks
...
user, repository = parse_upstream( upstream )
find_forks( user, repository )
But for each git command command it do, it open a new shell terminal window.
Example:
[11:13 am] ~/dev/scrap/$ git clone [email protected]:frost-nzcr4/webmoney.git
Cloning into 'webmoney'...
remote: Counting objects: 302, done.
remote: Total 302 (delta 0), reused 0 (delta 0), pack-reused 302
Receiving objects: 100% (302/302), 74.83 KiB | 0 bytes/s, done.
Resolving deltas: 100% (142/142), done.
Checking connectivity... done.
[11:14 am] ~/dev/scrap/$ cd webmoney/
[11:14 am] ~/dev/scrap/webmoney (master) $ python ~/dev/git/find_forks/ --dry-run
git config --get remote.origin.url
Open https://api.github.com/repos/[email protected]:frost-nzcr4/webmoney/forks?per_page=100
Error: Not Found
git fetch --all
There are no interesting forks
https://api.github.com/repos/[email protected]:frost-nzcr4/webmoney/forks?per_page=100
should be
https://api.github.com/repos/frost-nzcr4/webmoney/forks?per_page=100
Hello @frost-nzcr4 .
For example, my local repo it's fork of more popular repo. My repo has't fork.
I want to get all forks of more popular repo that has changes but not merged in to popular repo.
Can you add this feature?
Temporary you can remove them running git branch -r --merged | grep -v -e "\(origin\|your\-github\-name\)/" | xargs -n 1 git branch -r -d
Used open() without close() in tests.
When repo have many forks (6000 and above = 60 request per minute * 100 number of records records per page) or connection is unstable one's would need to set start page to continue fetching.
Now you can run find_forks one of the following methods:
specify path to folder: python /path/to/find_forks
C:\Users\endolith\Sync\Programming\Wavelets\aaren wavelets\wavelets (my_changes)
(base) λ python C:\Users\endolith\Documents\GitHub\find_forks
Traceback (most recent call last):
File "C:\Anaconda3\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\Anaconda3\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\endolith\Documents\GitHub\find_forks\__main__.py", line 8, in <module>
from .find_forks.find_forks import main
ImportError: attempted relative import with no known parent package
specify module name If find_forks in your PYTHONPATH: python -m find_forks
C:\Users\endolith\Sync\Programming\Wavelets\aaren wavelets\wavelets (my_changes)
λ python -m find_forks
C:\Anaconda3\python.exe: No module named find_forks.__main__; 'find_forks' is a package and cannot be directly executed
or if you obtained zip from github you could simply run it: python /path/to/find_forks.zip
C:\Users\endolith\Sync\Programming\Wavelets\aaren wavelets\wavelets (my_changes)
(base) λ python C:\Users\endolith\Downloads\find_forks-master.zip
File "C:\Users\endolith\Downloads\find_forks-master.zip", line 1
PK♥♦
^
SyntaxError: invalid syntax
C:\Users\endolith\Sync\Programming\Wavelets\aaren wavelets\wavelets (my_changes)
λ python C:\Users\endolith\Documents\GitHub\find_forks\find_forks\find_forks.py
Traceback (most recent call last):
File "C:\Users\endolith\Documents\GitHub\find_forks\find_forks\find_forks.py", line 14, in <module>
from .__init__ import CONFIG
ImportError: attempted relative import with no known parent package
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.