From 14323039fe382ad2935b912bde0202d4ffc5221e Mon Sep 17 00:00:00 2001 From: vg Date: Fri, 16 Feb 2018 14:36:19 +0100 Subject: shorter output with git-sync --- scripts/git-sync | 10 +++++++--- 1 file 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" -- cgit v1.2.3