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

[PATCH 1/2] Add a test showing that 'git repack' throws away grafted-away parents

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jul 23, 2009, 15:33 UTC
Message-ID
<alpine.DEB.1.00.0907231733300.8306@pacific.mpi-cbg.de>
In-Reply-To
<cover.1248362827u.git.johannes.schindelin@gmx.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
	Bjoern said that the reflogs are not thrown away if there is no 
	"sleep 1" (which I turned into "test-chmtime -1 .git/logs/HEAD
	.git/logs/refs/heads/master" only to delete it as things worked 
	here without it).
 t/t7700-repack.sh |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/t/t7700-repack.sh b/t/t7700-repack.sh
index 87c9b0e..a4dddb7 100755
--- a/t/t7700-repack.sh
+++ b/t/t7700-repack.sh
@@ -149,5 +149,17 @@ test_expect_success 'local packed unreachable obs that exist in alternate ODB ar
 	test_must_fail git show $csha1
 '
 
+test_expect_failure 'objects made unreachable by grafts only are kept' '
+	test_tick &&
+	git commit --allow-empty -m "commit 4" &&
+	H0=$(git rev-parse HEAD) &&
+	H1=$(git rev-parse HEAD^) &&
+	H2=$(git rev-parse HEAD^^) &&
+	echo "$H0 $H2" > .git/info/grafts &&
+	git reflog expire --expire=now --expire-unreachable=now --all &&
+	git repack -a -d &&
+	git cat-file -t $H1
+	'
+
 test_done
 
-- 
1.6.4.rc1.289.gf87df
Previous: Johannes SchindelinNext: Björn Steinbrink
Message 2 of 10 in “Make git-gc more robust with regard to grafts”
  1. 0/2 Make git-gc more robust with regard to graftsJohannes Schindelin, Jul 23, 2009
  2. 1/2 Add a test showing that 'git repack' throws away grafted-away parentsJohannes Schindelin, Jul 23, 2009
  3. Björn SteinbrinkJul 23, 2009
  4. 2/2 git repack: keep commits hidden by a graftJohannes Schindelin, Jul 23, 2009
  5. Junio C HamanoJul 24, 2009
  6. Johannes SchindelinJul 24, 2009
  7. Junio C HamanoJul 24, 2009
  8. Björn SteinbrinkJul 24, 2009
  9. Johannes SchindelinJul 24, 2009
  10. Junio C HamanoJul 24, 2009

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.