{"thread":{"id":"35510","subject":"[PATCH] t5541: Improve push test","startedAt":"2013-12-09T20:03:28Z","lastAt":"2013-12-11T15:13:46Z","messageCount":3,"participants":["Torsten Bögershausen","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"231803","messageId":"201312092103.29047.tboegi@web.de","threadId":"35510","inReplyTo":null,"subject":"[PATCH] t5541: Improve push test","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2013-12-09T20:03:28Z","receivedAt":"2013-12-09T20:03:28Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"The old log-line looked like this:\n + 9d498b0...8598732 master -> master (forced update)\nAnd the new one like this:\n   9d498b0..8598732  master -> master\n\n- Loosen the grep pattern by not demanding \"(forced update)\"\n- Improve the grep pattern and check the new SHA id\n\nSigned-off-by: Torsten Bögershausen <tboegi@web.de>\n---\nThe following revealed a weakness in t5541:\n commit f9e3c6bebb89de12f2dfdaa1899cb22e9ef32542\n Author: Felipe Contreras <felipe.contreras@gmail.com>\n Date:   Tue Nov 12 14:56:57 2013 -0600\n    transport-helper: check for 'forced update' message\nSo don't look for forced update, but check for the SHA.\n\n(I want to fix a missing \"&&\" as well, that is for the next commit)\ndiff --git a/t/t5541-http-push.sh b/t/t5541-http-push.sh\nindex 470ac54..1468a07 100755\n--- a/t/t5541-http-push.sh\n+++ b/t/t5541-http-push.sh\n@@ -168,7 +168,8 @@ test_expect_success 'push fails for non-fast-forward refs unmatched by remote he\n \ttest_must_fail git push -v origin +master master:retsam >output 2>&1'\n \n test_expect_success 'push fails for non-fast-forward refs unmatched by remote helper: remote output' '\n-\tgrep \"^ + [a-f0-9]*\\.\\.\\.[a-f0-9]* *master -> master (forced update)$\" output &&\n+\tnewsha=$(git log --oneline -n1 | sed -e \"s/^\\([0-9a-f]*\\).*/\\1/\") &&\n+\tgrep \"\\.\\.$newsha *master -> master\" output &&\n \tgrep \"^ ! \\[rejected\\] *master -> retsam (non-fast-forward)$\" output\n '\n \n-- \n1.8.5\n"},{"id":"231831","messageId":"xmqq61qxwu8f.fsf@gitster.dls.corp.google.com","threadId":"35510","inReplyTo":"201312092103.29047.tboegi@web.de","subject":"Re: [PATCH] t5541: Improve push test","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-12-09T22:10:56Z","receivedAt":"2013-12-09T22:10:56Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Torsten Bögershausen <tboegi@web.de> writes:\n\n> The old log-line looked like this:\n>  + 9d498b0...8598732 master -> master (forced update)\n> And the new one like this:\n>    9d498b0..8598732  master -> master\n>\n> - Loosen the grep pattern by not demanding \"(forced update)\"\n\nHmm, what is the reason for the change the output?  The output this\npiece is testing is the result of this:\n\n\tgit push origin master:retsam\n\n\techo \"change changed\" > path2 &&\n\tgit commit -a -m path2 --amend &&\n\n\t# push master too; this ensures there is at least one '\"'push'\"' command to\n\t# the remote helper and triggers interaction with the helper.\n\ttest_must_fail git push -v origin +master master:retsam >output 2>&1'\n\nThis is run inside test_repo_clone, which has /smart/test_repo.git\nas its origin, which in turn has 'master' branch (and nothing else).\n\nIt\n\n - pushes master to another branch retsam;\n\n - amends its 'master';\n\n - attempts to push the updated master to force-update master, and\n   also retsam without forcing.  The latter needs to be forced to\n   succeed, and that is why we expect it to fail.\n\nIf the output from the push process says\n\n  + 9d498b0...8598732 master -> master (forced update)\n  ! [rejected]        master -> retsam (non-fast-forward)\n  error: failed to push some refs to '../test_repo_copy/'\n\nI think that is a good thing to do, no?  After all, that is what we\nshow with Git native transports.\n\nIs this patch merely matching a test to a broken behaviour of some\nsort?  Puzzled...\n"},{"id":"231920","messageId":"52A8812A.4060004@web.de","threadId":"35510","inReplyTo":"xmqq61qxwu8f.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH] t5541: Improve push test","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2013-12-11T15:13:46Z","receivedAt":"2013-12-11T15:13:46Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On 2013-12-09 23.10, Junio C Hamano wrote:\n> Torsten Bögershausen <tboegi@web.de> writes:\n> \n>> The old log-line looked like this:\n>>  + 9d498b0...8598732 master -> master (forced update)\n>> And the new one like this:\n>>    9d498b0..8598732  master -> master\n>>\n>> - Loosen the grep pattern by not demanding \"(forced update)\"\n> \n> Hmm, what is the reason for the change the output?  The output this\n> piece is testing is the result of this:\n> \n> \tgit push origin master:retsam\n> \n> \techo \"change changed\" > path2 &&\n> \tgit commit -a -m path2 --amend &&\n> \n> \t# push master too; this ensures there is at least one '\"'push'\"' command to\n> \t# the remote helper and triggers interaction with the helper.\n> \ttest_must_fail git push -v origin +master master:retsam >output 2>&1'\n> \n> This is run inside test_repo_clone, which has /smart/test_repo.git\n> as its origin, which in turn has 'master' branch (and nothing else).\n> \n> It\n> \n>  - pushes master to another branch retsam;\n> \n>  - amends its 'master';\n> \n>  - attempts to push the updated master to force-update master, and\n>    also retsam without forcing.  The latter needs to be forced to\n>    succeed, and that is why we expect it to fail.\n> \n> If the output from the push process says\n> \n>   + 9d498b0...8598732 master -> master (forced update)\n>   ! [rejected]        master -> retsam (non-fast-forward)\n>   error: failed to push some refs to '../test_repo_copy/'\n> \n> I think that is a good thing to do, no?  After all, that is what we\n> show with Git native transports.\n> \n> Is this patch merely matching a test to a broken behaviour of some\n> sort?  Puzzled...\nThanks for the analysis: I thing the patch isn't the way to go.\nThe regression in t5541 was introduced in f9e3c6bebb89de12.\nWhich was a cleanup to previous commits:\n\"transport-helper: add 'force' to 'export' helpers\"\nSo reverting f9e3c6bebb89de fixes t5541, but breaks\ncontrib/remote-helpers.\n\nFelipe, could you have a look, please ?\n/Torsten\n\n \nforce\n"}]}