Use git to version control, synchronize and save notes about a git repository:
$HOME/.cache/notes
README.md
.cache/notes/
├── README.md
├── dev
│ ├── alcove
│ │ └── README.md
│ ├── closefrom
│ │ └── README.md
│ ├── embedexe
│ │ └── README.md
│ ├── fchmodexec
│ │ └── README.md
│ ├── hexlog
│ │ └── README.md
│ ├── inert
│ │ └── README.md
│ ├── libproxyproto
│ │ └── README.md
│ ├── librlimit
│ │ └── README.md
│ ├── stdio
│ │ └── README.md
│ ├── verx
│ │ └── README.md
│ └── xmppipe
│ └── README.md
└── work
└── README.md
git init --bare $HOME/.notes
alias notes='/usr/bin/git --git-dir=$HOME/.notes/ --work-tree=$HOME'
tasks() {
local NOTESPATH="$HOME/.cache/notes"
local TASK="$NOTESPATH"
local TASKADD=
local SUBJ="${1-git}"
case "$SUBJ" in
create|new)
if [ "$#" -lt 2 ]; then
echo "task required: create <task>"
return
fi
SUBJ="$2"
if [ -d "$NOTESPATH/dev/$SUBJ" ]; then
echo "task exists: $NOTESPATH/dev/$SUBJ"
return
fi
TASK="$NOTESPATH/dev/$SUBJ"
;;
global|all)
;;
work)
TASK="$HOME/.cache/notes/work"
;;
buy)
TASK="$HOME/.cache/notes/buy"
;;
git)
local GITREPO
GITREPO="$(git rev-parse --show-toplevel 2>/dev/null)"
if [ "$?" -eq 0 ]; then
TASK="$NOTESPATH/dev/$(basename $GITREPO)"
fi
;;
/*)
if [ ! -d "$NOTESPATH/$SUBJ" ]; then
echo "not found: $NOTESPATH/$SUBJ"
return
fi
TASK="$NOTESPATH/$SUBJ"
;;
*)
if [ ! -d "$NOTESPATH/dev/$SUBJ" ]; then
echo "not found: $NOTESPATH/dev/$SUBJ"
return
fi
TASK="$NOTESPATH/dev/$SUBJ"
;;
esac
if [ ! -d "$TASK" ]; then
mkdir -p "$TASK"
TASKADD=1
fi
vi "$TASK/README.md"
if [ "$TASKADD" ]; then
git --git-dir=$HOME/.notes/ --work-tree=$HOME add "$TASK/README.md"
fi
}
notes config --local status.showUntrackedFiles no
notes remote add origin https://git.iscode.ca/msantos/notes
tasks
notes commit -a
notes push
# tasks new <name>
tasks new foo
# tasks <name>
tasks foo
notes commit -a
notes push
git clone --bare https://git.iscode.ca/msantos/notes $HOME/.notes
alias notes='/usr/bin/git --git-dir=$HOME/.notes/ --work-tree=$HOME'
notes config --local status.showUntrackedFiles no
notes -C $HOME/.cache checkout
(markdown)