{"thread":{"id":"36883","subject":"git rebase --skip stuck in a loop","startedAt":"2014-06-10T18:57:32Z","lastAt":"2014-06-16T20:31:59Z","messageCount":9,"participants":["Phillip Susi","brian m. carlson","Jeff King","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"243758","messageId":"5397551C.4030709@ubuntu.com","threadId":"36883","inReplyTo":null,"subject":"git rebase --skip stuck in a loop","fromName":"Phillip Susi","fromEmail":"psusi@ubuntu.com","sentAt":"2014-06-10T18:57:32Z","receivedAt":"2014-06-10T18:57:32Z","isPatch":false,"sender":{"key":"psusi@ubuntu.com","avatar":null},"body":"-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA1\n\nI'm in the middle of a long rebase and have had no trouble with git rebase --skip several times, but now it has become stuck:\n\npsusi@devserv:~/parted.git$ git rebase --skip\nAuto-merging libparted/arch/linux.c\nCONFLICT (content): Merge conflict in libparted/arch/linux.c\n\nWhen you have resolved this problem, run \"git rebase --continue\".\nIf you prefer to skip this patch, run \"git rebase --skip\" instead.\nTo check out the original branch and stop rebasing, run \"git rebase --abort\".\n\npsusi@devserv:~/parted.git$ cat .git/rebase-merge/msgnum\n17\n\nEach time I try to skip, it just keeps trying to reapply this one patch.  Any ideas?\n\ngit version 1.9.1\n\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v2.0.17 (MingW32)\nComment: Using GnuPG with Thunderbird - http://www.enigmail.net/\n\niQEcBAEBAgAGBQJTl1UcAAoJEI5FoCIzSKrwwHIH/38Cm19zg+37zgckLiy/3GhN\n3Gmil5kX+3KkIHCxlPz3Ti3xCA5baM7tDzFdDIKcx8N/i8oALgWeAWf1Euy9Ww1K\n3etIAMKzO463kmV7UbgSbLz5DpYWSaGo9WiYAC7xklhQV94w1Ainx5Lo4kRv1Wfj\nR9TpQgViFnW2gNJv1zw0qHLXk1/h88LlAQsBaaY6I4f/DOLhAte7rGinkTgZtjmo\nG/9PUMudQcehG65ITPlNLtoFsM8UHadNMLwJts/B7Yq23XNyRF50IaT8c1A/irSU\nmfYqdHCho3D4kq+k0u+t0Z0bj6pfvo4b0khLafrYLrWGHC5K+Z3lE63ysJ/Mdj8=\n=LZ9q\n-----END PGP SIGNATURE-----\n"},{"id":"244033","messageId":"539A151C.50307@ubuntu.com","threadId":"36883","inReplyTo":"5397551C.4030709@ubuntu.com","subject":"Re: git rebase --skip stuck in a loop","fromName":"Phillip Susi","fromEmail":"psusi@ubuntu.com","sentAt":"2014-06-12T21:01:16Z","receivedAt":"2014-06-12T21:01:16Z","isPatch":false,"sender":{"key":"psusi@ubuntu.com","avatar":null},"body":"-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA1\n\nSo nobody has any ideas on what to check for or how to debug this?\n\nOn 6/10/2014 2:57 PM, Phillip Susi wrote:\n> I'm in the middle of a long rebase and have had no trouble with\n> git rebase --skip several times, but now it has become stuck:\n> \n> psusi@devserv:~/parted.git$ git rebase --skip Auto-merging\n> libparted/arch/linux.c CONFLICT (content): Merge conflict in\n> libparted/arch/linux.c\n> \n> When you have resolved this problem, run \"git rebase --continue\". \n> If you prefer to skip this patch, run \"git rebase --skip\" instead. \n> To check out the original branch and stop rebasing, run \"git\n> rebase --abort\".\n> \n> psusi@devserv:~/parted.git$ cat .git/rebase-merge/msgnum 17\n> \n> Each time I try to skip, it just keeps trying to reapply this one \n> patch.  Any ideas?\n> \n> git version 1.9.1\n> \n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v2.0.17 (MingW32)\nComment: Using GnuPG with Thunderbird - http://www.enigmail.net/\n\niQEcBAEBAgAGBQJTmhUcAAoJEI5FoCIzSKrwkjgIAKOclhuJPiNoWIEv1dBr4DBC\nIdwG9hY8lQPCN5Pg8th5CYk3ziX7iZ8+jaHEBaUYX2yehT1deg5WfsxU0uezWphH\nJyHMRX4kk7l1PW3/v3bEvZ0WYe77s4GB3m9XegjKwEL8xtGi7srEPsHgWB8gnFzE\nhswUMbq5mw9hoIpYnxEs18F2MOfP6i4J3gTilPrmq+hZCQyZrX/IsV5lR6kDXRES\nj7b3cr6n2EfUeWxKrwo+tMIBdGAgpMamWlzqM7gMND/YUswv84mD3b9lXjEfjqZf\nGfBXJSH/z0KLDKycYrDOZlryLEnx///N6STg2WGm0oo7ehAKn6Mtgi1rR5y/aYs=\n=bUQV\n-----END PGP SIGNATURE-----\n"},{"id":"244046","messageId":"20140613010256.GD368384@vauxhall.crustytoothpaste.net","threadId":"36883","inReplyTo":"539A151C.50307@ubuntu.com","subject":"Re: git rebase --skip stuck in a loop","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2014-06-13T01:02:56Z","receivedAt":"2014-06-13T01:02:56Z","isPatch":false,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On Thu, Jun 12, 2014 at 05:01:16PM -0400, Phillip Susi wrote:\n> So nobody has any ideas on what to check for or how to debug this?\n\nI'm assuming this works in the general case, because we have tests for\nit.  Do you perhaps have a repository and a set of reproduction steps we\ncould use to try to reproduce this?\n\nIf you can get that information, I'm interested in trying to fix it.\n\n-- \nbrian m. carlson / brian with sandals: Houston, Texas, US\n+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only\nOpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187\n"},{"id":"244047","messageId":"539A50F2.40206@ubuntu.com","threadId":"36883","inReplyTo":"20140613010256.GD368384@vauxhall.crustytoothpaste.net","subject":"Re: git rebase --skip stuck in a loop","fromName":"Phillip Susi","fromEmail":"psusi@ubuntu.com","sentAt":"2014-06-13T01:16:34Z","receivedAt":"2014-06-13T01:16:34Z","isPatch":false,"sender":{"key":"psusi@ubuntu.com","avatar":null},"body":"-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA512\n\nOn 06/12/2014 09:02 PM, brian m. carlson wrote:\n> On Thu, Jun 12, 2014 at 05:01:16PM -0400, Phillip Susi wrote:\n>> So nobody has any ideas on what to check for or how to debug\n>> this?\n> \n> I'm assuming this works in the general case, because we have tests\n> for it.  Do you perhaps have a repository and a set of reproduction\n> steps we could use to try to reproduce this?\n> \n> If you can get that information, I'm interested in trying to fix\n> it.\n\nI don't have a set of reproduction steps, but I do still have the repo\nthat is in this stuck state if there is any data you might want me to\npull out of it ( .git/rebase-apply? ).\n\nI had spoken to another Ubuntu dev who said that he had this happen to\nhim once too and he just did an abort and tried again and the problem\nwent away, so it seems hard to reproduce, which is why I have\npreserved the problem to try and analyze it.\n\n\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v1\nComment: Using GnuPG with Thunderbird - http://www.enigmail.net/\n\niQEcBAEBCgAGBQJTmlDyAAoJEI5FoCIzSKrwN0IH/R6ny2h1XLv3Rj2Aed6C8xzU\n+XsiNo6RYG9++Jk3vr705CVnmWx+4lwhr7E6jW9ValdDKEYjamypeQUyqrWSokiH\nIajIMc4BNowGW7Eg1uRV8KQfb1P+QtmxBMwumOnOYk9zPfA9JcmlPVT6g5LrKy9N\n6TMIlCMY1v0WPKZhseYYWHayP8PHF8KqSVuGIAZoPKPQdOQjNAOLW+PPbxiQKCcB\nPrspPx+hNk4NUUm8156BdJO+xEGQpSYIY384yo0dEfvh3QHB4z/wTv84/9APxEQO\nrV+67fW1psrFX+GkUolL9WFCBOeZRk3nykYJRravSOuOJKBa9laGAmiJT/EjWYI=\n=DONL\n-----END PGP SIGNATURE-----\n"},{"id":"244064","messageId":"20140613073446.GF7908@sigill.intra.peff.net","threadId":"36883","inReplyTo":"539A50F2.40206@ubuntu.com","subject":"Re: git rebase --skip stuck in a loop","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2014-06-13T07:34:46Z","receivedAt":"2014-06-13T07:34:46Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Jun 12, 2014 at 09:16:34PM -0400, Phillip Susi wrote:\n\n> > I'm assuming this works in the general case, because we have tests\n> > for it.  Do you perhaps have a repository and a set of reproduction\n> > steps we could use to try to reproduce this?\n> > \n> > If you can get that information, I'm interested in trying to fix\n> > it.\n> \n> I don't have a set of reproduction steps, but I do still have the repo\n> that is in this stuck state if there is any data you might want me to\n> pull out of it ( .git/rebase-apply? ).\n\nThanks for saving the stuck state.\n\nIf it's possible to share the whole repo, it might be worth seeing (then\nwe can all just run \"git rebase --continue\" ourselves). If it's too big\nor is confidential, just tarring up .git/rebase-apply and making it\navailable is probably a good first step.\n\n-Peff\n"},{"id":"244137","messageId":"539B0795.70907@ubuntu.com","threadId":"36883","inReplyTo":"20140613073446.GF7908@sigill.intra.peff.net","subject":"Re: git rebase --skip stuck in a loop","fromName":"Phillip Susi","fromEmail":"psusi@ubuntu.com","sentAt":"2014-06-13T14:15:49Z","receivedAt":"2014-06-13T14:15:49Z","isPatch":false,"sender":{"key":"psusi@ubuntu.com","avatar":null},"body":"-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA1\n\nOn 6/13/2014 3:34 AM, Jeff King wrote:\n> Thanks for saving the stuck state.\n> \n> If it's possible to share the whole repo, it might be worth seeing\n> (then we can all just run \"git rebase --continue\" ourselves). If\n> it's too big or is confidential, just tarring up .git/rebase-apply\n> and making it available is probably a good first step.\n\nIt's the debian parted repo, so nothing confidential.  Here it is:\n\nhttps://drive.google.com/file/d/0ByOQJBpP4bDXXy13YlN0aE5Fcnc/edit?usp=sharing\n\n\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v2.0.17 (MingW32)\nComment: Using GnuPG with Thunderbird - http://www.enigmail.net/\n\niQEcBAEBAgAGBQJTmweVAAoJEI5FoCIzSKrwI84H/2Di1d5MeQpcg/I02nF7sd/f\ngICGclFE8MPuTnKYfpYf4/SbSnB9+Znp+9OhQA0frYIblWHWEnUzwhINrDHvqApK\nhCsuNGb5iHgy8ohZVGqH8B4ew8x4Ru3pwy9VYV2Wc1Z33curDIohx6qi4LCIrlaB\nStzWgq3h8hV+3QB5zcD9MfAfdKkz1u5bIMlT9VYofYwctYERVk2DyaAj8eKBGyWo\n6dWYuZDoQfO3Hnd/uGqWbdHrPiDoSQqYPbHNWNOnX24w+IKDv2Xe9bcHro+9A+Jg\nPF+QXo4IS1E7CwevExe7gGKK3KdrD9SMixW7hHAbVVnpDIsvw485EL0xsZfmFJk=\n=ncor\n-----END PGP SIGNATURE-----\n"},{"id":"244236","messageId":"20140615223913.GI368384@vauxhall.crustytoothpaste.net","threadId":"36883","inReplyTo":"539B0795.70907@ubuntu.com","subject":"Re: git rebase --skip stuck in a loop","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2014-06-15T22:39:13Z","receivedAt":"2014-06-15T22:39:13Z","isPatch":false,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On Fri, Jun 13, 2014 at 10:15:49AM -0400, Phillip Susi wrote:\n> -----BEGIN PGP SIGNED MESSAGE-----\n> Hash: SHA1\n> \n> On 6/13/2014 3:34 AM, Jeff King wrote:\n> > Thanks for saving the stuck state.\n> > \n> > If it's possible to share the whole repo, it might be worth seeing\n> > (then we can all just run \"git rebase --continue\" ourselves). If\n> > it's too big or is confidential, just tarring up .git/rebase-apply\n> > and making it available is probably a good first step.\n> \n> It's the debian parted repo, so nothing confidential.  Here it is:\n> \n> https://drive.google.com/file/d/0ByOQJBpP4bDXXy13YlN0aE5Fcnc/edit?usp=sharing\n\nOkay.  This is actually a fairly straightforward issue.  In order to\nreproduce, you have to use git rebase --merge and two patches in\nsequence have to cause conflicts.  In that case, git rebase --skip will\nfail to ever update the msgnum value, and it will get caught in a loop.\n\nI should have a patch shortly.\n\n-- \nbrian m. carlson / brian with sandals: Houston, Texas, US\n+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only\nOpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187\n"},{"id":"244237","messageId":"ea5a46c7605a181b6726093e04bc882b013fd504.1402876855.git.sandals@crustytoothpaste.net","threadId":"36883","inReplyTo":"20140615223913.GI368384@vauxhall.crustytoothpaste.net","subject":"[PATCH] rebase--merge: fix --skip with two conflicts in a row","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2014-06-16T00:01:25Z","receivedAt":"2014-06-16T00:01:25Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"If git rebase --merge encountered a conflict, --skip would not work if the\nnext commit also conflicted.  The msgnum file would never be updated with\nthe new patch number, so no patch would actually be skipped, resulting in an\ninescapable loop.\n\nUpdate the msgnum file's value as the first thing in call_merge.  This also\navoids an \"Already applied\" message when skipping a commit.  There is no\nvisible change for the other contexts in which call_merge is invoked, as the\nmsgnum file's value remains unchanged in those situations.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n git-rebase--merge.sh    |  5 +++--\n t/t3402-rebase-merge.sh | 15 +++++++++++++++\n 2 files changed, 18 insertions(+), 2 deletions(-)\n\ndiff --git a/git-rebase--merge.sh b/git-rebase--merge.sh\nindex 6d77b3c..d3fb67d 100644\n--- a/git-rebase--merge.sh\n+++ b/git-rebase--merge.sh\n@@ -53,11 +53,12 @@ continue_merge () {\n }\n \n call_merge () {\n-\tcmt=\"$(cat \"$state_dir/cmt.$1\")\"\n+\tmsgnum=\"$1\"\n+\techo \"$msgnum\" >\"$state_dir/msgnum\"\n+\tcmt=\"$(cat \"$state_dir/cmt.$msgnum\")\"\n \techo \"$cmt\" > \"$state_dir/current\"\n \thd=$(git rev-parse --verify HEAD)\n \tcmt_name=$(git symbolic-ref HEAD 2> /dev/null || echo HEAD)\n-\tmsgnum=$(cat \"$state_dir/msgnum\")\n \teval GITHEAD_$cmt='\"${cmt_name##refs/heads/}~$(($end - $msgnum))\"'\n \teval GITHEAD_$hd='$onto_name'\n \texport GITHEAD_$cmt GITHEAD_$hd\ndiff --git a/t/t3402-rebase-merge.sh b/t/t3402-rebase-merge.sh\nindex be8c1d5..5a27ec9 100755\n--- a/t/t3402-rebase-merge.sh\n+++ b/t/t3402-rebase-merge.sh\n@@ -33,6 +33,7 @@ test_expect_success setup '\n \ttr \"[a-z]\" \"[A-Z]\" <original >newfile &&\n \tgit add newfile &&\n \tgit commit -a -m\"side edits further.\" &&\n+\tgit branch second-side &&\n \n \ttr \"[a-m]\" \"[A-M]\" <original >newfile &&\n \trm -f original &&\n@@ -41,6 +42,7 @@ test_expect_success setup '\n \tgit branch test-rebase side &&\n \tgit branch test-rebase-pick side &&\n \tgit branch test-reference-pick side &&\n+\tgit branch test-conflicts side &&\n \tgit checkout -b test-merge side\n '\n \n@@ -138,4 +140,17 @@ test_expect_success 'rebase -s funny -Xopt' '\n \ttest -f funny.was.run\n '\n \n+test_expect_success 'rebase --skip works with two conflicts in a row' '\n+\tgit checkout second-side  &&\n+\ttr \"[A-Z]\" \"[a-z]\" <newfile >tmp &&\n+\tmv tmp newfile &&\n+\tgit commit -a -m\"edit conflicting with side\" &&\n+\ttr \"[d-f]\" \"[D-F]\" <newfile >tmp &&\n+\tmv tmp newfile &&\n+\tgit commit -a -m\"another edit conflicting with side\" &&\n+\ttest_must_fail git rebase --merge test-conflicts &&\n+\ttest_must_fail git rebase --skip &&\n+\tgit rebase --skip\n+'\n+\n test_done\n-- \n2.0.0\n"},{"id":"244354","messageId":"xmqqoaxsppds.fsf@gitster.dls.corp.google.com","threadId":"36883","inReplyTo":"ea5a46c7605a181b6726093e04bc882b013fd504.1402876855.git.sandals@crustytoothpaste.net","subject":"Re: [PATCH] rebase--merge: fix --skip with two conflicts in a row","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-06-16T20:31:59Z","receivedAt":"2014-06-16T20:31:59Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"brian m. carlson\" <sandals@crustytoothpaste.net> writes:\n\n> If git rebase --merge encountered a conflict, --skip would not work if the\n> next commit also conflicted.  The msgnum file would never be updated with\n> the new patch number, so no patch would actually be skipped, resulting in an\n> inescapable loop.\n>\n> Update the msgnum file's value as the first thing in call_merge.  This also\n> avoids an \"Already applied\" message when skipping a commit.  There is no\n> visible change for the other contexts in which call_merge is invoked, as the\n> msgnum file's value remains unchanged in those situations.\n>\n> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n> ---\n\nSounds good to me.  Thanks.\n\n>  git-rebase--merge.sh    |  5 +++--\n>  t/t3402-rebase-merge.sh | 15 +++++++++++++++\n>  2 files changed, 18 insertions(+), 2 deletions(-)\n>\n> diff --git a/git-rebase--merge.sh b/git-rebase--merge.sh\n> index 6d77b3c..d3fb67d 100644\n> --- a/git-rebase--merge.sh\n> +++ b/git-rebase--merge.sh\n> @@ -53,11 +53,12 @@ continue_merge () {\n>  }\n>  \n>  call_merge () {\n> -\tcmt=\"$(cat \"$state_dir/cmt.$1\")\"\n> +\tmsgnum=\"$1\"\n> +\techo \"$msgnum\" >\"$state_dir/msgnum\"\n> +\tcmt=\"$(cat \"$state_dir/cmt.$msgnum\")\"\n>  \techo \"$cmt\" > \"$state_dir/current\"\n>  \thd=$(git rev-parse --verify HEAD)\n>  \tcmt_name=$(git symbolic-ref HEAD 2> /dev/null || echo HEAD)\n> -\tmsgnum=$(cat \"$state_dir/msgnum\")\n>  \teval GITHEAD_$cmt='\"${cmt_name##refs/heads/}~$(($end - $msgnum))\"'\n>  \teval GITHEAD_$hd='$onto_name'\n>  \texport GITHEAD_$cmt GITHEAD_$hd\n> diff --git a/t/t3402-rebase-merge.sh b/t/t3402-rebase-merge.sh\n> index be8c1d5..5a27ec9 100755\n> --- a/t/t3402-rebase-merge.sh\n> +++ b/t/t3402-rebase-merge.sh\n> @@ -33,6 +33,7 @@ test_expect_success setup '\n>  \ttr \"[a-z]\" \"[A-Z]\" <original >newfile &&\n>  \tgit add newfile &&\n>  \tgit commit -a -m\"side edits further.\" &&\n> +\tgit branch second-side &&\n>  \n>  \ttr \"[a-m]\" \"[A-M]\" <original >newfile &&\n>  \trm -f original &&\n> @@ -41,6 +42,7 @@ test_expect_success setup '\n>  \tgit branch test-rebase side &&\n>  \tgit branch test-rebase-pick side &&\n>  \tgit branch test-reference-pick side &&\n> +\tgit branch test-conflicts side &&\n>  \tgit checkout -b test-merge side\n>  '\n>  \n> @@ -138,4 +140,17 @@ test_expect_success 'rebase -s funny -Xopt' '\n>  \ttest -f funny.was.run\n>  '\n>  \n> +test_expect_success 'rebase --skip works with two conflicts in a row' '\n> +\tgit checkout second-side  &&\n> +\ttr \"[A-Z]\" \"[a-z]\" <newfile >tmp &&\n> +\tmv tmp newfile &&\n> +\tgit commit -a -m\"edit conflicting with side\" &&\n> +\ttr \"[d-f]\" \"[D-F]\" <newfile >tmp &&\n> +\tmv tmp newfile &&\n> +\tgit commit -a -m\"another edit conflicting with side\" &&\n> +\ttest_must_fail git rebase --merge test-conflicts &&\n> +\ttest_must_fail git rebase --skip &&\n> +\tgit rebase --skip\n> +'\n> +\n>  test_done\n"}]}