bashcontrib/note-on-modification -rwxr-xr-x 525 B
1#!/bin/bash
2# This is an example script that can be used in conjunction with the
3# on_modification config option to commit every note change to a git
4# repository. You'll need to place it somewhere on your $PATH. This
5# script assumes that your state_dir is also a git repository.
6set -e
7
8COMMIT_MESSAGE="automated commit ($HOSTNAME)"
9
10STATE_DIR="$(note config get state_dir)"
11GIT_DIR="$STATE_DIR/.git"
12WORK_DIR="$STATE_DIR"
13GIT="git --git-dir=$GIT_DIR --work-tree=$WORK_DIR"
14
15$GIT add --all
16$GIT commit -m "$COMMIT_MESSAGE"