jmou/zit
git clone https://github.com/jmou/zit.git
git clone git@github.com:jmou/zit.git
Loading…
(top)/commit
language: Shell
338 Bytes / 11 lines / 10 loc
History
View raw
#!/bin/bash -e

if [[ -f .zit/$(symbolic-ref HEAD) ]]; then # for non-initial commit
    parents='-p HEAD'
fi
echo '# write a commit message' > .zit/COMMIT_EDITMSG
${EDITOR-vi} .zit/COMMIT_EDITMSG
tree=$(write-tree)
commit=$(grep -v '^#' .zit/COMMIT_EDITMSG | commit-tree $tree $parents)
update-ref HEAD $commit
rm -f .zit/COMMIT_EDITMSG