Git development
 help / color / mirror / Atom feed
* [PATCH RFC 0/5] Add --dry-run option to git-backfill(1)
@ 2026-09-30  0:21 Pablo Sabater
  2026-09-30  0:21 ` [PATCH RFC 1/5] transport-internal: update fetch_object_info comment Pablo Sabater
                   ` (5 more replies)
  0 siblings, 6 replies; 18+ messages in thread
From: Pablo Sabater @ 2026-09-30  0:21 UTC (permalink / raw)
  To: git; +Cc: Derrick Stolee, Pablo Sabater

[Cc'd Derrick Stolee for his work in the backfill(1) command]

This series adds a --dry-run option to git-backfill(1) that reports how
many missing blobs would be fetched and, when the remote server
supports the object-info capability, their total size:

        $ git backfill --dry-run
        After backfill, 48 blobs would be fetched (1.20 KiB).

If the server does not advertise object-info, only the count is shown.

I am not a git-backfill(1) user myself, but it seemed useful for users
to know how much data a backfill would bring in before running it.

The number of missing blobs is the sum of the number of blobs to be
fetched in each batch. The object-info capability lets us ask the server
for the size of each blob without downloading it, so summing them gives
an estimate of the total.

Note that this is an upper bound rather than the exact disk usage:
object-info reports the uncompressed size of each object, while the
objects end up stored compressed and possibly deltified in a packfile,
so the space actually used on disk will usually be smaller.

Since I do not use backfill, feedback on whether this is useful, and on
the output format, is very welcome.

Patches 1-3 are preparatory:

  [1/5] transport-internal: update fetch_object_info comment
        Fixes an outdated comment: object-info supports type as well as
        size.

  [2/5] fetch-object-info: add enum for fetch_object_info() statuses
  [3/5] fetch-object-info: return a status instead of dying
        Teach fetch_object_info() to return a status instead of dying
        when the server does not advertise object-info. The die() is
        kept in cat-file's remote-object-info path, so its behavior is
        unchanged.

Patches 4-5 add the option in two steps:

  [4/5] backfill: add --dry-run option
        Prints only the number of blobs that would be fetched.

  [5/5] backfill: report total size of missing blobs in --dry-run
        Also prints their total size when the server supports
        object-info, and falls back to the count alone otherwise.

Thanks.

Signed-off-by: Pablo Sabater <pabloosabaterr@gmail.com>
---
Pablo Sabater (5):
      transport-internal: update fetch_object_info comment
      fetch-object-info: add enum for fetch_object_info() statuses
      fetch-object-info: return a status instead of dying
      backfill: add --dry-run option
      backfill: report total size of missing blobs in --dry-run

 Documentation/git-backfill.adoc | 10 ++++-
 builtin/backfill.c              | 97 +++++++++++++++++++++++++++++++++++++++--
 builtin/cat-file.c              |  4 ++
 fetch-object-info.c             | 17 ++++----
 fetch-object-info.h             | 24 +++++++---
 t/t5620-backfill.sh             | 48 ++++++++++++++++++++
 transport-helper.c              |  6 +--
 transport-internal.h            | 12 ++---
 transport.c                     | 29 ++++++------
 transport.h                     |  7 +--
 10 files changed, 208 insertions(+), 46 deletions(-)


---
base-commit: 12cb6293d6288865c1a133cf22accbaf99d13eb6
change-id: 20260914-backfill-dryrun-fac997003322


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2026-09-30 20:03 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-30  0:21 [PATCH RFC 0/5] Add --dry-run option to git-backfill(1) Pablo Sabater
2026-09-30  0:21 ` [PATCH RFC 1/5] transport-internal: update fetch_object_info comment Pablo Sabater
2026-09-30  0:21 ` [PATCH RFC 2/5] fetch-object-info: add enum for fetch_object_info() statuses Pablo Sabater
2026-09-30 10:56   ` Karthik Nayak
2026-09-30 11:59     ` Pablo Sabater
2026-09-30  0:21 ` [PATCH RFC 3/5] fetch-object-info: return a status instead of dying Pablo Sabater
2026-09-30 17:07   ` Junio C Hamano
2026-09-30 18:03     ` Pablo Sabater
2026-09-30 20:01       ` Junio C Hamano
2026-09-30  0:21 ` [PATCH RFC 4/5] backfill: add --dry-run option Pablo Sabater
2026-09-30 11:06   ` Karthik Nayak
2026-09-30 12:19     ` Pablo Sabater
2026-09-30  0:21 ` [PATCH RFC 5/5] backfill: report total size of missing blobs in --dry-run Pablo Sabater
2026-09-30 17:17   ` Junio C Hamano
2026-09-30 18:31     ` Pablo Sabater
2026-09-30 18:14 ` [PATCH RFC 0/5] Add --dry-run option to git-backfill(1) Derrick Stolee
2026-09-30 19:06   ` Pablo Sabater
2026-09-30 20:03   ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox