aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvg <vg@devys.org>2018-02-16 14:36:19 +0100
committervg <vg@devys.org>2018-02-16 14:36:19 +0100
commit14323039fe382ad2935b912bde0202d4ffc5221e (patch)
tree82103a54ddc47a8774e9b49faea48a337b76e9dc
parentdadd116a7ebcc5090be76086ad386a0b0f88460a (diff)
downloadscripts-14323039fe382ad2935b912bde0202d4ffc5221e.tar.gz
scripts-14323039fe382ad2935b912bde0202d4ffc5221e.tar.bz2
scripts-14323039fe382ad2935b912bde0202d4ffc5221e.zip
shorter output with git-sync
-rwxr-xr-xscripts/git-sync10
1 files changed, 7 insertions, 3 deletions
diff --git a/scripts/git-sync b/scripts/git-sync
index deb19bc..10fc0c5 100755
--- a/scripts/git-sync
+++ b/scripts/git-sync
@@ -1,5 +1,5 @@
#!/bin/bash
-set -e
+set -eu
hosthash=$(python3 -c "import uuid, hashlib
print(hashlib.new('sha1', str(uuid.getnode()).encode('utf8')).hexdigest())")
@@ -32,7 +32,9 @@ fi
echo 'Sync: git autocommit'
git add -A "./$(git rev-parse --show-cdup)"
-git commit -m "Auto-commit on ${hosthash}" >/dev/null 2>&1 || true
+if git commit --dry-run --short; then
+ git commit -m "Auto-commit on ${hosthash}"
+fi
echo 'Sync: fetch and merge'
@@ -62,7 +64,9 @@ git status --porcelain | while read -r filename; do
done
# no action is done if there is nothing to commit
-git commit -m "$conflict_message" || true
+if git commit --dry-run --short; then
+ git commit -m "$conflict_message"
+fi
# should not fail again
git merge -m "$conflict_message"