Skip to content

Instantly share code, notes, and snippets.

@zanematthew
Created August 28, 2011 05:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zanematthew/1176265 to your computer and use it in GitHub Desktop.
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.
#!/bin/bash
if [ ${PWD##*/} == task-tracker ]; then
echo `git notes show`
fi
#!/bin/bash
if [ ${PWD##*/} == task-tracker ]; then
echo `git notes show`
fi
# alias cd="cd ; ~/my-script"
@zanematthew
Copy link
Author

@zanematthew
Copy link
Author

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