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

git repack -A -d doesn't remove objects found in alternates?

From
Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Date
Sep 17, 2021, 08:56 UTC
Message-ID
<20210917085623.rjpmqqhb5xap26jd@pengutronix.de>
Hello,

I wonder if I do something wrong, or if I just don't understand something:

	ukl@dude04:~/work$ git version
	git version 2.30.2
	ukl@dude04:~/work$ git clone https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
	...
	ukl@dude04:~/work$ cd linux/
	ukl@dude04:~/work/linux$ du -sh .git/objects
	2.6G    .git/objects
	ukl@dude04:~/work/linux$ echo "/ptx/work/user/git/linux.git/objects" > .git/objects/info/alternates
	ukl@dude04:~/work/linux$ git repack -A -d
	...
	ukl@dude04:~/work/linux$ du -sh .git/objects/
	2.6G	.git/objects/

I would have expected a drastic size decrease from git repack after the alternate is added. Compare with:

	ukl@dude04:~/work$ time git clone --reference /ptx/work/user/git/linux.git https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git linux-with-reference
	Cloning into 'linux-with-reference'...
	Updating files: 100% (73605/73605), done.
	ukl@dude04:~/work$ du -sh linux-with-reference/.git/objects/
	4.0K	linux-with-reference/.git/objects/
Can you spot the bug (or the wrong expectation)?

Thanks Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |
Next: Bryan Turner
Message 1 of 3 in “git repack -A -d doesn't remove objects found in alternates?”
  1. Uwe Kleine-KönigSep 17, 2021
  2. Bryan TurnerSep 17, 2021
  3. Uwe Kleine-KönigSep 17, 2021

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.