[PATCH 1/1] gc.report_missing: report full git path for missing objects

1 view
Skip to first unread message

Rob Browning

unread,
Aug 8, 2025, 8:26:31 PMAug 8
to bup-...@googlegroups.com
Don't demangle unchunked paths, report the entire git path so that,
for example, we'll have some/path/.bupm instead of just some/path when
a .bupm is missing.

Signed-off-by: Rob Browning <r...@defaultvalue.org>
Tested-by: Rob Browning <r...@defaultvalue.org>
---

Proposed for 0.33.x. Noticed while testing some broken saves.

lib/bup/gc.py | 16 +++-------------
1 file changed, 3 insertions(+), 13 deletions(-)

diff --git a/lib/bup/gc.py b/lib/bup/gc.py
index 2e37c395..34f42009 100644
--- a/lib/bup/gc.py
+++ b/lib/bup/gc.py
@@ -68,22 +68,12 @@ def count_objects(dir, verbosity):


def report_missing(ref_name, item, verbosity):
- chunks = item.chunk_path
- if chunks:
- path = chain(item.path, chunks)
- else:
- # Top commit, for example has none.
- if item.path:
- demangled = git.demangle_name(item.path[-1], item.mode)[0]
- path = chain(item.path[:-1], [demangled])
- else:
- path = item.path
ref = path_msg(ref_name)
- path = path_msg(b'/'.join(path))
+ path = path_msg(b'/'.join(chain(item.path, item.chunk_path)))
if item.type == b'tree':
- note_error(f'missing {ref}:{path}/\n')
+ note_error(f'missing {item.oid.hex()} {ref}:{path}/\n')
else:
- note_error(f'missing {ref}:{path}\n')
+ note_error(f'missing {item.oid.hex()} {ref}:{path}\n')


def report_live_item(n, total, ref_name, ref_id, item, verbosity):
--
2.47.2

Rob Browning

unread,
Aug 13, 2025, 7:49:08 PMAug 13
to bup-...@googlegroups.com
Rob Browning <r...@defaultvalue.org> writes:

> Don't demangle unchunked paths, report the entire git path so that,
> for example, we'll have some/path/.bupm instead of just some/path when
> a .bupm is missing.
>
> Signed-off-by: Rob Browning <r...@defaultvalue.org>
> Tested-by: Rob Browning <r...@defaultvalue.org>
> ---
>
> Proposed for 0.33.x. Noticed while testing some broken saves.

Pushed to 0.33.x.

--
Rob Browning
rlb @defaultvalue.org and @debian.org
GPG as of 2011-07-10 E6A9 DA3C C9FD 1FF8 C676 D2C4 C0F0 39E9 ED1B 597A
GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4
Reply all
Reply to author
Forward
0 new messages