Skip to content

Instantly share code, notes, and snippets.

@mfurquimdev
Created June 24, 2019 15:27
Show Gist options
  • Select an option

  • Save mfurquimdev/41794005677964c559e49ccc0e8fdce6 to your computer and use it in GitHub Desktop.

Select an option

Save mfurquimdev/41794005677964c559e49ccc0e8fdce6 to your computer and use it in GitHub Desktop.
Script para auxiliar nas OFs
#!/bin/bash
if [ $# != 1 ];
then
echo "Usage: $0 \"Author Name\"";
exit 1;
fi;
remote=$(git remote -v | cut -f 2 | cut -f 1-4 -d "." | head -1);
for c in $(git log --since="1 month ago" --oneline --author="$1" | cut -f1 -d " ");
do
i=0;
echo -e "\n\n################################################################################"
git log -n 1 --pretty="format:[%cD] %C(yellow)%s%Creset%n%b" "$c"
echo -e "################################################################################\n"
echo "Files:"
for a in $(git diff-tree --no-commit-id --numstat -r "$c");
do
case "$i" in
"0") echo -en "(\033[38;1;32m+"; printf "%-3s" $a; echo -en "\033[38;1;0m,";i=1;;
"1") echo -en "\033[38;1;31m-"; printf "%-3s" $a; echo -en "\033[38;1;0m)";i=2;;
"2") echo -e " \033[4;1;22m$remote/blob/$c/$a\033[38;1;0m";i=0;;
esac
done;
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment