├── .github └── FUNDING.yml ├── .gitignore ├── LICENSE ├── Makefile ├── README.md ├── actions ├── shellcheck └── shfmt ├── git-standup ├── installer.sh ├── package.json └── snap └── snapcraft.yaml /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: kamranahmedse 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .DS_Store 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Kamran Ahmed 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | PREFIX ?= /usr/local 2 | EXEC_PREFIX ?= $(PREFIX) 3 | BINDIR ?= $(EXEC_PREFIX)/bin 4 | DATAROOTDIR ?= $(PREFIX)/share 5 | DATADIR ?= $(DATAROOTDIR) 6 | MANDIR ?= $(DATAROOTDIR)/man 7 | 8 | # files that need mode 755 9 | EXEC_FILES = git-standup 10 | 11 | .PHONY: check all install uninstall shellcheck shfmt 12 | 13 | all: 14 | @echo "usage: make install" 15 | @echo " make uninstall" 16 | 17 | install: 18 | mkdir -p $(BINDIR) 19 | install -m 0755 $(EXEC_FILES) $(BINDIR) 20 | 21 | uninstall: 22 | test -d $(BINDIR) && \ 23 | cd $(BINDIR) && \ 24 | rm -f $(EXEC_FILES) 25 | 26 | check: shellcheck shfmt 27 | 28 | shellcheck: 29 | ./actions/shellcheck 30 | 31 | shfmt: 32 | ./actions/shfmt -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # git-standup 2 | 3 | > Recall what you did on the last working day ..or be nosy and find what someone else did. 4 | 5 | A little tool that I always wanted for myself. I work on several repositories on daily basis and it is mostly difficult for me to remember where I left off in each one of them. `git-standup` helps me with running standups and keeping track of what I have been doing. By default it gives you the most common usage i.e. shows you commits from the last working day in the current directory and the directories below current level plus it comes with several options to modify how it behaves. 6 | 7 | 8 | ## Requirements 9 | The only requirement is having good commit messages :) 10 | 11 | ![](https://i.imgur.com/yL03GkB.png) 12 | 13 | ## Install 14 | 15 | You can install `git-standup` using one of the options listed below 16 | 17 | | Source | Command | 18 | | --- | --- | 19 | | curl | `curl -L https://raw.githubusercontent.com/kamranahmedse/git-standup/master/installer.sh \| sudo sh` | 20 | | npm | `npm install -g git-standup` | 21 | | brew | `brew update && brew install git-standup` | 22 | | aur | `pacaur -S git-standup-git` | 23 | | manual | Clone and run `make install` | 24 | 25 | ## Usage 26 | 27 | Simply run it in your project directory and it will give you the output from the last working day 28 | 29 | ```shell 30 | git standup 31 | ``` 32 | 33 | 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. 34 | 35 | ## Options 36 | 37 | You can pass several options to modify how git-standup behaves 38 | 39 | ```shell 40 | git standup [-a ] 41 | [-w ] 42 | [-m ] 43 | [-F] 44 | [-b ] 45 | [-d ] 46 | [-u ] 47 | [-D ] 48 | [-A ] 49 | [-B ] 50 | [-L] 51 | [-g] 52 | [-h] 53 | [-f] 54 | [-s] 55 | [-r] 56 | [-c] 57 | [-R] 58 | ``` 59 | 60 | Here is the detail for each of the options 61 | 62 | | Option | Description | 63 | | --- | --- | 64 | | a | Specify author to restrict search to e.g. `-a "Kamran Ahmed"` or `-a "all"` | 65 | | b | Specify branch to restrict search to (unset: all branches, "\$remote/\$branch" to include fetches) | 66 | | w | Specify week start and end days e.g. in UAE weekdays are from Sunday to Thursday so you can do `-w SUN-THU`| 67 | | m | Specify the depth of recursive directory search e.g. `-m 3` defaults to two | 68 | | F | Force recursion up to specified depth even when git repository found earlier | 69 | | d | Specify the number of days back to include e.g. `-d 30` to get for a month | 70 | | u | Specify the number of days back till which standup should run e.g. `-u 3` | 71 | | L | Toggle inclusion of symbolic links in recursive directory search | 72 | | D | Specify the date format for "git log" (default: relative) [possible values](https://git-scm.com/docs/git-log#git-log---dateltformatgt) | 73 | | A | Show the commits till after the given date 74 | | B | Show the commits till before the given date 75 | | h | Display the help screen | 76 | | g | Show if commit is GPG signed (G) or not (N) | 77 | | f | Fetch the latest commits beforehand | 78 | | s | Silences the no activity message (useful when running in a directory having many repositories) | 79 | | c | Show diff-stat for every matched commit 80 | | r | Generates the standup report file `git-standup-report.txt` in the current directory | 81 | | R | Display the author date instead of the committer date | 82 | 83 | For the basic usage, all you have to do is run `git standup` in a repository or a folder containing multiple repositories 84 | 85 | ## Single Repository Usage 86 | 87 | To check all your personal commits from last working day, head to the project repository and run 88 | 89 | ```shell 90 | $ git standup 91 | ``` 92 | 93 | ![git standup](http://i.imgur.com/wyo4s9E.gif) 94 | 95 | ## Multiple Repository Usage 96 | Open a directory having multiple repositories and run 97 | 98 | ```shell 99 | $ git standup 100 | ``` 101 | 102 | ![git standup](http://i.imgur.com/4xmkA49.gif) 103 | 104 | This will show you all your commits since the last working day in all the repositories inside. 105 | 106 | ## Directory depth 107 | 108 | By default the script searches only in the current directory or one 109 | level deep. If you want to increase that, use the `-m` switch. 110 | If the base directory is a git repository you can use the `-F` switch to force the recursion. 111 | 112 | ```shell 113 | $ git standup -m 3 114 | ``` 115 | 116 | ## Checking someone else's commits 117 | 118 | If you want to find out someone else's commits do 119 | 120 | ```shell 121 | # Considering their name on git is "John Doe" 122 | $ git standup -a "John Doe" 123 | ``` 124 | 125 | Apart from restrict to commits from a certain user, you can also use `-a` flag to avoid certain users. You can do that if you enable perl regexp in your git installation `git config --global grep.patternType perl`, and use the author filter like below: 126 | 127 | ```shell 128 | git standup -a'^(?!(renovate\[bot\]))' 129 | ``` 130 | 131 | ![git standup](http://i.imgur.com/sYICxW8.gif) 132 | 133 | ## Check what every contributor did 134 | 135 | If you want to find out someone else's commits do 136 | 137 | ```shell 138 | $ git standup -a "all" 139 | ``` 140 | 141 | ## Commits from `n` days ago 142 | 143 | If you would like to show all your/someone else's commits from n days ago, you can do 144 | 145 | ```shell 146 | # Show all my commits from 4 days ago 147 | $ git standup -d 4 148 | 149 | # Show all John Doe's commits from 5 days ago 150 | $ git standup -a "John Doe" -d 5 151 | ``` 152 | 153 | ![git standup -d 5](http://i.imgur.com/j7Ma760.gif) 154 | 155 | ## Date filters 156 | 157 | You can apply the filters on the commits shown. Use `-A` and `-B` flags to specify `after` and `before` dates 158 | 159 | ```shell 160 | # Show all the commits after October 01, 2018 161 | git standup -A "2018-10-01 00:00" 162 | # Show all the commits till before October 01, 2018 163 | git standup -B "2018-10-01 00:00" 164 | # Show the commits between September 20 and September 30 165 | git standup -A "2018-09-20 00:00:00" -B "2018-09-30 23:59" 166 | ``` 167 | 168 | ## Show Diff-stat 169 | 170 | Add `-c` flag to show the diff-stat for each of the commits in standup results 171 | ```shell 172 | git standup -c 173 | ``` 174 | 175 | ## [Identifying Signed Commits](https://git-scm.com/book/en/v2/Git-Tools-Signing-Your-Work) 176 | 177 | Add `-g` flag to check the GPG info 178 | 179 | ```shell 180 | $ git standup -g 181 | ``` 182 | 183 | ![GPG Info](http://i.imgur.com/bwJzPft.gif) 184 | 185 | ## Specifying the date format 186 | 187 | Add `-D` flag to specify the date format. Default is `relative` 188 | 189 | Please note that it accepts the same format that you could pass while doing git log. For example 190 | 191 | ```shell 192 | $ git standup -D relative 193 | # Or instead of relative, it could be local|default|iso|iso-strict|rfc|short|raw etc 194 | ``` 195 | 196 | ## Branch Filter 197 | 198 | Use of `-b foobar` option, which restricts returned results to commits present on branch `foobar`. Supports arbitrary branch specs, so for example `-b origin/foobar` would include data present on the remote that has not been merged locally. 199 | 200 | ```shell 201 | # Use develop branch for standup 202 | git standup -b develop 203 | ``` 204 | 205 | ### Directory whitelisting 206 | 207 | If you want to restrict the standup to some paths, you can whitelist them by adding them to a `.git-standup-whitelist` file. For example if you have the below directory structure 208 | 209 | ├── Workspace # All your projects are here 210 | │ ├── project-a # Some git repository called project-a 211 | │ ├── project-b # Some git repository called project-b 212 | │ ├── sketch-files # Some sketch files 213 | │ ├── mockups # Some balsamiq mockups 214 | │ └── ... # etc. 215 | └── ... 216 | 217 | And you want the `git-standup` to show logs for only `project-a` and `project-b`, you can do that by creating a `.git-standup-whitelist` file under the `Workspace` directory with the below contents and it will only consider these directories for the standup 218 | 219 | ``` 220 | project-a 221 | project-b 222 | ``` 223 | 224 | ## Changing the Weekdays 225 | 226 | By default, it considers that the work week starts on Monday and ends on Friday. So if you are running this on any day between Tuesday and Friday, it will show you your commits from the last day. However, if you are running this on Monday, it will show you all your commits since Friday. 227 | 228 | If you want to change this, like I want because here in Dubai working days are normally Sunday to Thursday, you will have to do the following 229 | 230 | ```shell 231 | $ git standup -w "SUN-THU" 232 | ``` 233 | 234 | ## Fetch commits before showing standup 235 | 236 | If you have many repositories that you want to generate a standup for, it may be useful to automatically run `git fetch` before viewing the standup. 237 | 238 | If you would like to automatically run `git fetch --all` before printing the standup, you can add the `-f` flag, as show below 239 | 240 | ```shell 241 | $ git standup -f 242 | ``` 243 | 244 | ## Mixing options 245 | 246 | Of course you can mix the options together but please note that if you provide the number of days, it will override the weekdays configuration (`MON-FRI`) and will show you the commits specifically from `n` days ago. 247 | 248 | ```shell 249 | # Show all the John Doe's commits from 5 days ago 250 | $ git standup -a "John Doe" -d 5 251 | ``` 252 | 253 | ## License 254 | 255 | MIT © [Kamran Ahmed](http://kamranahmed.info) 256 | -------------------------------------------------------------------------------- /actions/shellcheck: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | 3 | set -euo pipefail 4 | 5 | root="$(git rev-parse --show-toplevel)" 6 | cd "$root" 7 | 8 | { 9 | # `.sh` extension 10 | git ls-files '*.sh' 11 | # `#! usr/bin/env bash` shebang 12 | git grep -l '^\(#! */usr/bin/env bash\|#! */bin/bash\)$' 13 | # remove duplicates from .sh + shebang 14 | } | sort | uniq | xargs shellcheck || exit 1 15 | -------------------------------------------------------------------------------- /actions/shfmt: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | 3 | set -euo pipefail 4 | 5 | root="$(git rev-parse --show-toplevel)" 6 | cd "$root" 7 | 8 | { 9 | # `.sh` extension 10 | git ls-files '*.sh' 11 | # `#! usr/bin/env bash` shebang 12 | git grep -l '^\(#! */usr/bin/env bash\|#! */bin/bash\)$' 13 | # remove duplicates from .sh + shebang 14 | # 2 space indentation, allow binary ops (`&&`, `||`, etc.) to start lines, 15 | # indent switch cases & add spaces after redirect operators. 16 | } | sort | uniq | xargs shfmt -i 2 -bn -ci -sr -w || exit 1 17 | -------------------------------------------------------------------------------- /git-standup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # shellcheck disable=SC2128 3 | 4 | # Shows the usage 5 | function usage() { 6 | cat << EOS 7 | Usage: 8 | git standup [-a ] [-w ] [-d ] [-u ] [-m ] [-g] [-h] [-f] [-c] 9 | 10 | -a - Specify author to restrict search to or use "all" to see all authors 11 | -b - Specify branch to restrict search to (unset: all branches, "\$remote/\$branch" to include fetches) 12 | -w - Specify weekday range to limit search to 13 | -m - Specify the depth of recursive directory search 14 | -F - Force recursion up to specified depth 15 | -L - Toggle inclusion of symbolic links in recursive directory search 16 | -d - Specify the number of days back to include 17 | -u - Specify the number of days back until this day 18 | -D - Specify the date format for "git log" (default: relative, other: local|default|iso|rfc|short|raw) 19 | -h - Display this help screen 20 | -g - Show if commit is GPG signed (G) or not (N) 21 | -f - Fetch the latest commits beforehand 22 | -s - Silences the no activity message (useful when running in a directory having many repositories) 23 | -r - Generate a file with the report 24 | -c - Show diffstat for every matched commit 25 | -A - List commits after this date 26 | -B - List commits before this date 27 | -R - Display the author date instead of the committer date 28 | 29 | Examples: 30 | git standup -a "John Doe" -w "MON-FRI" -m 3 31 | EOS 32 | } 33 | 34 | # Sets up the colored output 35 | function colored() { 36 | RED=$(tput setaf 1) 37 | GREEN=$(tput setaf 2) 38 | YELLOW=$(tput setaf 3) 39 | BLUE=$(tput setaf 4) 40 | BOLD=$(tput bold) 41 | UNDERLINE=$(tput smul) 42 | NORMAL=$(tput sgr0) 43 | 44 | GIT_PRETTY_DATE="%cd" 45 | if [[ ${option_R:=} ]]; then 46 | GIT_PRETTY_DATE="%ad" 47 | fi 48 | 49 | GIT_PRETTY_FORMAT="%Cred%h%Creset - %s %Cgreen($GIT_PRETTY_DATE) %C(bold blue)<%an>%Creset" 50 | COLOR=always 51 | 52 | if [[ ${option_g:=} ]]; then 53 | GIT_PRETTY_FORMAT="$GIT_PRETTY_FORMAT %C(yellow)gpg: %G?%Creset" 54 | fi 55 | } 56 | 57 | # Sets up the uncolored output 58 | function uncolored() { 59 | # shellcheck disable=SC2034 60 | RED="" 61 | GREEN="" 62 | YELLOW="" 63 | # shellcheck disable=SC2034 64 | BLUE="" 65 | BOLD="" 66 | UNDERLINE="" 67 | NORMAL="" 68 | 69 | GIT_PRETTY_DATE="%cd" 70 | if [[ $option_R ]]; then 71 | GIT_PRETTY_DATE="%ad" 72 | fi 73 | 74 | GIT_PRETTY_FORMAT="%h - %s ($GIT_PRETTY_DATE) <%an>" 75 | COLOR=never 76 | 77 | if [[ $option_g ]]; then 78 | GIT_PRETTY_FORMAT="$GIT_PRETTY_FORMAT gpg: %G?\n" 79 | else 80 | GIT_PRETTY_FORMAT="$GIT_PRETTY_FORMAT \n" 81 | fi 82 | } 83 | 84 | function writeFile() { 85 | echo -e "$1" >> "${REPORT_FILE_PATH}" 86 | } 87 | 88 | function runStandup() { 89 | # Fetch the latest commits, if required 90 | if [[ ${option_f:=} ]]; then 91 | echo "${BOLD}${GREEN}Fetching commits in ${YELLOW}${UNDERLINE}${BOLD}${BASENAME}${NORMAL}" 92 | git fetch --all > /dev/null 2>&1 93 | fi 94 | 95 | { 96 | # shellcheck disable=SC2086 97 | GITOUT=$(eval ${GIT_LOG_COMMAND} 2> /dev/null) 98 | } || { 99 | GITOUT="" 100 | } 101 | 102 | # If `r` option was given then no output, just write the report 103 | if [[ -n ${option_r:=} ]]; then 104 | echo "Generating report for: ${CUR_DIR}" 105 | 106 | if [[ -n "$GITOUT" ]]; then 107 | writeFile "${CUR_DIR}\n $GITOUT" 108 | elif [[ -z ${option_s:=} ]]; then 109 | writeFile "${CUR_DIR}\n No activity found!\n" 110 | fi 111 | else 112 | ## Only output if there is some activity 113 | if [[ -n "$GITOUT" ]]; then 114 | echo "${BOLD}${UNDERLINE}${YELLOW}$CUR_DIR${NORMAL}" 115 | echo "$GITOUT" 116 | elif [[ -z $option_s ]]; then ## Show the no activity message only if the `s` flag is not there 117 | echo "${BOLD}${UNDERLINE}${YELLOW}$CUR_DIR${NORMAL}" 118 | if [[ ${AUTHOR} = '.*' ]]; then 119 | echo "${YELLOW}No commits found during this period.${NORMAL}" 120 | else 121 | echo "${YELLOW}No commits from $AUTHOR during this period.${NORMAL}" 122 | fi 123 | fi 124 | fi 125 | } 126 | 127 | while getopts "hgfsd:u:a:w:m:D:A:B:LrcRFb:" opt; do 128 | case $opt in 129 | h | d | u | a | w | m | g | D | f | s | L | r | A | B | c | R | F | b) 130 | declare "option_$opt=${OPTARG:-0}" 131 | ;; 132 | \?) 133 | echo >&2 "Use 'git standup -h' to see usage info" 134 | exit 1 135 | ;; 136 | esac 137 | done 138 | 139 | shift $((OPTIND - 1)) 140 | 141 | if [[ $# -gt 0 ]]; then 142 | echo >&2 "Invalid arguments: $*" 143 | echo >&2 "Use 'git standup -h' to see usage info" 144 | exit 1 145 | fi 146 | 147 | # Main script 148 | if [[ ${option_h:=} ]]; then 149 | usage 150 | exit 0 151 | fi 152 | 153 | # Use colors, but only if connected to a terminal, and that terminal supports them. 154 | if [[ -t 1 ]] && [[ -n "$TERM" ]] && command -v tput &> /dev/null && tput colors &> /dev/null; then 155 | ncolors=$(tput colors) 156 | if [[ -n "$ncolors" ]] && [[ "$ncolors" -ge 8 ]] && [[ -z "$option_r" ]]; then 157 | colored 158 | else 159 | uncolored 160 | fi 161 | else 162 | uncolored 163 | fi 164 | 165 | ## Set the necessary variables for standup 166 | SINCE="yesterday" 167 | MAXDEPTH=2 168 | INCLUDE_LINKS= 169 | RAN_FROM_DIR=$(pwd) 170 | REPORT_FILE_PATH="${RAN_FROM_DIR}/git-standup-report.txt" 171 | STAT= 172 | 173 | # If report is to be generated, remove the existing report file if any 174 | if [[ -n $option_r ]]; then 175 | rm -rf "${REPORT_FILE_PATH}" 176 | fi 177 | 178 | if [[ ${option_m:=} ]]; then 179 | MAXDEPTH="$((${option_m:=} + 1))" 180 | fi 181 | 182 | if [[ ${option_L:=} ]]; then 183 | INCLUDE_LINKS="-L" 184 | fi 185 | 186 | if [[ ${option_c:=} ]]; then 187 | STAT="--stat" 188 | fi 189 | 190 | ## If -d flag is there, use its value for the since 191 | if [[ ${option_d:=} ]] && [[ $option_d -ne 0 ]]; then 192 | SINCE="$option_d days ago" 193 | else 194 | ## -d flag is not there, go on with the normal processing 195 | WEEKSTART="$(cut -d '-' -f 1 <<< "${option_:=w}")" 196 | WEEKSTART=${WEEKSTART:="Mon"} 197 | 198 | WEEKEND="$(cut -d '-' -f 2 <<< "${option_w:=}")" 199 | WEEKEND=${WEEKEND:="Fri"} 200 | 201 | ## In case it is the start of week, we need to 202 | ## show the commits since the last weekend 203 | shopt -s nocasematch 204 | if [[ ${WEEKSTART} == "$(date +%a)" ]]; then 205 | SINCE="last $WEEKEND" 206 | fi 207 | fi 208 | 209 | ## If -u flag is there, use its value for the until 210 | if [[ ${option_u:=} ]] && [[ $option_u -ne 0 ]]; then 211 | UNTIL_OPT="--until=\"$option_u days ago\"" 212 | elif [[ ${option_B:=} ]]; then 213 | UNTIL_OPT="--until=\"$option_B\"" 214 | fi 215 | 216 | if [[ ${option_A:=} ]]; then 217 | AFTER_OPT="--after=\"$option_A\"" 218 | fi 219 | 220 | GIT_DATE_FORMAT=${option_D:-relative} 221 | 222 | # For when the command has been run in a non-repo directory 223 | if [[ ${option_F:=} || ! -d ".git" || -f ".git" ]]; then 224 | BASE_DIR=$(pwd) 225 | # Set delimiter to newline for the loop 226 | IFS=$'\n' 227 | 228 | if [[ -f ".git-standup-whitelist" ]]; then 229 | SEARCH_PATH=$(cat .git-standup-whitelist) 230 | else 231 | SEARCH_PATH=. 232 | fi 233 | 234 | # Recursively search for git repositories 235 | PROJECT_DIRS=$(find ${INCLUDE_LINKS} ${SEARCH_PATH} -maxdepth ${MAXDEPTH} -mindepth 0 -name .git) 236 | elif [[ -f ".git" || -d ".git" ]]; then 237 | PROJECT_DIRS=("$(pwd)/.git") 238 | fi 239 | 240 | # if project directories is still empty 241 | # we might be sitting inside a git repo 242 | if [[ -z ${PROJECT_DIRS} ]]; then 243 | ROOT_DIR_COMMAND="git rev-parse --show-toplevel" 244 | PROJECT_ROOT=$(eval "${ROOT_DIR_COMMAND}" 2> /dev/null) 245 | 246 | if [[ -z ${PROJECT_ROOT} ]]; then 247 | echo "${YELLOW}You must be inside a git repository!${NORMAL}" 248 | exit 0 249 | fi 250 | 251 | PROJECT_DIRS=("${PROJECT_ROOT}/.git") 252 | fi 253 | 254 | # Foreach of the project directories, run the standup 255 | IFS=$'\n' 256 | for DIR in ${PROJECT_DIRS}; do 257 | PROJECT_DIR=$(dirname "$DIR") 258 | cd "$PROJECT_DIR" || exit 259 | CUR_DIR=$(pwd) 260 | BASENAME=$(basename "$CUR_DIR") 261 | 262 | # continue if not a git directory 263 | if [[ ! -d ".git" || -f ".git" ]]; then 264 | cd "${BASE_DIR}" || exit 265 | continue 266 | fi 267 | 268 | AUTHOR=$(git config user.name) 269 | 270 | if [[ ${option_a:=} ]]; then 271 | # In case the parameter 272 | if [[ $option_a = 'all' ]]; then 273 | AUTHOR=".*" 274 | else 275 | AUTHOR="$option_a" 276 | fi 277 | fi 278 | 279 | GIT_BRANCH_FILTER="--all" 280 | if [[ ${option_b:=} ]]; then 281 | GIT_BRANCH_FILTER="--first-parent $option_b" 282 | fi 283 | 284 | GIT_LOG_COMMAND="git --no-pager log \ 285 | ${GIT_BRANCH_FILTER} 286 | --no-merges 287 | --since=\"$SINCE\" 288 | ${UNTIL_OPT} 289 | ${AFTER_OPT} 290 | --author=\"$AUTHOR\" 291 | --abbrev-commit 292 | --oneline 293 | --pretty=format:'$GIT_PRETTY_FORMAT' 294 | --date='$GIT_DATE_FORMAT' 295 | --color=$COLOR 296 | ${STAT}" 297 | 298 | runStandup 299 | 300 | cd "${BASE_DIR}" || exit 301 | done 302 | unset IFS 303 | -------------------------------------------------------------------------------- /installer.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ## Clone the repo 4 | git clone https://github.com/kamranahmedse/git-standup.git --depth=1 || { 5 | echo >&2 "Clone failed with $?" 6 | exit 1 7 | } 8 | 9 | cd git-standup || exit 10 | 11 | make install || { 12 | echo >&2 "Clone failed with $?" 13 | exit 1 14 | } 15 | 16 | cd .. 17 | 18 | rm -rf git-standup 19 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "git-standup", 3 | "version": "2.3.2", 4 | "description": "Recall what you did on the last working day. Psst! or be nosy and find what someone else in your team did ;-)", 5 | "main": "", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "bin": { 10 | "git-standup": "./git-standup" 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "git+https://github.com/kamranahmedse/git-standup.git" 15 | }, 16 | "keywords": [ 17 | "git", 18 | "standup" 19 | ], 20 | "author": "Kamran Ahmed", 21 | "license": "MIT", 22 | "bugs": { 23 | "url": "https://github.com/kamranahmedse/git-standup/issues" 24 | }, 25 | "homepage": "https://github.com/kamranahmedse/git-standup#readme" 26 | } 27 | -------------------------------------------------------------------------------- /snap/snapcraft.yaml: -------------------------------------------------------------------------------- 1 | name: git-standup 2 | base: core18 # the base snap is the execution environment for this snap 3 | version: git 4 | summary: Recall what you did on the last working day. 5 | description: | 6 | git-standup by default it gives you the most common usage 7 | i.e. shows you commits from the last working day in the current 8 | directory and the directories below current level plus it comes 9 | with several options to modify how it behaves. 10 | The only requirement is having good commit messages :) 11 | 12 | grade: stable 13 | confinement: strict 14 | 15 | parts: 16 | git-standup: 17 | plugin: nodejs 18 | source: . 19 | stage-packages: 20 | - git 21 | 22 | apps: 23 | git-standup: 24 | command: bin/git-standup 25 | plugs: 26 | - home 27 | - removable-media --------------------------------------------------------------------------------