GC can lose objects pointed to only by notes?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>From the "NOTES" section in `git help gc`:
"[...] it will keep [..] objects referenced by the index,
remote-tracking branches, notes saved by git notes under refs/notes/"

I had interpreted that as saying that it will keep objects pointed to
by notes saved under refs/notes. I had a repo with lots of commits
referred to only by notes. When I ran `git gc`, the commits they
pointed to were deleted (I had a backup, so no big deal). I now
understand that the documentation actually meant that "objects
referenced by the index and remote-tracking branches, as well as notes
saved by git notes under refs/notes/" are kept.

It seems that the documentation should at least be clarified. I had
read the documentation before I decided to rely on notes for keeping
my commits alive (which I now know was a mistake). I'll make sure to
add refs pointing directly to my commits instead now. I can send a
patch for the documentation unless someone else beats me to it (it's
been a while since my last patch for git, so it'll take some time for
me to get set up).

For a while, I also thought that `git gc` should be updated to also
keep objects with notes attached. However, as far as I understand, the
notes refs are never rewritten/rewound (only fast-forwarded), which
means that you would never be able to get rid of the old commits in
that case (just like you're already not able to get rid of old notes).
So I understand that you probably don't want to make that change.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux