Re: [PATCH 1/2] Delete ref $frotz by moving ref file to "deleted-$frotz~ref".

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Junio C Hamano <junkio@...>
Cc: <git@...>
Date: Tuesday, October 17, 2006 - 12:26 am

Junio C Hamano wrote:

I think that the ref deletion usage depends on the policy of people using 
git, and there may be people that delete a ref very often.

For example, when git becomes a major SCM, there may be people working on 
big projects that want to create a new branch for each new bug and then 
delete the branch when the code on the bug branch has been integrated into 
a new release and the bug is closed.


The operations that inspect project history may use a ref cache or something 
so that a lookup on the disk may not be needed. So only the ref creation or 
update rate versus delete rate may matter.


The lookup code is already using cached packed refs. It could also use 
cached loose and deleted refs, so the lookup penalty would be very very 
small. By the way, the OS may already cache loose and deleted ref file stat 
information, so that may right now be a very small penalty.

And at least, algorythmically speaking, with my patch the deletion path is 
now independent of the number of existing refs, so it's much better (while 
the lookup path stay the same).

If there are thousand of refs and a heavy I/O load, rewritting the packed 
ref file for each deletion means writing on disk something that may not fit 
in the disk cache. It may be very bad.

My patch also has a few added benefits like making it possible to have a 
read only packed ref file, while still letting people delete refs. It also 
make it possible to resurect a deleted ref, or to control branch deletion 
rights on a per ref directory basis (though that may not be very usefull).

And the fact that the packed ref file (which may be read only for added 
safety) is not rewritten each time a ref is deleted make things much safer 
if there are many users working on the same git repository.

Christian.
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH 1/2] Delete ref $frotz by moving ref file to "del..., Christian Couder, (Tue Oct 17, 12:26 am)