Skip to content

fsck --connectivity-only --dangling

Jeff King git 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest2 patches 0 repliesNew

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2doc/fsck: clarify --connectivity-only behaviorDocumentation/git-fsck.txt+7 -30 replies
2/2fsck: always compute USED flags for unreachable objectsDocumentation/git-fsck.txt builtin/fsck.c t/t1450-fsck.sh+83 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/2] fsck --connectivity-only --dangling
Quoted 13 lines · Jeff King
Quoted 6 lines
Quoted 2 lines

So I sketched up what it might look like to just fix the bug (but kick in only when needed), which is below.

As the primariy purose of the --conn-only option being such, perhaps we should have made --no-dangling the default when --conn-only is in effect.

Yes, perhaps. Though after thinking on this for a few days, I actually think there is no real reason not to just have --dangling do the right thing here (and we're still much faster than a full fsck, and not much slower than the current code unless you happen to have a large number of unreachable commits and trees).

Quoted 5 lines

And then if the user says "--no-dangling", we can be even faster (i.e., the same as the current code).

We could also make "--no-dangling" the default for "--connectivity-only", though I do not have a strong feeling either way.

So here's a re-rolled series. The first patch just clarifies how --connectivity-only works, since there are a few subtle points that came up in this thread.

The second one is my fix from before. That lets us drop the initial "explain why it doesn't work" documentation patch, though I did add a note to the documentation pointing the user to --no-dangling.

[1/2]: doc/fsck: clarify --connectivity-only behavior [2/2]: fsck: always compute USED flags for unreachable objects

 Documentation/git-fsck.txt | 14 +++++++--
 builtin/fsck.c             | 62 ++++++++++++++++++++++++++++++++++++++
 t/t1450-fsck.sh            | 19 ++++++++++--
 3 files changed, 90 insertions(+), 5 deletions(-)

-Peff