* [SGIT PATCH 0/3] Assorted fixes
@ 2007-06-06 22:01 Yann Dirson
2007-06-06 22:01 ` [PATCH 1/3] Robustify rebase test: check patches are reapplied Yann Dirson
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Yann Dirson @ 2007-06-06 22:01 UTC (permalink / raw)
To: Catalin Marinas; +Cc: git
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 <ydirson@altern.org> |
Debian-related: <dirson@debian.org> | Support Debian GNU/Linux:
| Freedom, Power, Stability, Gratis
http://ydirson.free.fr/ | Check <http://www.debian.org/>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/3] Robustify rebase test: check patches are reapplied.
2007-06-06 22:01 [SGIT PATCH 0/3] Assorted fixes Yann Dirson
@ 2007-06-06 22:01 ` Yann Dirson
2007-06-10 8:40 ` Karl Hasselström
2007-06-06 22:01 ` [PATCH 2/3] Catch early trying rebasing to unknown ref, and add testcase Yann Dirson
2007-06-06 22:01 ` [PATCH 3/3] Fixed typo in contrib/stg-whatchanged Yann Dirson
2 siblings, 1 reply; 5+ messages in thread
From: Yann Dirson @ 2007-06-06 22:01 UTC (permalink / raw)
To: Catalin Marinas; +Cc: git
Signed-off-by: Yann Dirson <ydirson@altern.org>
---
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/3] Catch early trying rebasing to unknown ref, and add testcase.
2007-06-06 22:01 [SGIT PATCH 0/3] Assorted fixes Yann Dirson
2007-06-06 22:01 ` [PATCH 1/3] Robustify rebase test: check patches are reapplied Yann Dirson
@ 2007-06-06 22:01 ` Yann Dirson
2007-06-06 22:01 ` [PATCH 3/3] Fixed typo in contrib/stg-whatchanged Yann Dirson
2 siblings, 0 replies; 5+ messages in thread
From: Yann Dirson @ 2007-06-06 22:01 UTC (permalink / raw)
To: Catalin Marinas; +Cc: git
Signed-off-by: Yann Dirson <ydirson@altern.org>
---
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/3] Fixed typo in contrib/stg-whatchanged.
2007-06-06 22:01 [SGIT PATCH 0/3] Assorted fixes Yann Dirson
2007-06-06 22:01 ` [PATCH 1/3] Robustify rebase test: check patches are reapplied Yann Dirson
2007-06-06 22:01 ` [PATCH 2/3] Catch early trying rebasing to unknown ref, and add testcase Yann Dirson
@ 2007-06-06 22:01 ` Yann Dirson
2 siblings, 0 replies; 5+ messages in thread
From: Yann Dirson @ 2007-06-06 22:01 UTC (permalink / raw)
To: Catalin Marinas; +Cc: git
Signed-off-by: Yann Dirson <ydirson@altern.org>
---
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"
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/3] Robustify rebase test: check patches are reapplied.
2007-06-06 22:01 ` [PATCH 1/3] Robustify rebase test: check patches are reapplied Yann Dirson
@ 2007-06-10 8:40 ` Karl Hasselström
0 siblings, 0 replies; 5+ messages in thread
From: Karl Hasselström @ 2007-06-10 8:40 UTC (permalink / raw)
To: Yann Dirson; +Cc: Catalin Marinas, git
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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-06-10 8:41 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-06 22:01 [SGIT PATCH 0/3] Assorted fixes Yann Dirson
2007-06-06 22:01 ` [PATCH 1/3] Robustify rebase test: check patches are reapplied Yann Dirson
2007-06-10 8:40 ` Karl Hasselström
2007-06-06 22:01 ` [PATCH 2/3] Catch early trying rebasing to unknown ref, and add testcase Yann Dirson
2007-06-06 22:01 ` [PATCH 3/3] Fixed typo in contrib/stg-whatchanged Yann Dirson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).