Re: [GUILT 17/28] guilt graph no longer loops when no patches are applied.

2014-05-06 Thread Jeff Sipek
Signed-off-by: Josef 'Jeff' Sipek jef...@josefsipek.net

On Fri, Mar 21, 2014 at 08:31:55AM +0100, Per Cederqvist wrote:
 Give an error message if no patches are applied.  Added a test case
 that never terminates unless this fix is applied.
 
 Signed-off-by: Per Cederqvist ced...@opera.com
 ---
  guilt-graph  | 10 --
  regression/t-033.out |  3 +++
  regression/t-033.sh  | 11 +++
  3 files changed, 22 insertions(+), 2 deletions(-)
  create mode 100644 regression/t-033.out
  create mode 100755 regression/t-033.sh
 
 diff --git a/guilt-graph b/guilt-graph
 index b3469dc..00301d5 100755
 --- a/guilt-graph
 +++ b/guilt-graph
 @@ -17,8 +17,14 @@ fi
  
  patchname=$1
  
 -bottom=`git rev-parse refs/patches/$branch/$(head_n 1  $applied)`
 -base=`git rev-parse $bottom^`
 +bottompatch=$(head_n 1  $applied)
 +if [ -z $bottompatch ]
 +then
 + echo No patch applied. 2
 + exit 1
 +fi
 +
 +base=`git rev-parse refs/patches/${branch}/${bottompatch}^`
  
  if [ -z $patchname ]; then
   top=`git rev-parse HEAD`
 diff --git a/regression/t-033.out b/regression/t-033.out
 new file mode 100644
 index 000..76613f9
 --- /dev/null
 +++ b/regression/t-033.out
 @@ -0,0 +1,3 @@
 +% setup_repo
 +% guilt graph
 +No patch applied.
 diff --git a/regression/t-033.sh b/regression/t-033.sh
 new file mode 100755
 index 000..ae40577
 --- /dev/null
 +++ b/regression/t-033.sh
 @@ -0,0 +1,11 @@
 +#!/bin/bash
 +#
 +# Test the graph code
 +#
 +
 +source $REG_DIR/scaffold
 +
 +cmd setup_repo
 +
 +shouldfail guilt graph
 +
 -- 
 1.8.3.1
 

-- 
You measure democracy by the freedom it gives its dissidents, not the
freedom it gives its assimilated conformists.
- Abbie Hoffman
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GUILT 17/28] guilt graph no longer loops when no patches are applied.

2014-03-21 Thread Per Cederqvist
Give an error message if no patches are applied.  Added a test case
that never terminates unless this fix is applied.

Signed-off-by: Per Cederqvist ced...@opera.com
---
 guilt-graph  | 10 --
 regression/t-033.out |  3 +++
 regression/t-033.sh  | 11 +++
 3 files changed, 22 insertions(+), 2 deletions(-)
 create mode 100644 regression/t-033.out
 create mode 100755 regression/t-033.sh

diff --git a/guilt-graph b/guilt-graph
index b3469dc..00301d5 100755
--- a/guilt-graph
+++ b/guilt-graph
@@ -17,8 +17,14 @@ fi
 
 patchname=$1
 
-bottom=`git rev-parse refs/patches/$branch/$(head_n 1  $applied)`
-base=`git rev-parse $bottom^`
+bottompatch=$(head_n 1  $applied)
+if [ -z $bottompatch ]
+then
+   echo No patch applied. 2
+   exit 1
+fi
+
+base=`git rev-parse refs/patches/${branch}/${bottompatch}^`
 
 if [ -z $patchname ]; then
top=`git rev-parse HEAD`
diff --git a/regression/t-033.out b/regression/t-033.out
new file mode 100644
index 000..76613f9
--- /dev/null
+++ b/regression/t-033.out
@@ -0,0 +1,3 @@
+% setup_repo
+% guilt graph
+No patch applied.
diff --git a/regression/t-033.sh b/regression/t-033.sh
new file mode 100755
index 000..ae40577
--- /dev/null
+++ b/regression/t-033.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+#
+# Test the graph code
+#
+
+source $REG_DIR/scaffold
+
+cmd setup_repo
+
+shouldfail guilt graph
+
-- 
1.8.3.1

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html