Skip to content

Instantly share code, notes, and snippets.

@attacker34
Forked from EdOverflow/gitgrepper
Created April 28, 2018 10:04
Show Gist options
  • Select an option

  • Save attacker34/ad58590b38d60c10bd3232a50c7fde86 to your computer and use it in GitHub Desktop.

Select an option

Save attacker34/ad58590b38d60c10bd3232a50c7fde86 to your computer and use it in GitHub Desktop.

Revisions

  1. @EdOverflow EdOverflow created this gist Apr 19, 2018.
    27 changes: 27 additions & 0 deletions gitgrepper
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,27 @@
    #!/bin/bash

    echo "*** Running..."

    keywords=(
    "password"
    "key"
    "passwd"
    "secret"
    )

    echo
    echo "Developers"
    echo "=========="
    if [[ $1 != "" ]]; then
    git log --reflog --pretty="format:%aE" | sort | uniq | grep "$1"
    fi

    echo
    echo "Keywords"
    echo "========"
    for word in ${keywords[@]}; do
    git log --reflog --pretty="format:- (%H) %b" | grep --color "$word"
    done

    echo
    echo "*** Done."