git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 8/9] Exercise "stg pull" on patches just appending lines.

From
Yann Dirson <ydirson@altern.org>
Date
Apr 16, 2006, 10:52 UTC
Message-ID
<20060416105244.9884.26316.stgit@gandelf.nowhere.earth>
In-Reply-To
<20060416104144.9884.28167.stgit@gandelf.nowhere.earth>

It indeed reveals a problem in "push": appended lines are appended again, as the already-applied patch is not detected.

Signed-off-by: Yann Dirson <ydirson@altern.org>
---
 t/t1201-pull-trailing.sh |   48 ++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 48 insertions(+), 0 deletions(-)
diff --git a/t/t1201-pull-trailing.sh b/t/t1201-pull-trailing.sh
new file mode 100755
index 0000000..142f894
--- /dev/null
+++ b/t/t1201-pull-trailing.sh
@@ -0,0 +1,48 @@
+#!/bin/sh
+#
+# Copyright (c) 2006 Yann Dirson
+#
+
+test_description='test
+
+'
+
+. ./test-lib.sh
+
+# don't need this repo, but better not drop it, see t1100
+#rm -rf .git
+
+# Need a repo to clone
+test_create_repo foo
+
+test_expect_success \
+    'Setup and clone tree, and setup changes' \
+    "(cd foo &&
+      printf 'a\nb\n' > file && git add file && git commit -m .
+     ) &&
+     stg clone foo bar &&
+     (cd bar && stg new p1 -m p1
+      printf 'c\n' >> file && stg refresh
+     )
+"
+
+test_expect_success \
+    'Port those patches to orig tree' \
+    "(cd foo &&
+      GIT_DIR=../bar/.git git-format-patch --stdout bases/master..HEAD |
+      git-am -3 -k
+     )
+"
+
+test_expect_success \
+    'Pull those patches applied upstream' \
+    "(cd bar && stg pull
+     )
+"
+
+test_expect_success \
+    'Check that all went well' \
+    "diff -u foo/file bar/file
+"
+
+test_done
Previous: Yann DirsonNext: Yann Dirson
Message 9 of 10 in “Add a testsuite to stgit (take 3), and more”
  1. 0/9 Add a testsuite to stgit (take 3), and moreYann Dirson, Apr 16, 2006
  2. 1/9 Add a testsuite framework copied from git-coreYann Dirson, Apr 16, 2006
  3. 2/9 Add list of bugs to TODOYann Dirson, Apr 16, 2006
  4. 3/9 Add a couple of safety checks to series creationYann Dirson, Apr 16, 2006
  5. 4/9 Make branch creation atomicYann Dirson, Apr 16, 2006
  6. 5/9 Correctly handle refs/patches on series renameYann Dirson, Apr 16, 2006
  7. 6/9 Fix a seriously bad interaction between .git caching and repo cloningYann Dirson, Apr 16, 2006
  8. 7/9 Test that pulls a patch creating a file that got modified afterwardsYann Dirson, Apr 16, 2006
  9. 8/9 Exercise "stg pull" on patches just appending lines.Yann Dirson, Apr 16, 2006
  10. 9/9 Look for templates in ~/.stgit/templates as wellYann Dirson, Apr 16, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.