Re: [PATCH v3 2/2] git-svn.perl: keep processing all commits in parents_exclude

2012-08-19 Thread Eric Wong
Steven Walter stevenrwal...@gmail.com wrote:
 On Sat, Aug 18, 2012 at 3:51 PM, Sam Vilain s...@vilain.net wrote:
  On 08/11/2012 10:14 AM, Steven Walter wrote:
  ---
git-svn.perl |1 -
t/t9164-git-svn-fetch-merge-branch-of-branch2.sh |   53
  ++

Thanks all.

Steven: This doesn't apply cleanly to master since git-svn.perl is
split into separate files (git-svn.perl - perl/Git/SVN*)

Can you rebase against Junio's current master?  Thanks again.
--
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


Re: [PATCH v3 2/2] git-svn.perl: keep processing all commits in parents_exclude

2012-08-18 Thread Sam Vilain

On 08/11/2012 10:14 AM, Steven Walter wrote:

This fixes a bug where git finds the incorrect merge parent.  Consider a
repository with trunk, branch1 of trunk, and branch2 of branch1.
Without this change, git interprets a merge of branch2 into trunk as a
merge of branch1 into trunk.

Signed-off-by: Steven Walter stevenrwal...@gmail.com
---
  git-svn.perl |1 -
  t/t9164-git-svn-fetch-merge-branch-of-branch2.sh |   53 ++
  2 files changed, 53 insertions(+), 1 deletion(-)
  create mode 100755 t/t9164-git-svn-fetch-merge-branch-of-branch2.sh

diff --git a/git-svn.perl b/git-svn.perl
index abcec11..c4678c1 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -3623,7 +3623,6 @@ sub parents_exclude {
if ( $commit eq $excluded ) {
push @excluded, $commit;
$found++;
-   last;
}


I could believe that, too.  I like this change: one line of code, 53 
lines of test and a paragraph of explanation :-).


Cheers,
Sam.
--
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


Re: [PATCH v3 2/2] git-svn.perl: keep processing all commits in parents_exclude

2012-08-18 Thread Steven Walter
On Sat, Aug 18, 2012 at 3:51 PM, Sam Vilain s...@vilain.net wrote:
 On 08/11/2012 10:14 AM, Steven Walter wrote:

 This fixes a bug where git finds the incorrect merge parent.  Consider a
 repository with trunk, branch1 of trunk, and branch2 of branch1.
 Without this change, git interprets a merge of branch2 into trunk as a
 merge of branch1 into trunk.

 Signed-off-by: Steven Walter stevenrwal...@gmail.com
 ---
   git-svn.perl |1 -
   t/t9164-git-svn-fetch-merge-branch-of-branch2.sh |   53
 ++
   2 files changed, 53 insertions(+), 1 deletion(-)
   create mode 100755 t/t9164-git-svn-fetch-merge-branch-of-branch2.sh

 diff --git a/git-svn.perl b/git-svn.perl
 index abcec11..c4678c1 100755
 --- a/git-svn.perl
 +++ b/git-svn.perl
 @@ -3623,7 +3623,6 @@ sub parents_exclude {
 if ( $commit eq $excluded ) {
 push @excluded, $commit;
 $found++;
 -   last;
 }


 I could believe that, too.  I like this change: one line of code, 53 lines
 of test and a paragraph of explanation :-).

How about a Signed-Off-By?
-- 
-Steven Walter stevenrwal...@gmail.com
--
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


Re: [PATCH v3 2/2] git-svn.perl: keep processing all commits in parents_exclude

2012-08-18 Thread Sam Vilain

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

On 08/18/2012 01:43 PM, Steven Walter wrote:
 How about a Signed-Off-By?

Signed-Off-By: Sam Vilain s...@vilain.net

Sam

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)

iQEcBAEBCgAGBQJQMCcnAAoJEBdtaL3wGtIoJ1UIAIJ6Xz5OEMmMk1tq546eggHg
I+sJIFjqg+mo53VqT0/bKhqg8sLx8F/Gda15nwOUMcslKJdA+sCc+QhAtgSWJ1WK
Idw59jtZHbabfopBHNgneSqVBhXSKpNw3e3EvlRVkK1wobO0+c0X6YkBG0eBCZl2
6RYXIAb6jX04k1hSrnxcPn+REkoyl31aEuFBPNz0wRWHjju+G6bPY/x7D/gO1YOc
/uRQXveQngJOLwawDR+dGS+0aWPseX/sbZqsVFo0hVQYqoHt+s4uVuriBfHSRKd+
R1eUoY0ikW4UvEwZX74Zf3SeoVLLFnkCW8B5XsGb10IojbvY3uyYevATXI79j1Y=
=Lb7H
-END PGP SIGNATURE-

--
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


Re: [PATCH v3 2/2] git-svn.perl: keep processing all commits in parents_exclude

2012-08-18 Thread Junio C Hamano
Sam Vilain s...@vilain.net writes:

 On 08/18/2012 01:43 PM, Steven Walter wrote:
   How about a Signed-Off-By?

 Signed-Off-By: Sam Vilain s...@vilain.net

I think you meant reviewed-by or acked-by?
--
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


[PATCH v3 2/2] git-svn.perl: keep processing all commits in parents_exclude

2012-08-11 Thread Steven Walter
This fixes a bug where git finds the incorrect merge parent.  Consider a
repository with trunk, branch1 of trunk, and branch2 of branch1.
Without this change, git interprets a merge of branch2 into trunk as a
merge of branch1 into trunk.

Signed-off-by: Steven Walter stevenrwal...@gmail.com
---
 git-svn.perl |1 -
 t/t9164-git-svn-fetch-merge-branch-of-branch2.sh |   53 ++
 2 files changed, 53 insertions(+), 1 deletion(-)
 create mode 100755 t/t9164-git-svn-fetch-merge-branch-of-branch2.sh

diff --git a/git-svn.perl b/git-svn.perl
index abcec11..c4678c1 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -3623,7 +3623,6 @@ sub parents_exclude {
if ( $commit eq $excluded ) {
push @excluded, $commit;
$found++;
-   last;
}
else {
push @new, $commit;
diff --git a/t/t9164-git-svn-fetch-merge-branch-of-branch2.sh 
b/t/t9164-git-svn-fetch-merge-branch-of-branch2.sh
new file mode 100755
index 000..af0ec0e
--- /dev/null
+++ b/t/t9164-git-svn-fetch-merge-branch-of-branch2.sh
@@ -0,0 +1,53 @@
+#!/bin/sh
+#
+# Copyright (c) 2012 Steven Walter
+#
+
+test_description='git svn merge detection'
+. ./lib-git-svn.sh
+
+svn_ver=$(svn --version --quiet)
+case $svn_ver in
+0.* | 1.[0-4].*)
+   skip_all=skipping git-svn test - SVN too old ($svn_ver)
+   test_done
+   ;;
+esac
+
+test_expect_success 'initialize source svn repo' '
+   svn_cmd mkdir -m x $svnrepo/trunk 
+   svn_cmd mkdir -m x $svnrepo/branches 
+   svn_cmd co $svnrepo/trunk $SVN_TREE 
+   (
+   cd $SVN_TREE 
+   touch foo 
+   svn_cmd add foo 
+   svn_cmd commit -m initial commit 
+   svn_cmd cp -m branch $svnrepo/trunk 
$svnrepo/branches/branch1 
+   svn_cmd switch $svnrepo/branches/branch1 
+   touch bar 
+   svn_cmd add bar 
+   svn_cmd commit -m branch1 
+   svn_cmd cp -m branch $svnrepo/branches/branch1 
$svnrepo/branches/branch2 
+   svn_cmd switch $svnrepo/branches/branch2 
+   touch baz 
+   svn_cmd add baz 
+   svn_cmd commit -m branch2 
+   svn_cmd switch $svnrepo/trunk 
+   svn_cmd merge --reintegrate $svnrepo/branches/branch2 
+   svn_cmd commit -m merge branch2
+   ) 
+   rm -rf $SVN_TREE
+'
+
+test_expect_success 'clone svn repo' '
+   git svn init -s $svnrepo 
+   git svn fetch
+'
+
+test_expect_success 'verify merge commit' 'x=$(git rev-parse HEAD^2) 
+   y=$(git rev-parse branch2) 
+   test x$x = x$y
+'
+
+test_done
-- 
1.7.9.5

--
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