[SGIT PATCH 0/3] Assorted fixes

STALE3709d

5 messages, 2 authors, 2016-06-15 · open the first message on its own page

[SGIT PATCH 0/3] Assorted fixes

From: Yann Dirson <hidden>
Date: 2016-06-15 22:43:14

This fixes the issue reported by Andrey Borzenkov, and robustifies
another testcase to catch any similar issue.

Also updates stg-whatchanged, which for some reason had been left
broken.

-- 
Yann Dirson    [off-list ref] |
Debian-related: [off-list ref] |   Support Debian GNU/Linux:
                                    |  Freedom, Power, Stability, Gratis
     http://ydirson.free.fr/        | Check <http://www.debian.org/>

[PATCH 1/3] Robustify rebase test: check patches are reapplied.

From: Yann Dirson <hidden>
Date: 2016-06-15 22:43:14

Signed-off-by: Yann Dirson <redacted>

---

 t/t2200-rebase.sh |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/t/t2200-rebase.sh b/t/t2200-rebase.sh
index 52462dd..882572c 100755
--- a/t/t2200-rebase.sh
+++ b/t/t2200-rebase.sh
@@ -27,7 +27,8 @@ test_expect_success \
 	'Rebase to previous commit' \
 	'
 	stg rebase master~1 &&
-	test `stg id base@stack` = `git rev-parse master~1`
+	test `stg id base@stack` = `git rev-parse master~1` &&
+	test `stg applied | wc -l` = 1
 	'
 
 test_done

[PATCH 2/3] Catch early trying rebasing to unknown ref, and add testcase.

From: Yann Dirson <hidden>
Date: 2016-06-15 22:43:14

Signed-off-by: Yann Dirson <redacted>

---

 stgit/commands/rebase.py |    4 ++++
 t/t2200-rebase.sh        |   12 ++++++++++++
 2 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/stgit/commands/rebase.py b/stgit/commands/rebase.py
index d132b60..2f0e660 100644
--- a/stgit/commands/rebase.py
+++ b/stgit/commands/rebase.py
@@ -52,6 +52,10 @@ def func(parser, options, args):
     check_conflicts()
     check_head_top_equal()
 
+    # ensure an exception is raised before popping on non-existent target
+    if git_id(args[0]) == None:
+        raise GitException, 'Unknown revision: %s' % git_id
+        
     applied = prepare_rebase(real_rebase=True, force=options.force)
     rebase(args[0])
     post_rebase(applied, options.nopush, options.merged)
diff --git a/t/t2200-rebase.sh b/t/t2200-rebase.sh
index 882572c..c142e08 100755
--- a/t/t2200-rebase.sh
+++ b/t/t2200-rebase.sh
@@ -31,4 +31,16 @@ test_expect_success \
 	test `stg applied | wc -l` = 1
 	'
 
+test_expect_failure \
+	'Attempt rebase to non-existing commit' \
+	'
+	stg rebase not-a-ref
+	'
+
+test_expect_success \
+	'Check patches were re-applied' \
+	'
+	test $(stg applied | wc -l) = 1
+	'
+
 test_done

[PATCH 3/3] Fixed typo in contrib/stg-whatchanged.

From: Yann Dirson <hidden>
Date: 2016-06-15 22:43:14

Signed-off-by: Yann Dirson <redacted>

---

 contrib/stg-whatchanged |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/contrib/stg-whatchanged b/contrib/stg-whatchanged
index f80d0a1..d5b6965 100755
--- a/contrib/stg-whatchanged
+++ b/contrib/stg-whatchanged
@@ -23,7 +23,7 @@ fi
 
 # Merges via "push" leave top=bottom so we must look at old patch
 # in this case (unlike, eg., "pick --fold")
-patchdir="$(git-rev-parse --git-dir)/patches/$(stg branch)/$(stg top)"
+patchdir="$(git-rev-parse --git-dir)/patches/$(stg branch)/patches/$(stg top)"
 if [ $(cat "$patchdir/bottom") = $(cat "$patchdir/top") ];
 then
     current_cmd="stg show //top.old"

Re: [PATCH 1/3] Robustify rebase test: check patches are reapplied.

From: Karl Hasselström <hidden>
Date: 2016-06-15 22:43:15

On 2007-06-07 00:01:42 +0200, Yann Dirson wrote:
+	test `stg applied | wc -l` = 1
Unimportant note: I believe "stg applied" has a -c (count) flag for
precisely this purpose.

-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help