summaryrefslogtreecommitdiff
path: root/bin/doccheckin
blob: 29046f8be27a1371daec7ccf626be11217563172 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh

set -e
cd ~/doc/

# This is a shell script in my crontab rather than an Emacs timer because we
# also want to use it as the myrepos autoci action for ~/doc/.

# If emacs is running, try to save all ~/doc/ buffers.
[ -n "$LOGNAME" ] && pgrep -u "$LOGNAME" emacs >/dev/null \
    && emacsclient --eval '(spw/save-my-doc-buffers)'

# don't do anything if waiting on a manual merge; don't want just
# blanket commit that merge
[ -z "$(git ls-files --unmerged)" ] || exit 0

# this command should never fail and stop mr
git add howm/*.org howm/*/*.org \
    papers/*.org papers/*.md papers/*.bib \
    newpapers/*/*.org \
    dissert/*.md pres/*.md letters/*.tex \
    emacs-abbrevs emacs-bookmarks News/* \
    emacs-diary archive/emacs-diary-* \
    || true

# this command should never fail and stop mr
git commit -a -m "auto commit on $(hostname -s)" || true