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

[PATCH 1/3] filter-branch: Extend test to show rewriting bug

From
Thomas Rast <trast@student.ethz.ch>
Date
Aug 12, 2008, 08:45 UTC
Message-ID
<b6bda5e5028aea161e5d18e0c70c45d5a94dac82.1218529494.git.trast@student.ethz.ch>
In-Reply-To
<cover.1218529494.git.trast@student.ethz.ch>

This extends the --subdirectory-filter test in t7003 to demonstrate a rewriting bug: when rewriting two refs A and B such that B is an ancestor of A, it fails to rewrite B.

The underlying issue is that the rev-list invocation at git-filter-branch.sh:332 more or less boils down to

  git rev-list B --boundary ^A
which outputs nothing because B is an ancestor of A.
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
---
 t/t7003-filter-branch.sh |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh
index a0ab096..4382baa 100755
--- a/t/t7003-filter-branch.sh
+++ b/t/t7003-filter-branch.sh
@@ -96,13 +96,17 @@ test_expect_success 'filter subdirectory only' '
 	test_tick &&
 	git commit -m "again not subdir" &&
 	git branch sub &&
-	git-filter-branch -f --subdirectory-filter subdir refs/heads/sub
+	git branch sub-earlier HEAD~2 &&
+	git-filter-branch -f --subdirectory-filter subdir \
+		refs/heads/sub refs/heads/sub-earlier
 '
 
-test_expect_success 'subdirectory filter result looks okay' '
+test_expect_failure 'subdirectory filter result looks okay' '
 	test 2 = $(git rev-list sub | wc -l) &&
 	git show sub:new &&
-	test_must_fail git show sub:subdir
+	test_must_fail git show sub:subdir &&
+	git show sub-earlier:new &&
+	test_must_fail git show sub-earlier:subdir
 '
 
 test_expect_success 'more setup' '
-- 
1.6.0.rc2.30.gb6bda
Previous: Thomas RastNext: Thomas Rast
Message 2 of 5 in “filter-branch --subdirectory-filter improvements”
  1. 0/3 filter-branch --subdirectory-filter improvementsThomas Rast, Aug 12, 2008
  2. 1/3 filter-branch: Extend test to show rewriting bugThomas Rast, Aug 12, 2008
  3. 2/3 filter-branch: fix ref rewriting with --subdirectory-filterThomas Rast, Aug 12, 2008
  4. 3/3 filter-branch: use --simplify-mergesThomas Rast, Aug 12, 2008
  5. Jan WielemakerAug 12, 2008

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.