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

Re: [PATCH v2] repack: do not rebuild packs on --dry-run

From
Patrick Steinhardt <ps@pks.im>
Date
Oct 13, 2026, 11:30 UTC
Message-ID
<as4WY96-KXQT_PTc@pks.im>
In-Reply-To
<20261010210050.76064-1-r.siddharth.shrimali@gmail.com>
On Sun, Oct 11, 2026 at 02:30:50AM +0530, Siddharth Shrimali wrote:
Show 25 quoted lines
>  builtin/repack.c                |  7 +++++++
>  t/t7706-repack-drop-filtered.sh | 19 +++++++++++++++++++
>  2 files changed, 26 insertions(+)
> 
> diff --git a/builtin/repack.c b/builtin/repack.c
> index c4360382c1..7797972642 100644
> --- a/builtin/repack.c
> +++ b/builtin/repack.c
> @@ -387,14 +387,21 @@ int cmd_repack(int argc,
>  		if (dry_run) {
>  			struct oidset_iter iter;
>  			const struct object_id *oid;
>  
>  			oidset_iter_init(&drop_oids, &iter);
>  			while ((oid = oidset_iter_next(&iter)))
>  				printf("%s\n", oid_to_hex(oid));
> +
> +			/*
> +			 * Only list the candidates to be dropped; skip
> +			 * the actual repack
> +			 */
> +			ret = 0;
> +			goto cleanup;
>  		}
>  	}
Okay, makes sense. I wonder though, we later have a check like this:
	if (pack_everything & ALL_INTO_ONE) {
		repack_promisor_objects(repo, &po_args, &names, packtmp,
			(drop_filtered && !dry_run) ? &drop_oids : NULL);
Is the `!dry_run` check redundant now because of the above early exit?
Patrick
Previous: Junio C HamanoNext: Siddharth Shrimali
Message 9 of 14 in “repack: do not rebuild packs on --dry-run”
  1. repack: do not rebuild packs on --dry-runSiddharth Shrimali, Oct 8, 2026
  2. D. Ben KnobleOct 8, 2026
  3. Siddharth ShrimaliOct 10, 2026
  4. Junio C HamanoOct 8, 2026
  5. Siddharth ShrimaliOct 10, 2026
  6. repack: do not rebuild packs on --dry-runSiddharth Shrimali, Oct 10, 2026
  7. Ben KnobleOct 10, 2026
  8. Junio C HamanoOct 11, 2026
  9. Patrick SteinhardtOct 13, 2026
  10. Siddharth ShrimaliOct 16, 2026
  11. repack: do not rebuild packs on --dry-runSiddharth Shrimali, Oct 16, 2026
  12. Junio C HamanoOct 16, 2026
  13. Siddharth ShrimaliOct 17, 2026
  14. Patrick SteinhardtOct 19, 2026

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.