From 8fed5739771b5e2e61a78438835c2824f309520b Mon Sep 17 00:00:00 2001 From: Everton Marques Date: Mon, 24 Oct 2016 00:49:54 -0200 Subject: [PATCH 1/3] Use of bash specific features. --- git-redate | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 git-redate diff --git a/git-redate b/git-redate old mode 100644 new mode 100755 index b47fb8e..b3621db --- a/git-redate +++ b/git-redate @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash while [[ $# -gt 1 ]] do From abbdbcc8ca0b4504ebce5fd5eda1334bb2457377 Mon Sep 17 00:00:00 2001 From: Everton Marques Date: Mon, 24 Oct 2016 00:54:34 -0200 Subject: [PATCH 2/3] Fix usage of mktemp --- git-redate | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/git-redate b/git-redate index b3621db..850cd62 100755 --- a/git-redate +++ b/git-redate @@ -16,7 +16,13 @@ esac shift done -tmpfile=$(mktemp gitblah) +die () { + echo `basename $0`: >&2 $* + exit 1 +} + +tmpfile=$(mktemp gitblah-XXXX) +[ -f "$tmpfile" ] || die "could not get tmpfile=[$tmpfile]" trap "rm -f $tmpfile" EXIT if [ -n "${COMMITS+set}" ]; From 9bd207d96b930bc19982724176832ed77f276203 Mon Sep 17 00:00:00 2001 From: Everton Marques Date: Mon, 24 Oct 2016 00:59:39 -0200 Subject: [PATCH 3/3] Fix my cumbersome redirect. --- git-redate | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-redate b/git-redate index 850cd62..5040aa6 100755 --- a/git-redate +++ b/git-redate @@ -17,7 +17,7 @@ shift done die () { - echo `basename $0`: >&2 $* + echo >&2 `basename $0`: $* exit 1 }