Browse Source

Merge branch 'mz/doc-notes-are-not-anchors'

Objects that lost references can be pruned away, even when they
have notes attached to it (and these notes will become dangling,
which in turn can be pruned with "git notes prune").  This has been
clarified in the documentation.

* mz/doc-notes-are-not-anchors:
  docs: clarify that refs/notes/ do not keep the attached objects alive
maint
Junio C Hamano 4 years ago
parent
commit
d590ae5560
  1. 14
      Documentation/git-gc.txt

14
Documentation/git-gc.txt

@ -117,12 +117,14 @@ NOTES
'git gc' tries very hard not to delete objects that are referenced 'git gc' tries very hard not to delete objects that are referenced
anywhere in your repository. In particular, it will keep not only anywhere in your repository. In particular, it will keep not only
objects referenced by your current set of branches and tags, but also objects referenced by your current set of branches and tags, but also
objects referenced by the index, remote-tracking branches, notes saved objects referenced by the index, remote-tracking branches, reflogs
by 'git notes' under refs/notes/, reflogs (which may reference commits (which may reference commits in branches that were later amended or
in branches that were later amended or rewound), and anything else in rewound), and anything else in the refs/* namespace. Note that a note
the refs/* namespace. If you are expecting some objects to be deleted (of the kind created by 'git notes') attached to an object does not
and they aren't, check all of those locations and decide whether it contribute in keeping the object alive. If you are expecting some
makes sense in your case to remove those references. objects to be deleted and they aren't, check all of those locations
and decide whether it makes sense in your case to remove those
references.


On the other hand, when 'git gc' runs concurrently with another process, On the other hand, when 'git gc' runs concurrently with another process,
there is a risk of it deleting an object that the other process is using there is a risk of it deleting an object that the other process is using

Loading…
Cancel
Save