Giter VIP home page Giter VIP logo

git-standup's Introduction

git-standup

Recall what you did on the last working day ..or be nosy and find what someone else did.

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.

Requirements

The only requirement is having good commit messages :)

Install

You can install git-standup using one of the options listed below

Source Command
curl curl -L https://raw.githubusercontent.com/kamranahmedse/git-standup/master/installer.sh | sudo sh
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

Usage

Simply run it in your project directory and it will give you the output from the last working day

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

You can pass several options to modify how git-standup behaves

git standup [-a <author name>]
            [-w <weekstart-weekend>]
            [-m <max-dir-depth>]
            [-F]
            [-b <branch-to-use>]
            [-d <since-days-ago>]
            [-u <until-days-ago>]
            [-D <date-format>]
            [-A <after-date>]
            [-B <before-date>]
            [-L]
            [-g]
            [-h]
            [-f]
            [-s]
            [-r]
            [-c]
            [-R]

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"
b Specify branch to restrict search to (unset: all branches, "$remote/$branch" to include fetches)
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 specified 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
D Specify the date format for "git log" (default: relative) possible values
A Show the commits till after the given date
B Show the commits till before the given date
h Display the help screen
g Show if commit is GPG signed (G) or not (N)
f Fetch the latest commits beforehand
s Silences the no activity message (useful when running in a directory having many repositories)
c Show diff-stat for every matched commit
r Generates the standup report file git-standup-report.txt in the current directory
R Display the author date instead of the committer date

For the basic usage, all you have to do is run git standup in a repository or a folder containing multiple repositories

Single Repository Usage

To check all your personal commits from last working day, head to the project repository and run

$ git standup

git standup

Multiple Repository Usage

Open a directory having multiple repositories and run

$ git standup

git standup

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.

$ git standup -m 3

Checking someone else's commits

If you want to find out someone else's commits do

# Considering their name on git is "John Doe"
$ git standup -a "John Doe"

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:

git standup -a'^(?!(renovate\[bot\]))'

git standup

Check what every contributor did

If you want to find out someone else's commits do

$ git standup -a "all"

Commits from n days ago

If you would like to show all your/someone else's commits from n days ago, you can do

# Show all my commits from 4 days ago
$ git standup -d 4

# Show all John Doe's commits from 5 days ago
$ git standup -a "John Doe" -d 5

git standup -d 5

Date filters

You can apply the filters on the commits shown. Use -A and -B flags to specify after and before dates

# Show all the commits after October 01, 2018
git standup -A "2018-10-01 00:00"
# Show all the commits till before October 01, 2018
git standup -B "2018-10-01 00:00"
# Show the commits between September 20 and September 30
git standup -A "2018-09-20 00:00:00" -B "2018-09-30 23:59"

Show Diff-stat

Add -c flag to show the diff-stat for each of the commits in standup results

git standup -c

Add -g flag to check the GPG info

$ git standup -g

GPG Info

Specifying the date format

Add -D flag to specify the date format. Default is relative

Please note that it accepts the same format that you could pass while doing git log. For example

$ git standup -D relative
# Or instead of relative, it could be local|default|iso|iso-strict|rfc|short|raw etc

Branch Filter

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.

# Use develop branch for standup
git standup -b develop

Directory whitelisting

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

├── Workspace              # All your projects are here
│   ├── project-a          # Some git repository called project-a
│   ├── project-b          # Some git repository called project-b
│   ├── sketch-files       # Some sketch files
│   ├── mockups            # Some balsamiq mockups
│   └── ...                # etc.
└── ...

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

project-a
project-b

Changing the Weekdays

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.

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

$ git standup -w "SUN-THU"

Fetch commits before showing standup

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.

If you would like to automatically run git fetch --all before printing the standup, you can add the -f flag, as show below

$ git standup -f

Mixing options

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.

# Show all the John Doe's commits from 5 days ago
$ git standup -a "John Doe" -d 5

License

MIT © Kamran Ahmed

git-standup's People

Contributors

apetro avatar apjanke avatar bitboxer avatar brokenthumbs avatar darrarski avatar daveduthie avatar esamattis avatar friederbluemle avatar gamerson avatar golbin avatar guspan-tanadi avatar ivanstegic avatar kamranahmedse avatar kzap avatar lguzzon avatar md5 avatar mijoharas avatar nelhage avatar palerdot avatar pjbaert avatar popey avatar ptrf avatar redbeardcreator avatar rootmos avatar sarbbottam avatar simonrw avatar thekevjames avatar wickynilliams avatar z0rc avatar zoellner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

git-standup's Issues

Incoherent results

When I do git standup, it tells me that I "did nothing." But when I pass a day parameter like git standup -d 2, it returns a commit I made 29 hours ago. I used Homebrew for installation.

Author option seems not to be working in fishshell

Seems that AUTHOR=${1:-"git config user.name"} isn't working correctly in bash-3.2
UPD: sorry, my bad, seems like there's an error with getting someone else's commits for me, but can't quite figure out why. Closing till found additional info

Issue with username with non-ASCII chars

Quick tip if if you Google to here:
This can be workarounded using the flag -a "all"

Hi there,

Thanks for what you did here, is amazing :)

It would seem that if user has strange characters like áéíóúàèìòù (but maybe many others), git standup will not detect the commits properly, throwing the message:

Seems like úsérnámé did nothing!

Best regards

permissions issue

I keep getting this issue when I try to run the plugin on MacOS Sierra. It appears to have installed correctly. I tried a sudo install too.

find: ./.gnupg: Permission denied

unused variables?

Looks like RED, GREEN and BLUE are not being used. Please verify.

Option to filter out certain users

Would it be possible to include options to filter out users? We have a bunch of automated jobs as part of our deployment cycle that ends up polluting the stand-up logs.

Option to do physical day, not 24 hours ago

Thanks for this awesome function.

It would be convenient (not critical) to base the day on the physical day.

Our standups run at 10am and 24 hours ago misses parts of what I did "Yesterday".

Thanks,
Justin

Option to group commits by user

I've just tried the command git standup -a "all" which works brilliantly, but because there are lots of people working on the project I am looking at it's quite confusing who is doing what. It would be nice to have a flag so I can group commits by user

Repositories within repositories

I have a repo within a repo. The parent repository has the child repository in the gitignore.
So if I call git-standup to find the repositories recursively it will just find the parent repositories.

However, thank you for git-standup.

Doesn't work in git submodules

I have a repo that uses git submodules pointing to external git repos. git-standup works in the root/main repo but returns nothing in the submodules. It would be nice to be able to cd into the submodule and run git-standup from there.

-m flag for Directory depth is not working

It seems the -m flag is not working. Maybe because my home directory is itself a git repo?

~
❯ git standup -m 3
Seems like Zeke Sikelianos did nothing!

~
❯ cd zeke 

~/zeke
❯ git standup
/Users/zeke/zeke/count-array-values
a3f45c8 - more node 0.10 backporting (12 hours ago) <Zeke Sikelianos>
fff3927 - node 0.10 :sigh: (12 hours ago) <Zeke Sikelianos>
e8a9be8 - use var (12 hours ago) <Zeke Sikelianos>
88863a3 - add travis (12 hours ago) <Zeke Sikelianos>
8611c1a - it's alive (12 hours ago) <Zeke Sikelianos>
/Users/zeke/zeke/electron-universe
043e2b6 - stuff (22 hours ago) <Zeke Sikelianos>
/Users/zeke/zeke/nice-package
c07f909 - 1.2.1 (21 minutes ago) <Zeke Sikelianos>

Fetch --all command not working (git standup -f)

Documentation on GitHub explains the git standup -f option, but it seems that it is no longer / not yet working:

/Volumes/webdev/www/test(develop) » git standup -f                                                                             
/usr/local/bin/git-standup: illegal option -- f
Use 'git standup -h' to see usage info
------------------------------------------------------------
/Volumes/webdev/www/test(develop) » git standup -h
Usage:
  git standup [-a <author name>] [-w <weekstart-weekend>] [-d <days-ago>] [-m <max-dir-depth>] [-g] [-h]

  -a      - Specify author to restrict search to
  -w      - Specify weekday range to limit search to
  -m      - Specify the depth of recursive directory search
  -d      - Specify the number of days back to include
  -D      - Specify the date format for "git log" (default: relative)
  -h      - Display this help screen
  -g      - Show if commit is GPG signed (G) or not (N)

Examples:
  git standup -a "John Doe" -w "MON-FRI" -m 3

Mac OS X Sierra - Installed via sudo npm install -g

line 37: cd: */: No such file or directory

macbookproloreto:metadata admin$ git standup
/usr/local/bin/git-standup: line 37: cd: */: No such file or directory
macbookproloreto:metadata admin$ vi /usr/local/bin/git-standup:37

Allow different date output

git-standup works fine for standup data but if you want a summary for things that are longer in the past a proper date value would be better.

Perhaps as an option (i.e. optional %ci formatting instead %cr).

Thank you very much and have a nice day!

Run in repo sub-directory

When I run git standup in sub-directory of my repos it shows nothing(no commits or error message), although all default git commands work fine

$WEEKSTART comparison fails on non-English locales.

We have had a few devs at our group being unable to use git-standup on Mondays due to the hardcoded comparison for $WEEKSTART. I've forked the repo and made a quick fix for internal use and was wondering if there may be interest in implementing it upstream as well.

gimi-org/git-standup@c74aa71

I'm fairly new to writing bash scripts with cross-platform compatibility so any sort of feedback would be appreciated. (And yes there is a typo in that commit but that has since been fixed)

show author time insteadof commit time?

Suppose I have a feature branch and have some old commits, then I use git rebase develop to rebase on develop branch. These old commits should not be listed when I git standup.

Option to include reflog entries in search

I pretty regularly amend and rebase commits as I work (I usually use git commit -m "wip" instead of git stash so that it's separated by branch), so it'd be nice to be able to include the --reflog option to git log. :)

I can work on a PR, but thought I'd open the issue first to see what others think.

Specify directory

It would be nice to have possibility to define directory where to check for commits from. I am planning to create small cron job that would convert the output to an HTML page so everyone could see what others did yesterday but now I need some bash magic to get that to work.

Possible issue with accents

Hi Kamra!

I've been using git-standup in the last couple weeks and is awesome. I think there's an issue with the author's name when it contains accents.

When I execute git-standup -a "Aarón García Hervás" (my user.name in my gitconfig) the output is Seems like Aarón García Hervás did nothing!, that's not correct.

When When I execute git-standup -a "[email protected]" (my user.email in my gitconfig) the output is correct.

Thanks!

Support querying 'full' sub directories

While practicing I realized it supported queries for only a single level of sub directory - some of git repos enclosed deeper in my current directory could not be queried out. Would be handy to add 'full' sub directory query support as a new feature.

How to show standup info for everyone at once?

Looking at the readme, I can't find an option where I could see standup info for everyone at once. There are multiple members in the repo and I'd like to check what everyone was doing, at once. Is this possible with current version? If not, could it be considered as a new feature?

`git standup --help`

Would be great to get a quick help file for the command.

$ git help standup
No manual entry for git-standup
$ git standup --help
No manual entry for git-standup

Uncaught error: "cd */: No such file or directory"

Reproducer:

bash-4.3$ mkdir git
bash-4.3$ cd git
bash-4.3$ git init
Initialized empty Git repository in /Users/joe/git/.git/
bash-4.3$ mkdir 1
bash-4.3$ cd 1
bash-4.3$ git standup
/usr/local/bin/git-standup: line 120: cd: */: No such file or directory
bash-4.3$

Allow custom date ranges

Very handy tool, especially run on multiple repositories is very awesome!

It would be nice to have the option to show the logs for a specific date, e.g. for last week monday.

Maybe the easiest solution is passingthrough this git log options:

   --since=<date>, --after=<date>
       Show commits more recent than a specific date.

   --until=<date>, --before=<date>
       Show commits older than a specific date.

Multiple Git Repositories

Multiple Git repositories?

... is it possible to extend the script to scan all sub-directories to automatically search for Git repos and execute this very nice command / tool there?

ignoring certain folder patterns?

It takes a long time to get a report because I have multiple levels of code folders but also many node projects on 1st level, so it spends a lot of time going over node_modules, where I will never have my own git repos.

Any way to exclude certain folders?

Group by branches

First, this is a great utility.

Right now all commits are listed with no hint of branches they're attached to; would be nice to have an option to group them accordingly.

Doesn't work on Ubuntu 15.10

Probably a minor fix. Here's the error.

/usr/local/bin/git-standup: 11: /usr/local/bin/git-standup: Syntax error: redirection unexpected

The shell (/bin/sh) in Ubuntu is dash.

It will work if the first line is changed to:

#!/bin/bash

Feature Request: Show the git history for a specific day

It would be helpful to be able to not show all the commits from n days ago but to show the commits from a day, n days in the past.

For example,

git standup -D 5

could show all the commits you made for the day, 5 days ago.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.