Table of Contents

DESCRIPTION

Use git to version control, synchronize and save notes about a git repository:

.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

INSTALLATION

Initializing The Git Repository

git init --bare $HOME/.notes

~/.profile

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
}

Git Configuration

notes config --local status.showUntrackedFiles no
notes remote add origin https://git.iscode.ca/msantos/notes

Add Notes

Within a Git Repository

tasks
notes commit -a
notes push

Outside a Git Repository

# tasks new <name>
tasks new foo
# tasks <name>
tasks foo
notes commit -a
notes push

SETTING UP A NEW SYSTEM

Clone the notes Git Repo

git clone --bare https://git.iscode.ca/msantos/notes $HOME/.notes

Command Alias

alias notes='/usr/bin/git --git-dir=$HOME/.notes/ --work-tree=$HOME'
notes config --local status.showUntrackedFiles no

Checkout Files

notes -C $HOME/.cache checkout

(markdown)