diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-01 17:03:36 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-01 17:03:36 +1200 |
commit | 010cdbdc0da056ec096e37e18ca730bc3aaa9c95 (patch) | |
tree | db4c25378f57592c363fc8bdf61ec8268fa17081 | |
parent | Add grc(1) (diff) | |
download | dotfiles-010cdbdc0da056ec096e37e18ca730bc3aaa9c95.tar.gz dotfiles-010cdbdc0da056ec096e37e18ca730bc3aaa9c95.zip |
Make jfc(1) into a POSIX sh script
-rwxr-xr-x | bin/jfc | 30 |
1 files changed, 6 insertions, 24 deletions
@@ -1,24 +1,6 @@ -#!/usr/bin/env bash - -# jfc(1) -- Just add everything to a Git repository and quietly commit with a -# stock message - -# Check we have what we need -hash git || exit - -# Detect changes -if ! git diff-index --quiet HEAD ; then - changed=1 -fi - -# Detect untracked files -while read -d '' -r ; do - untracked=1 - break -done < <(git ls-files -z --others --exclude-standard) - -# If either applies, add and commit -if ((changed || untracked)) ; then - git add --all || exit - git commit --message 'Committed by jfc(1)' --quiet || exit -fi +#!/bin/sh +# Commit all changes to a Git repository with a stock message +# message. +grc || exit 0 +git add --all || exit +git commit --message 'Committed by jfc(1)' --quiet || exit |