forked from hbt/git-forks-analysis
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
2,263 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.idea | ||
out | ||
/!out/.notempty |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[submodule "deps/gitinspector"] | ||
path = deps/gitinspector | ||
url = https://github.com/hbt/gitinspector | ||
[submodule "deps/git_stats"] | ||
path = deps/git_stats | ||
url = https://github.com/hbt/git_stats |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
FROM ubuntu:16.04 | ||
|
||
#// TODO(hbt) ENHANCE optimize | ||
|
||
RUN apt-get update && apt-get install -y git | ||
RUN apt-get update && apt-get install -y python python-pip | ||
|
||
RUN mkdir /deps && cd /deps && \ | ||
git clone https://github.com/frost-nzcr4/find_forks | ||
|
||
RUN cd /deps/find_forks && pip install -r requirements-prod.txt | ||
|
||
#// TODO(hbt) NEXT testing rm | ||
RUN mkdir /tests && cd /tests && git clone https://github.com/hbt/mouseless | ||
|
||
RUN apt-get install -y curl gawk autoconf automake bison libffi-dev libgdbm-dev libncurses5-dev libsqlite3-dev libtool libyaml-dev pkg-config sqlite3 zlib1g-dev libgmp-dev libreadline6-dev libssl-dev | ||
RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB && curl -sSL https://get.rvm.io | bash -s stable --ruby=2.1.3 | ||
|
||
RUN cd /deps && git clone https://github.com/hbt/github-backup | ||
|
||
#// TODO(hbt) NEXT optimize | ||
|
||
RUN /bin/bash -l -c "rvm use 2.1.3" | ||
RUN /bin/bash -l -c "gem install bundler --no-ri --no-rdoc" | ||
RUN /bin/bash -l -c "cd /deps/github-backup && bundle" | ||
#RUN /bin/bash -l -c "ruby /deps/github-backup/bin/github-backup -u frost-nzcr4 -r find_forks -o /deps -f " | ||
#https://github.com/frost-nzcr4/find_forks | ||
|
||
|
||
#RUN cd /deps && git clone https://github.com/hbt/github-backup | ||
#RUN cd /deps/github-backup && bundle | ||
|
||
RUN apt-get install -y php | ||
|
||
RUN cd / && git clone https://github.com/hbt/gitinspector | ||
|
||
RUN apt-get install -y locales | ||
|
||
|
||
RUN echo "LC_ALL=en_US.UTF-8" >> /etc/environment && \ | ||
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen && \ | ||
echo "LANG=en_US.UTF-8" > /etc/locale.conf && \ | ||
locale-gen en_US.UTF-8 | ||
|
||
ENV LANG en_US.UTF-8 | ||
ENV LANGUAGE en_US:en | ||
ENV LC_ALL en_US.UTF-8 | ||
|
||
RUN cd /deps && git clone https://github.com/hbt/git_stats | ||
RUN /bin/bash -l -c "rvm use 2.1.3 && cd /deps/git_stats && bundle" | ||
|
||
ENV PATH="/git-forks-analysis/bin:${PATH}" | ||
ADD . /git-forks-analysis | ||
ADD ./config/php.ini /etc/php/7.0/cli/php.ini | ||
|
||
|
||
#// TODO(hbt) NEXT testing rm | ||
#RUN find-forks-recursively -u frost-nzcr4 -r find_forks -o /deps -f | ||
#RUN cd /tests/mouseless && find-forks | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,72 @@ | ||
# git-forks-analysis | ||
Analyze forks network to find hidden gems | ||
|
||
Analyze forks network to find interesting forks, commits, file changes. | ||
|
||
|
||
## Why build it? | ||
|
||
* Frustration with navigation forks graph / network on GitHub | ||
* Too many forks with nothing interesting and noisy commits | ||
* Wanting to find changes made to a file, function or a set of lines across the network to avoid duplicating the work (fixing similar bugs or building similar features) | ||
|
||
## How does it work? | ||
|
||
* Gets all forks and all branches into a single repository | ||
* Make available git data mining tools such as `gitinspector` and `git_stats`. Use the tools in this repository as they have been modified to work across all branches | ||
* View other `Tips` below on how to search across the forks network using Git commands | ||
|
||
|
||
[//]: # (// TODO(hbt) ENHANCE simplify Config) | ||
|
||
|
||
// TODO(hbt) NEXT add instructions | ||
|
||
## How to install it? | ||
|
||
// TODO(hbt) NEXT add submodules init -- test from scratch | ||
```bash | ||
|
||
git clone https://github.com/hbt/git-forks-analysis | ||
docker-compose pull hbtlabs/git-forks-analysis | ||
|
||
``` | ||
|
||
## How to use it? | ||
|
||
// TODO(hbt) ENHANCE check code highlight | ||
|
||
To generate HTML visualization of forks | ||
|
||
``` | ||
cd bin | ||
./analyze-forks username repository | ||
# retrieve all direct forks for https://github.com/hbt/mouseless | ||
./analyze-forks hbt mouseless | ||
# retrieve all forks recursively (the whole network) https://github.com/frost-nzcr4/find_forks -- purposefully chose a small repo to avoid running this by mistake | ||
./analyze-forks-deep frost-nzcr4 find_forks | ||
``` | ||
|
||
view generated html files in `out` directory for: | ||
|
||
- gitinspector in /out/repo.html e.g /out/mouseless.html | ||
- quick_stats in /out/repo/quick_stats/index.html e.g /opt/mouseless/quick_stats/index.html | ||
|
||
|
||
Calling the `gitinspector` directly via CLI | ||
|
||
```bash | ||
|
||
./bin/gitinspector /out/mouseless | ||
./bin/gitinspector --grading=true /out/mouseless | ||
./bin/gitinspector --grading=true --format=html /out/mouseless | ||
|
||
``` | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
|
||
docker-compose -f $(dirname $0)/../docker-compose.yml run --rm --workdir /out --entrypoint "/git-forks-analysis-src/scripts/analyze-forks.php" git-forks-analysis "$@" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
|
||
docker-compose -f $(dirname $0)/../docker-compose.yml run --rm --workdir /out --entrypoint "/git-forks-analysis-src/scripts/analyze-forks-deep.php" git-forks-analysis "$@" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
if [ ! -f /.dockerenv ]; then | ||
echo "Skipping. Not in docker container"; | ||
fi | ||
|
||
python /deps/find_forks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
if [ ! -f /.dockerenv ]; then | ||
echo "Skipping. Not in docker container"; | ||
fi | ||
|
||
rm -rf /root/.ssh | ||
cp -R /root/.ssh2 /root/.ssh | ||
chmod 600 /root/.ssh/config | ||
chown -R root:root /root/.ssh | ||
|
||
params=$@ | ||
bash -l -c "rvm use 2.1.3 && ruby --version && ruby /deps/github-backup/bin/github-backup $params" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
|
||
docker-compose -f $(dirname $0)/../docker-compose.yml run --rm --workdir /out --entrypoint "/git-forks-analysis-src/deps/gitinspector/gitinspector.py" git-forks-analysis "$@" | ||
|
Oops, something went wrong.