Re: [PATCH 10/23] files_ref_store: put the packed files lock directly in this struct

2017-05-18 Thread Michael Haggerty
On 05/17/2017 07:18 PM, Stefan Beller wrote: > On Wed, May 17, 2017 at 6:17 AM, Jeff King wrote: >> On Wed, May 17, 2017 at 02:05:33PM +0200, Michael Haggerty wrote: >> >>> Instead of using a global `lock_file` instance for the main >>> "packed-refs" file and using a pointer in `files_ref_store` t

Re: [PATCH 10/23] files_ref_store: put the packed files lock directly in this struct

2017-05-18 Thread Brandon Williams
On 05/17, Jeff King wrote: > On Wed, May 17, 2017 at 05:17:17PM -0700, Brandon Williams wrote: > > > > This made me wonder how we handle the locking for ref_stores besides the > > > main one (e.g., for submodules). The lockfile structs have to remain > > > valid for the length of the program. Prev

Re: [PATCH 10/23] files_ref_store: put the packed files lock directly in this struct

2017-05-17 Thread Jeff King
On Wed, May 17, 2017 at 05:17:17PM -0700, Brandon Williams wrote: > > This made me wonder how we handle the locking for ref_stores besides the > > main one (e.g., for submodules). The lockfile structs have to remain > > valid for the length of the program. Previously those stores could have > > xc

Re: [PATCH 10/23] files_ref_store: put the packed files lock directly in this struct

2017-05-17 Thread Brandon Williams
On 05/17, Stefan Beller wrote: > On Wed, May 17, 2017 at 6:17 AM, Jeff King wrote: > > On Wed, May 17, 2017 at 02:05:33PM +0200, Michael Haggerty wrote: > > > >> Instead of using a global `lock_file` instance for the main > >> "packed-refs" file and using a pointer in `files_ref_store` to keep > >

Re: [PATCH 10/23] files_ref_store: put the packed files lock directly in this struct

2017-05-17 Thread Brandon Williams
On 05/17, Jeff King wrote: > On Wed, May 17, 2017 at 02:05:33PM +0200, Michael Haggerty wrote: > > > Instead of using a global `lock_file` instance for the main > > "packed-refs" file and using a pointer in `files_ref_store` to keep > > track of whether it is locked, embed the `lock_file` instance

Re: [PATCH 10/23] files_ref_store: put the packed files lock directly in this struct

2017-05-17 Thread Stefan Beller
On Wed, May 17, 2017 at 6:17 AM, Jeff King wrote: > On Wed, May 17, 2017 at 02:05:33PM +0200, Michael Haggerty wrote: > >> Instead of using a global `lock_file` instance for the main >> "packed-refs" file and using a pointer in `files_ref_store` to keep >> track of whether it is locked, embed the

Re: [PATCH 10/23] files_ref_store: put the packed files lock directly in this struct

2017-05-17 Thread Michael Haggerty
On 05/17/2017 03:17 PM, Jeff King wrote: > On Wed, May 17, 2017 at 02:05:33PM +0200, Michael Haggerty wrote: > >> Instead of using a global `lock_file` instance for the main >> "packed-refs" file and using a pointer in `files_ref_store` to keep >> track of whether it is locked, embed the `lock_fil

Re: [PATCH 10/23] files_ref_store: put the packed files lock directly in this struct

2017-05-17 Thread Jeff King
On Wed, May 17, 2017 at 02:05:33PM +0200, Michael Haggerty wrote: > Instead of using a global `lock_file` instance for the main > "packed-refs" file and using a pointer in `files_ref_store` to keep > track of whether it is locked, embed the `lock_file` instance directly > in the `files_ref_store`

[PATCH 10/23] files_ref_store: put the packed files lock directly in this struct

2017-05-17 Thread Michael Haggerty
Instead of using a global `lock_file` instance for the main "packed-refs" file and using a pointer in `files_ref_store` to keep track of whether it is locked, embed the `lock_file` instance directly in the `files_ref_store` struct and use the new `is_lock_file_locked()` function to keep track of wh