mu/snapshot_lesson
Kartik K. Agaram 2c53c3d0a9 3789
I accidentally got rid of git snapshotting of lessons back when I switched
to testable file primitives last December (commit 3705).

>:-(

Bringing it back now, hopefully better. The improvement is that there's
now at most one commit every time we hit F4.

This change adds yet another reason that running `mu` from a different
directory is just not supported.
2017-03-12 00:34:02 -08:00

12 lines
358 B
Bash
Executable File

#!/bin/sh
# Hacky little helper called from edit/ and sandbox/ apps to save a snapshot
# of lesson/ using git.
test -d lesson/.git || exit 0 # give up if it's not a git repo
cd lesson
# explicitly say '--all' for git 1.9
git add --all .
# bug in git: git diff -q messes up --exit-code
git diff HEAD --exit-code >/dev/null || git commit -a -m . >/dev/null