--- oslo-series-final/0012-guilt-header-more-robust-header-selection.patch +++ oslo-series-v2/v2-0012-guilt-header-more-robust-header-selection.patch @@ -1,7 +1,7 @@ -From 29c4b41dfd9b31f1b990b871162cc422a7ee03f4 Mon Sep 17 00:00:00 2001 +From 26406f63cfcb080e49dcb8df6c8f00ecc5cb16ba Mon Sep 17 00:00:00 2001 From: Per Cederqvist -Date: Wed, 19 Mar 2014 20:24:54 +0100 -Subject: [GUILT 12/28] "guilt header": more robust header selection. +Date: Tue, 13 May 2014 21:03:50 +0200 +Subject: [GUILT v2 12/29] "guilt header": more robust header selection. To: Jeff Sipek Cc: git@vger.kernel.org @@ -21,6 +21,6 @@ Signed-off-by: Per Cederqvist --- - guilt-header | 33 ++++++++++++++++++++++++++++++--- - 1 file changed, 30 insertions(+), 3 deletions(-) + guilt-header | 28 +++++++++++++++++++++++++--- + 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/guilt-header b/guilt-header index 41e00cc..2e96406 100755 --- a/guilt-header +++ b/guilt-header - @@ -45,10 +45,37 @@ esac + @@ -45,10 +45,32 @@ esac [ -z "$patch" ] && die "No patches applied." # check that patch exists in the series [...] +full_series=`get_tmp_file series` +get_full_series > "$full_series" +found_patch= - +while read x - +do - + if [ "$x" = "$patch" ] - + then + +while read x; do + + if [ "$x" = "$patch" ]; then + found_patch="$patch" + break + fi +done < "$full_series" - +if [ -z "$found_patch" ] - +then + +if [ -z "$found_patch" ]; then + TMP_MATCHES=`get_tmp_file series` + grep "$patch" < "$full_series" > "$TMP_MATCHES" + nr=`wc -l < $TMP_MATCHES` - + if [ $nr -gt 1 ] - + then + + if [ $nr -gt 1 ]; then + echo "$patch does not uniquely identify a patch. Did you mean any of these?" >&2 + sed 's/^/ /' "$TMP_MATCHES" >&2 + rm -f "$TMP_MATCHES" + exit 1 - + elif [ $nr -eq 0 ] - + then + + elif [ $nr -eq 0 ]; then + rm -f "$TMP_MATCHES" + die "Patch $patch is not in the series" + fi [...] # FIXME: warn if we're editing an applied patch --