Created
August 28, 2011 05:05
-
-
Save zanematthew/1176265 to your computer and use it in GitHub Desktop.
When entering a directory show the last entered notes that are in Git. This is used as a quick reminder for a forgetful programmer.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ ${PWD##*/} == task-tracker ]; then | |
echo `git notes show` | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ ${PWD##*/} == task-tracker ]; then | |
echo `git notes show` | |
fi | |
# alias cd="cd ; ~/my-script" |
Also this is were in a git repo
ttt=$(pwd | awk -F/ '{ for (i=2; i<NF; i++) printf $i " " ; print $NF }')
tryDir=""
tryGit=""
foundPath=0
for i in $ttt ; do
tryDir="${tryDir}/${i}"
tryGit="${tryDir}/.git"
if [ -d $tryGit ]; then
outDir="${tryDir}/$1"
echo "Woosh... (${outDir})"
cd $outDir
foundPath=1
fi
done
if [ "$foundPath" == 0 ] ; then
echo "Sorry bro... you're not in a git repo."
fi
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Also check this out later: http://www.talug.org/events/20030813/cmdline_tips_n_tricks_aug03.html