Re: [PATCH 1/2] remote: defer repacking packed-refs when deleting refs

2014-05-27 Thread Junio C Hamano
Jens Lindström writes: >> Puzzled > > There is one reason why one would want to call delete_ref() even if > the ref itself was already fully deleted by repack_without_refs() > (because it was only packed) and that is that delete_ref() also > removes the ref log, if there is one. Ahh, ok, no

Re: [PATCH 1/2] remote: defer repacking packed-refs when deleting refs

2014-05-24 Thread Jens Lindström
On Fri, May 23, 2014 at 7:09 PM, Junio C Hamano wrote: > Jens Lindström writes: >> One additional change was required in >> builtin/remote.c:remove_branches(). It used to pass in the expected >> SHA-1 of the ref to delete_ref(), which only works if the ref exists. >> If repack_without_refs() is

Re: [PATCH 1/2] remote: defer repacking packed-refs when deleting refs

2014-05-23 Thread Junio C Hamano
Jens Lindström writes: > Removing the remote configuration (I assume you mean the > "remote." section from .git/config) last in 'remote rm' would be > a bit better I think. Especially ... Yes, that is exactly why I suggested it ;-) > Doing the repacking first and then run through and delete lo

Re: [PATCH 1/2] remote: defer repacking packed-refs when deleting refs

2014-05-23 Thread Jens Lindström
On Tue, May 20, 2014 at 10:29 PM, Junio C Hamano wrote: > Junio C Hamano writes: > >> A bit safer way to organize might be to first create a list of the >> refs to be removed in-core, update packed-refs without these refs to >> be removed, and then finally remove the loose ones, but I haven't >>

Re: [PATCH 1/2] remote: defer repacking packed-refs when deleting refs

2014-05-20 Thread Junio C Hamano
Junio C Hamano writes: > A bit safer way to organize might be to first create a list of the > refs to be removed in-core, update packed-refs without these refs to > be removed, and then finally remove the loose ones, but I haven't > thought things through. Perhaps a removal of remote can go in t

Re: [PATCH 1/2] remote: defer repacking packed-refs when deleting refs

2014-05-20 Thread Junio C Hamano
Jens Lindström writes: > When 'git remote rm' or 'git remote prune' were used in a repository > with many refs, and needed to delete many refs, a lot of time was spent > deleting those refs since for each deleted ref, repack_without_refs() > was called to rewrite packed-refs without just that del

[PATCH 1/2] remote: defer repacking packed-refs when deleting refs

2014-05-20 Thread Jens Lindström
When 'git remote rm' or 'git remote prune' were used in a repository with many refs, and needed to delete many refs, a lot of time was spent deleting those refs since for each deleted ref, repack_without_refs() was called to rewrite packed-refs without just that deleted ref. To avoid this, defer t