From b61e5b82b831ea451aae06bb12f5e95cfe33731e Mon Sep 17 00:00:00 2001 From: Andreas Zoellner Date: Fri, 7 Feb 2020 10:51:41 -0800 Subject: [PATCH 1/2] Add option -F to force recursion. Closes https://github.com/kamranahmedse/git-standup/issues/96 --- git-standup | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/git-standup b/git-standup index b5f9a8d..9494521 100755 --- a/git-standup +++ b/git-standup @@ -9,6 +9,7 @@ Usage: -a - Specify author to restrict search to -w - Specify weekday range to limit search to -m - Specify the depth of recursive directory search + -F - Force recursion up to speficied depth -L - Toggle inclusion of symbolic links in recursive directory search -d - Specify the number of days back to include -u - Specify the number of days back until this day @@ -118,9 +119,9 @@ function runStandup() { fi } -while getopts "hgfsd:u:a:w:m:D:A:B:LrcR" opt; do +while getopts "hgfsd:u:a:w:m:D:A:B:LrcRF" opt; do case $opt in - h|d|u|a|w|m|g|D|f|s|L|r|A|B|c|R) + h|d|u|a|w|m|g|D|f|s|L|r|A|B|c|R|F) declare "option_$opt=${OPTARG:-0}" ;; \?) @@ -214,7 +215,7 @@ fi GIT_DATE_FORMAT=${option_D:-relative} # For when the command has been run in a non-repo directory -if [[ ! -d ".git" || -f ".git" ]]; then +if [[ $option_F || ! -d ".git" || -f ".git" ]]; then BASE_DIR=`pwd` # Set delimiter to newline for the loop IFS=$'\n' From f1b972672cc2734d3627a743a8a9c45d4621f028 Mon Sep 17 00:00:00 2001 From: Andreas Zoellner Date: Tue, 11 Feb 2020 10:49:44 -0800 Subject: [PATCH 2/2] update readme --- README.md | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 2a62762..d090d19 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ You can install `git-standup` using one of the options listed below | npm | `npm install -g git-standup` | | brew | `brew update && brew install git-standup` | | aur | `pacaur -S git-standup-git` | -| manual | Clone and run `make install` | +| manual | Clone and run `make install` | ## Usage @@ -30,22 +30,23 @@ git standup If you run it in a folder containing multiple git repositories, it will go through each of the projects and give you the standup report for each one of them. -## Options +## Options You can pass several options to modify how git-standup behaves ```shell -git standup [-a ] +git standup [-a ] [-w ] [-m ] - [-d ] + [-F] + [-d ] [-u ] [-D ] [-A ] [-B ] [-L] - [-g] - [-h] + [-g] + [-h] [-f] [-s] [-r] @@ -53,13 +54,14 @@ git standup [-a ] [-R] ``` -Here is the detail for each of the options +Here is the detail for each of the options | Option | Description | | --- | --- | | a | Specify author to restrict search to e.g. `-a "Kamran Ahmed"` or `-a "all"` | | w | Specify week start and end days e.g. in UAE weekdays are from Sunday to Thursday so you can do `-w SUN-THU`| | m | Specify the depth of recursive directory search e.g. `-m 3` defaults to two | +| F | Force recursion up to speficied depth even when git repository found earlier | | d | Specify the number of days back to include e.g. `-d 30` to get for a month | | u | Specify the number of days back till which standup should run e.g. `-u 3` | | L | Toggle inclusion of symbolic links in recursive directory search | @@ -95,12 +97,13 @@ $ git standup ![git standup](http://i.imgur.com/4xmkA49.gif) -This will show you all your commits since the last working day in all the repositories inside. +This will show you all your commits since the last working day in all the repositories inside. ## Directory depth By default the script searches only in the current directory or one level deep. If you want to increase that, use the `-m` switch. +If the base directory is a git repository you can use the `-F` switch to force the recursion. ```shell $ git standup -m 3