"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Christian Weisgerber <naddy@mips.inka.de>
Subject:
Re: gotadmin cleanup
To:
gameoftrees@openbsd.org
Date:
Sat, 3 Jul 2021 18:26:34 +0200

Download raw body.

Thread
Stefan Sperling:

> This patch adds a 'gotadmin cleanup' command which removes loose objects
> that are not reachable via references. The goal is to allow users to
> reclaim disk space occupied by objects that are no longer useful.
> See the man page changes included in the patch for details.

I can't really comment on the bulk of the patch.  It seems to work.

After running cleanup on a clone of got.git, git fsck still reports
a number of dangling objects.  I guess those are packed?

> ok?

Some minor corrections:

> --- gotadmin/gotadmin.1
> +++ gotadmin/gotadmin.1
...
> +The options for
> +.Cm gotadmin listpack
                ^^^^^^^^
                cleanup
> +are as follows:

> --- /dev/null
> +++ regress/cmdline/cleanup.sh
...
> +	# cleanup -n should not remove any objects
> +	ls -1 -R $testroot/repo/.git/objects > $testroot/objects-before

There are several instances of "ls -1".  The -1 flag only affects
output to a terminal.  It can be dropped when stdout is redirected
to a file.

> +		if [ "$ret" == "1" ]; then
> +			break
> +		fi

We already replaced "==" with "=" once for better POSIX adherence.
Don't let it sneak back in.

-- 
Christian "naddy" Weisgerber                          naddy@mips.inka.de