Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> git-bug store the data in separate references that are not in `refs/head`, so they are not recognized as branches

How does that work with garbage collection?



`git gc` will garbage collect what is not referenced by a ref anymore, including arbitrary references. So it's fine !

As each bug reference the file blob needed, once your delete a bug, `git gc` will clean these blob as well.


`git gc` will also garbage collect any ref that isn't used by a current branch/tag (under refs/heads and refs/tags), the index (staging), originals from filter-branch (refs/originals), and reflogs.

The question isn't whether the data will be garbage collected, but how the active data AVOIDS being garbage collected - git gc only targets a pretty small amount of refs to preserve.


Bugs are referenced at refs/bugs/<id> and refs/remotes/<remote>/bugs/<id> and those are not garbage collected.


I'm not the author (he'll probably comment here in a sec), but if this is a problem, perhaps this project could become a patch to git itself.

I'd be fine running a patched git that knows about bugs. Of course, then I'd want to make it a little more generic, and not care whether I was dealing with an issue tracker, a wiki, etc.


You are wrong about the semantics of git-gc. It will consider for garbage collection all objects that are not referenced, and a reference is everything under refs/*, in addition to the other things you mentioned (index, reflogs etc.).


The documentation on the man page does not make that clear, if explicitly calls out specific ref types - so that makes more sense.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: