Re: [PATCH 07/23] expire_reflog(): use a lock_file for rewriting the reflog file

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

 



Michael Haggerty <mhagger@xxxxxxxxxxxx> writes:

> This isn't documented very well. I thought I saw a comment somewhere in
> the code that stated it explicitly, but I can't find it now. In any
> case, my understanding of the locking protocol for reflogs is:
>
>     The reflog for "$refname", which is stored at
>     "$GIT_DIR/logs/$refname", is locked by holding
>     "$GIT_DIR/refs/$refname.lock", *even if the corresponding
>     reference is packed*.
>
> This implies that readers, who don't pay attention to locks, have to be
> prepared for the possibility that the reflog is in the middle of an
> update and that the last line is incomplete. This is handled by
> show_one_reflog_ent(), which discards incomplete lines.

Interesting, as I think I saw Peff did something around that area
recently.

I have some more thought around the "transaction" in general, but
it will be in a separate message.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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]