{"thread":{"id":"45516","subject":"[PATCH] git-p4: Add failing test case for name-rev vs symbolic-ref","startedAt":"2017-03-26T09:15:58Z","lastAt":"2017-03-27T20:30:24Z","messageCount":5,"participants":["Luke Diamand","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"315454","messageId":"20170326091537.2707-1-luke@diamand.org","threadId":"45516","inReplyTo":null,"subject":"[PATCH] git-p4: Add failing test case for name-rev vs symbolic-ref","fromName":"Luke Diamand","fromEmail":"luke@diamand.org","sentAt":"2017-03-26T09:15:36Z","receivedAt":"2017-03-26T09:15:58Z","isPatch":true,"sender":{"key":"luke@diamand.org","avatar":"https://avatars.githubusercontent.com/u/5330967?v=4"},"body":"As per the discussion about use of \"git name-rev\" vs \"git symbolic-ref\" in\ngit-p4 here:\n\nhttp://marc.info/?l=git&m=148979063421355\n\ngit-p4 could get confused about the branch it is on and affects\nthe git-p4.allowSubmit <branchname> option. This adds a failing\ntest case for the problem.\n\nLuke Diamand (1):\n  git-p4: add failing test for name-rev rather than symbolic-ref\n\n t/t9807-git-p4-submit.sh | 16 ++++++++++++++++\n 1 file changed, 16 insertions(+)\n\n-- \n2.8.2.703.g78b384c.dirty\n\n"},{"id":"315455","messageId":"20170326091537.2707-2-luke@diamand.org","threadId":"45516","inReplyTo":"20170326091537.2707-1-luke@diamand.org","subject":"[PATCH] git-p4: add failing test for name-rev rather than symbolic-ref","fromName":"Luke Diamand","fromEmail":"luke@diamand.org","sentAt":"2017-03-26T09:15:37Z","receivedAt":"2017-03-26T09:15:59Z","isPatch":true,"sender":{"key":"luke@diamand.org","avatar":"https://avatars.githubusercontent.com/u/5330967?v=4"},"body":"Using name-rev to find the current git branch means that git-p4\ndoes not correctly get the current branch name if there are\nmultiple branches pointing at HEAD, or a tag.\n\nThis change adds a test case which demonstrates the problem.\nConfiguring which branches are allowed to be submitted from goes\nwrong, as git-p4 gets confused about which branch is in use.\n\nThis appears to be the only place that git-p4 actually cares\nabout the current branch.\n\nSigned-off-by: Luke Diamand <luke@diamand.org>\n---\n t/t9807-git-p4-submit.sh | 16 ++++++++++++++++\n 1 file changed, 16 insertions(+)\n\ndiff --git a/t/t9807-git-p4-submit.sh b/t/t9807-git-p4-submit.sh\nindex e37239e..ae05816 100755\n--- a/t/t9807-git-p4-submit.sh\n+++ b/t/t9807-git-p4-submit.sh\n@@ -139,6 +139,22 @@ test_expect_success 'submit with master branch name from argv' '\n \t)\n '\n \n+test_expect_failure 'allow submit from branch with same revision but different name' '\n+\ttest_when_finished cleanup_git &&\n+\tgit p4 clone --dest=\"$git\" //depot &&\n+\t(\n+\t\tcd \"$git\" &&\n+\t\ttest_commit \"file8\" &&\n+\t\tgit checkout -b branch1 &&\n+\t\tgit checkout -b branch2 &&\n+\t\tgit config git-p4.skipSubmitEdit true &&\n+\t\tgit config git-p4.allowSubmit \"branch1\" &&\n+\t\ttest_must_fail git p4 submit &&\n+\t\tgit checkout branch1 &&\n+\t\tgit p4 submit\n+\t)\n+'\n+\n #\n # Basic submit tests, the five handled cases\n #\n-- \n2.8.2.703.g78b384c.dirty\n\n"},{"id":"315488","messageId":"xmqqefxj4ofm.fsf@gitster.mtv.corp.google.com","threadId":"45516","inReplyTo":"20170326091537.2707-1-luke@diamand.org","subject":"Re: [PATCH] git-p4: Add failing test case for name-rev vs symbolic-ref","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-03-26T23:18:37Z","receivedAt":"2017-03-26T23:18:46Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Luke Diamand <luke@diamand.org> writes:\n\n> As per the discussion about use of \"git name-rev\" vs \"git symbolic-ref\" in\n> git-p4 here:\n>\n> http://marc.info/?l=git&m=148979063421355\n>\n> git-p4 could get confused about the branch it is on and affects\n> the git-p4.allowSubmit <branchname> option. This adds a failing\n> test case for the problem.\n>\n> Luke Diamand (1):\n>   git-p4: add failing test for name-rev rather than symbolic-ref\n>\n>  t/t9807-git-p4-submit.sh | 16 ++++++++++++++++\n>  1 file changed, 16 insertions(+)\n\nAhh, thanks for tying loose ends.  I completely forgot about that\ntopic.\n\nIf we queue this and then update the function in git-p4.py that\n(mis)uses name-rev to learn the current branch to use symbolic-ref\ninstead, can we flip the \"expect_failure\" to \"expect_success\"?\n\nIOW, can we have a follow up to this patch that fixes a known\nbreakage the patch documents ;-)?\n\nThanks.\n"},{"id":"315503","messageId":"CAE5ih78jhR3GwMBdPyi5oOHByC2fVxefExStc9pCNMTu-1Os7w@mail.gmail.com","threadId":"45516","inReplyTo":"xmqqefxj4ofm.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] git-p4: Add failing test case for name-rev vs symbolic-ref","fromName":"Luke Diamand","fromEmail":"luke@diamand.org","sentAt":"2017-03-27T06:57:47Z","receivedAt":"2017-03-27T06:58:18Z","isPatch":true,"sender":{"key":"luke@diamand.org","avatar":"https://avatars.githubusercontent.com/u/5330967?v=4"},"body":"On 27 March 2017 at 00:18, Junio C Hamano <gitster@pobox.com> wrote:\n> Luke Diamand <luke@diamand.org> writes:\n>\n>> As per the discussion about use of \"git name-rev\" vs \"git symbolic-ref\" in\n>> git-p4 here:\n>>\n>> http://marc.info/?l=git&m=148979063421355\n>>\n>> git-p4 could get confused about the branch it is on and affects\n>> the git-p4.allowSubmit <branchname> option. This adds a failing\n>> test case for the problem.\n>>\n>> Luke Diamand (1):\n>>   git-p4: add failing test for name-rev rather than symbolic-ref\n>>\n>>  t/t9807-git-p4-submit.sh | 16 ++++++++++++++++\n>>  1 file changed, 16 insertions(+)\n>\n> Ahh, thanks for tying loose ends.  I completely forgot about that\n> topic.\n>\n> If we queue this and then update the function in git-p4.py that\n> (mis)uses name-rev to learn the current branch to use symbolic-ref\n> instead, can we flip the \"expect_failure\" to \"expect_success\"?\n\nYes. The test passes with your change.\n\n>\n> IOW, can we have a follow up to this patch that fixes a known\n> breakage the patch documents ;-)?\n\nYes.\n\nRegards!\nLuke\n"},{"id":"315529","messageId":"xmqq8tnq1mzq.fsf@gitster.mtv.corp.google.com","threadId":"45516","inReplyTo":"CAE5ih78jhR3GwMBdPyi5oOHByC2fVxefExStc9pCNMTu-1Os7w@mail.gmail.com","subject":"Re: [PATCH] git-p4: Add failing test case for name-rev vs symbolic-ref","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-03-27T20:30:17Z","receivedAt":"2017-03-27T20:30:24Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Luke Diamand <luke@diamand.org> writes:\n\n> Yes. The test passes with your change.\n>>\n>> IOW, can we have a follow up to this patch that fixes a known\n>> breakage the patch documents ;-)?\n>\n> Yes.\n\nThanks.\n"}]}