Skip to content

Analyze a git repositories. Ultimately analyze all git repositories of some user (github/githlab/etc).

Notifications You must be signed in to change notification settings

JelteDirks/git-analyzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

87 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Git Analyzer

I created this project to learn more about the Rust. While making this little cli, I am reading the second edition of 'The Rust Programming Language' as well as 'Rust for Rustaceons' and making changes as I go along. For this reason I will not be documenting very elaborately. If someone somehow finds some genuine interest, I might do a better job at that. The documentation might not be up-to-date for aforementioned reasons.

The help message might already give you some hints hints, and probably saves many of you some reading time if you actually want to read this. I won't publish it to cargo (yet?) so everything is based on running it with cargo.

Usage: git-analyzer [OPTIONS]

Options:
  -p, --path <PATH>        path to the directory which you want to analyze
  -e, --exclude <EXCLUDE>  extensions that should be excluded, listed without '.' and separated by a space
  -i, --include <INCLUDE>  extensions that should be included, listed without '.' and separated by a space
  -a, --author <AUTHOR>    author of the commits that should be analyzed, passed to git log
  -d, --depth <DEPTH>      exact depth of the directory given by path
  -h, --help               Print help information
  -V, --version            Print version information

path

The path option specifies a directory on the machine to analyze. If only given a path, the analyzer finds the .git directory in that path and analyzes all objects in that directory.

Example: you are in a directory which looks like this

./
├── .git/
├── .gitignore
├── Cargo.lock
├── Cargo.toml
├── docs/
├── readme.md
├── src/
└── tmp/

and you run the following:

cargo run -- --path $PWD

you will analyze the current directory, and thus the .git folder in the this directory.

depth

The depth option specifies an exact depth relative to the given path or default path. The analyzer recurses down every directory and analyzes only those directories that are at the exact depth relative to the given path or default path.

Example: If you run

cargo run -- --path $PWD --depth 2

in a directory that looks like this

./
├── four/
│   ├── .git/
│   └── five/
│       └── .git/
└── one/
    ├── three/
    │   └── .git/
    └── two/
        └── .git/

you will analyze the following .git directories

./one/two/.git
./one/three/.git
./four/five/.git

and NOT ./four/.git/ since --depth is an exact depth.

exclude

This option excludes extensions from the output. The notation is space separated so make sure to include the "quotation" marks.

Example

cargo run -- --exclude "rs md"

excludes .rs and .md files.

include

This option includes extensions from the output, and ignores all extensions that are not in this list. The notation is space separated so make sure to include "quotation" marks.

Example

cargo run -- --include "c rs"

includes only .c and .rs files in the output.

author

This options limits the analyzing to only objects that are creatd by the given author. It is similar to the --author [AUTHOR] flag for git log. The filtering is a little loose, so make sure that you know what results the filtered author will give you.

Example

cargo run -- --author deez

will only include objects created by deez.

About

Analyze a git repositories. Ultimately analyze all git repositories of some user (github/githlab/etc).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages