Re: [PATCH v2 6/8] refs: add update_refs for multiple simultaneous updates

2013-09-03 Thread Brad King
On 09/03/2013 12:43 AM, Michael Haggerty wrote: > Hmmm, I see that you changed the signature of update_refs() to take an > array of pointers. My suggestion was unclear, but I didn't mean that > the function signature had to be changed. [snip] > However, your approach is also fine. Okay. Thanks f

Re: [PATCH v2 6/8] refs: add update_refs for multiple simultaneous updates

2013-09-02 Thread Michael Haggerty
On 09/02/2013 07:20 PM, Brad King wrote: > On 09/01/2013 02:08 AM, Junio C Hamano wrote: >>> Though the refs themeselves cannot be modified together in a single >> >> "themselves". > > Fixed. > >> I notice that we are using an array of structures and letting qsort >> swap 50~64 bytes of data > >

Re: [PATCH v2 6/8] refs: add update_refs for multiple simultaneous updates

2013-09-02 Thread Brad King
On 08/31/2013 02:19 PM, Michael Haggerty wrote: > s/themeselves/themselves/ Fixed. >> +struct ref_update *u1 = (struct ref_update *)(r1); >> +struct ref_update *u2 = (struct ref_update *)(r2); > > If you declare u1 and u2 to be "const struct ref_update *" (i.e., add > "const"), then you

Re: [PATCH v2 6/8] refs: add update_refs for multiple simultaneous updates

2013-09-02 Thread Brad King
On 09/01/2013 02:08 AM, Junio C Hamano wrote: >> Though the refs themeselves cannot be modified together in a single > > "themselves". Fixed. > I notice that we are using an array of structures and letting qsort > swap 50~64 bytes of data Michael suggested this too, so fixed. > Optionally we c

Re: [PATCH v2 6/8] refs: add update_refs for multiple simultaneous updates

2013-08-31 Thread Junio C Hamano
Brad King writes: > Add 'struct ref_update' to encode the information needed to update or > delete a ref (name, new sha1, optional old sha1, no-deref flag). Add > function 'update_refs' accepting an array of updates to perform. First > sort the input array to order locks consistently everywhere

Re: [PATCH v2 6/8] refs: add update_refs for multiple simultaneous updates

2013-08-31 Thread Michael Haggerty
On 08/30/2013 08:12 PM, Brad King wrote: > Add 'struct ref_update' to encode the information needed to update or > delete a ref (name, new sha1, optional old sha1, no-deref flag). Add > function 'update_refs' accepting an array of updates to perform. First > sort the input array to order locks co