From 5b01b5e055fdfa59258bb1855a6444516920f931 Mon Sep 17 00:00:00 2001 From: Tom Ice Date: Thu, 16 May 2024 15:09:17 -0400 Subject: [PATCH] Update documentation for clarity * Added additional information to better explain how to use this on macOS. * Updated some of the deps used * Minor adjustments in the README.md Addresses Issue #166 --- README.md | 30 +++++++++++++++++++++++++----- git-quick-stats | 13 +++++++------ 2 files changed, 32 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index f3ab9bb..f4dcfe2 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,13 @@ - # GIT quick statistics [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Simple%20and%20efficient%20way%20to%20access%20various%20statistics%20in%20git%20repository&url=https://github.com/arzzen/git-quick-stat&via=arzzen&hashtags=git,stats,tool,statistics,developers) -[![Backers on Open Collective](https://opencollective.com/git-quick-stats/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/git-quick-stats/sponsors/badge.svg)](#sponsors) [![Homebrew package](https://repology.org/badge/version-for-repo/homebrew/git-quick-stats.svg)](https://formulae.brew.sh/formula/git-quick-stats#default) + +[![Backers on Open Collective](https://opencollective.com/git-quick-stats/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/git-quick-stats/sponsors/badge.svg)](#sponsors) [![Homebrew package](https://repology.org/badge/version-for-repo/homebrew/git-quick-stats.svg)](https://formulae.brew.sh/formula/git-quick-stats#default) > `git-quick-stats` is a simple and efficient way to access various statistics in a git repository. > -> Any git repository may contain tons of information about commits, contributors, and files. Extracting this information is not always trivial, mostly because there are a gadzillion options to a gadzillion git commands – I don’t think there is a single person alive who knows them all. Probably not even [Linus Torvalds](https://github.com/torvalds) himself :). +> Any git repository may contain tons of information about commits, contributors, and files. Extracting this information is not always trivial, mostly because there are a gadzillion options to a gadzillion git commands - I don't think there is a single person alive who knows them all. Probably not even [Linus Torvalds](https://github.com/torvalds) himself :). ![mainMenuScreenshot](https://user-images.githubusercontent.com/8818630/154823670-f42a111b-45f4-47fc-aea7-80059827c8e6.png) - ## Table of Contents [**Screenshots**](#screenshots) @@ -244,12 +243,28 @@ sudo make reinstall ### macOS (homebrew) +macOS requires GNU coreutils to be installed and for the non "g" aliased +versions to be exported to your path. The following is an example of how to +perform this if you are using Homebrew as your package manager. + +```bash +brew install coreutils +export PATH="$HOMEBREW_PREFIX/opt/coreutils/libexec/gnubin:$PATH" +``` + +From there, you can install via Homebrew as follows: + ```bash brew install git-quick-stats ``` Or you can follow the UNIX and Linux instructions if you wish. +If you would like to default to using the GNU coreutils (recommended), then you +can add `export PATH="$HOMEBREW_PREFIX/opt/coreutils/libexec/gnubin:$PATH"` to +your applicable `~/.bash_profile`, `~/.zprofile`, or other relevant profile +based on the shell of your choice. + ### Windows If you are installing with Cygwin, use these scripts: @@ -277,6 +292,7 @@ awk basename cat column +date echo git grep @@ -291,7 +307,11 @@ uniq ### Dependencies -* [`bsdmainutils`](https://packages.debian.org/sid/bsdmainutils) `apt install bsdmainutils` +* [`bsdextrautils`](https://packages.debian.org/sid/bsdextrautils) `apt install bsdextrautils` +* [`coreutils`](https://packages.debian.org/sid/coreutils) `apt install coreutils` +* [`gawk`](https://packages.debian.org/sid/gawk) `apt install gawk` +* [`grep`](https://packages.debian.org/sid/grep) `apt install grep` +* [`ncurses-bin`](https://packages.debian.org/sid/ncurses-bin) `apt install ncurses-bin` ## FAQ diff --git a/git-quick-stats b/git-quick-stats index 1edefc5..1286f95 100755 --- a/git-quick-stats +++ b/git-quick-stats @@ -82,8 +82,8 @@ _theme="${_MENU_THEME:=default}" ################################################################################ function checkUtils() { readonly MSG="not found. Please make sure this is installed and in PATH." - readonly UTILS="awk basename cat column echo git grep head printf seq sort \ - tput tr uniq" + readonly UTILS="awk basename cat column date echo git grep head printf seq \ + sort tput tr uniq" for u in $UTILS do @@ -99,10 +99,11 @@ function checkUtils() { # the user that this will not work rather than having it silently bomb out # during runtime. if ! date --version >/dev/null 2>&1; then - echo "ERROR: GNU date is required." - echo "If you're on macOS, please install it using 'brew install coreutils'." - echo "Ensure that your PATH is configured to use GNU date as well." - exit 1 + echo "ERROR: GNU date is required." + echo "If you're on macOS, please install it using 'brew install coreutils'." + echo "Ensure that your PATH is configured to use GNU date as well." + echo "See the README.md for further details." + exit 1 fi }