Usage of gitreview @ dev:
gitreview facilitates visual inspection (code review) of git repositories that meet any of the following criteria:
- New content was fetched
- Behind origin/
- Ahead of origin/
- Messy (have uncommitted state)
- Throw errors for the required git operations (listed below)
We use variants of the following commands to ascertain the status of each repository:
git remote(shows remote address)git status(shows uncommitted files)git fetch(finds new commits/tags/branches)git rev-list(lists commits behind/ahead-of )git config --get ...(show config parameters of a repo)
...all of which should be safe enough.
Each repository that meets any criteria above will be
presented for review. After all reviews are complete a
concatenated report of all output from git fetch for
repositories that were behind their origin is printed to
stdout. Only repositories with "smarty" in their
path are included in this report.
Repositories are scanned recursively from the directory supplied in the first non-flag arg. If no non-flag args are provided, scanning begins from $HOME/src.
Installation:
go get -u github.com/smarty/gitreview
Skipping Repositories:
If you have repositories in your list that you would rather not review, you can mark them to be skipped by adding a config variable to the repository. The following command will produce this result:
git config --add review.skip true
Omitting Repositories:
If you have repositories in your list that you would still like to audit but aren't responsible to sign off (it's code from another team), you can mark them to be omitted from the final report by adding a config variable to the repository. The following command will produce this result:
git config --add review.omit true
CLI Flags:
-fetch
When false, suppress all git fetch operations via --dry-run.
Repositories with updates will still be included in the review.
--> (default true)
-gui string
The external git GUI application to use for visual reviews.
--> (default "smerge")
-outfile string
The path or name of the environment variable containing the
path to your pre-existing code review file. If the file exists
the final log entry will be appended to that file instead of stdout.
--> (default "SMARTY_REVIEW_LOG")