{"thread":{"id":"3893","subject":"[PATCH] Updated testcases for stgit pull with merge","startedAt":"2006-04-16T20:34:48Z","lastAt":"2006-04-16T20:40:29Z","messageCount":2,"participants":["Yann Dirson"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"18752","messageId":"20060416203448.10137.69093.stgit@gandelf.nowhere.earth","threadId":"3893","inReplyTo":null,"subject":"[PATCH] Updated testcases for stgit pull with merge","fromName":"Yann Dirson","fromEmail":"ydirson@altern.org","sentAt":"2006-04-16T20:34:48Z","receivedAt":"2006-04-16T20:34:48Z","isPatch":true,"sender":{"key":"ydirson@altern.org","avatar":"https://avatars.githubusercontent.com/u/1190950?v=4"},"body":"[Sorry for the previous buggy post]\n\nIn the previous series, patch 7 mostly demonstrate that I have missed\nthe appearance of the --merged flag in stgit 0.9 push and pull\ncommands, so we could just amend this testcase with that flag.\nHowever, it appears that common workflow of forgetting that flag, then\ntrying to undo the failed push, and re-pushing with the flag still shows\na problem, as hopefully shown by this updated testcase.\n\nAs for the testcase in patch 8, it still demonstrates a problem IMHO:\nthe push without the --merged flag should have failed in much the same\nway this one does.  However, I have seen GNU patch showing a similar\nbehaviour, so it is maybe not stgit's fault.\n\n-- \nYann Dirson    <ydirson@altern.org> |\nDebian-related: <dirson@debian.org> |   Support Debian GNU/Linux:\n                                    |  Freedom, Power, Stability, Gratis\n     http://ydirson.free.fr/        | Check <http://www.debian.org/>\n"},{"id":"18753","messageId":"20060416204029.10137.80865.stgit@gandelf.nowhere.earth","threadId":"3893","inReplyTo":"20060416203448.10137.69093.stgit@gandelf.nowhere.earth","subject":"[PATCH] Test that pulls a patch creating a file that got modified afterwards","fromName":"Yann Dirson","fromEmail":"ydirson@altern.org","sentAt":"2006-04-16T20:40:29Z","receivedAt":"2006-04-16T20:40:29Z","isPatch":true,"sender":{"key":"ydirson@altern.org","avatar":"https://avatars.githubusercontent.com/u/1190950?v=4"},"body":"From: Yann Dirson <ydirson@altern.org>\n\nThis demonstrates an issue wite has bitten me more than once: the stg\nbranch adds a file in one patch, and modifies it in a later patch; then all\npatches get integrated in upstream tree, and at \"stg pull\" time, stgit\nbelieves there is a conflict, even when the patches are exactly the same.\n\nThis is normal as it requires the --merged flag on push or pull.  So\nwe rollback with \"push --undo\" and \"push --merge\" to finish.\n---\n\n t/t1200-push-modified.sh |   64 ++++++++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 64 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t1200-push-modified.sh b/t/t1200-push-modified.sh\nnew file mode 100755\nindex 0000000..7847a38\n--- /dev/null\n+++ b/t/t1200-push-modified.sh\n@@ -0,0 +1,64 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2006 Yann Dirson\n+#\n+\n+test_description='Exercise pushing patches applied upstream.\n+\n+Especially, consider the case of a patch that adds a file, while a\n+subsequent one modifies it, so we have to use --merged for push to\n+detect the merge.  Reproduce the common workflow where one does not\n+specify --merged, then rollback and retry with the correct flag.'\n+\n+. ./test-lib.sh\n+\n+# don't need this repo, but better not drop it, see t1100\n+#rm -rf .git\n+\n+# Need a repo to clone\n+test_create_repo foo\n+\n+test_expect_success \\\n+    'Clone tree and setup changes' \\\n+    \"stg clone foo bar &&\n+     (cd bar && stg new p1 -m p1\n+      printf 'a\\nc\\n' > file && stg add file && stg refresh &&\n+      stg new p2 -m p2\n+      printf 'a\\nb\\nc\\n' > file && stg refresh\n+     )\n+\"\n+\n+test_expect_success \\\n+    'Port those patches to orig tree' \\\n+    \"(cd foo &&\n+      GIT_DIR=../bar/.git git-format-patch --stdout bases/master..HEAD |\n+      git-am -3 -k\n+     )\n+\"\n+\n+test_expect_success \\\n+    'Pull to sync with parent, preparing for the problem' \\\n+    \"(cd bar && stg pop --all &&\n+      stg pull\n+     )\n+\"\n+\n+test_expect_failure \\\n+    'Attempt to push the first of those patches without --merged' \\\n+    \"(cd bar && stg push\n+     )\n+\"\n+\n+test_expect_success \\\n+    'Rollback the push' \\\n+    \"(cd bar && stg push --undo\n+     )\n+\"\n+\n+test_expect_success \\\n+    'Push those patches while checking they were merged upstream' \\\n+    \"(cd bar && stg push --merged --all\n+     )\n+\"\n+\n+test_done\n"}]}