Re: [PATCH 4/5] lock_file: make function-local locks non-static

2018-05-09 Thread Junio C Hamano
Martin Ågren writes: > On 9 May 2018 at 18:19, Duy Nguyen wrote: >> On Tue, May 8, 2018 at 8:18 PM, Jeff King wrote: > >>> It should be totally safe. If you look at "struct lock_file", it is now >>> simply a pointer to a tempfile allocated on the heap (in fact, I thought >>> about getting rid o

Re: [PATCH 4/5] lock_file: make function-local locks non-static

2018-05-09 Thread Martin Ågren
On 9 May 2018 at 18:19, Duy Nguyen wrote: > On Tue, May 8, 2018 at 8:18 PM, Jeff King wrote: >> It should be totally safe. If you look at "struct lock_file", it is now >> simply a pointer to a tempfile allocated on the heap (in fact, I thought >> about getting rid of lock_file entirely, but the

Re: [PATCH 4/5] lock_file: make function-local locks non-static

2018-05-09 Thread Duy Nguyen
On Tue, May 8, 2018 at 8:18 PM, Jeff King wrote: > On Mon, May 07, 2018 at 05:24:05PM +0200, Duy Nguyen wrote: > >> - static struct lock_file lock; >> + struct lock_file lock = LOCK_INIT; >> >>> >> >>> Is it really safe to do this? I vaguely remember something about >> >>> (g

Re: [PATCH 4/5] lock_file: make function-local locks non-static

2018-05-08 Thread Jeff King
On Mon, May 07, 2018 at 05:24:05PM +0200, Duy Nguyen wrote: > - static struct lock_file lock; > + struct lock_file lock = LOCK_INIT; > >>> > >>> Is it really safe to do this? I vaguely remember something about > >>> (global) linked list and signal handling which could trigger

Re: [PATCH 4/5] lock_file: make function-local locks non-static

2018-05-07 Thread Martin Ågren
On 7 May 2018 at 17:24, Duy Nguyen wrote: > On Sun, May 6, 2018 at 9:32 PM, Martin Ågren wrote: >> On 6 May 2018 at 19:42, Duy Nguyen wrote: >> Thank you Duy for your comments. How about I write the commit message >> like so: > > +Jeff. Since he made it possible to remove lock file from the glob

Re: [PATCH 4/5] lock_file: make function-local locks non-static

2018-05-07 Thread Duy Nguyen
On Sun, May 6, 2018 at 9:32 PM, Martin Ågren wrote: > On 6 May 2018 at 19:42, Duy Nguyen wrote: >> On Sun, May 6, 2018 at 7:26 PM, Duy Nguyen wrote: >>> On Sun, May 6, 2018 at 4:10 PM, Martin Ågren wrote: These `struct lock_file`s are local to their respective functions and we can dro

Re: [PATCH 4/5] lock_file: make function-local locks non-static

2018-05-06 Thread Martin Ågren
On 6 May 2018 at 19:42, Duy Nguyen wrote: > On Sun, May 6, 2018 at 7:26 PM, Duy Nguyen wrote: >> On Sun, May 6, 2018 at 4:10 PM, Martin Ågren wrote: >>> These `struct lock_file`s are local to their respective functions and we >>> can drop their staticness. >>> - static struct lock_file lo

Re: [PATCH 4/5] lock_file: make function-local locks non-static

2018-05-06 Thread Duy Nguyen
On Sun, May 6, 2018 at 7:26 PM, Duy Nguyen wrote: > On Sun, May 6, 2018 at 4:10 PM, Martin Ågren wrote: >> These `struct lock_file`s are local to their respective functions and we >> can drop their staticness. >> >> Signed-off-by: Martin Ågren >> --- >> apply.c| 2 +- >> builtin

Re: [PATCH 4/5] lock_file: make function-local locks non-static

2018-05-06 Thread Duy Nguyen
On Sun, May 6, 2018 at 4:10 PM, Martin Ågren wrote: > These `struct lock_file`s are local to their respective functions and we > can drop their staticness. > > Signed-off-by: Martin Ågren > --- > apply.c| 2 +- > builtin/describe.c | 2 +- > builtin/difftool.c | 2 +- > b

[PATCH 4/5] lock_file: make function-local locks non-static

2018-05-06 Thread Martin Ågren
These `struct lock_file`s are local to their respective functions and we can drop their staticness. Signed-off-by: Martin Ågren --- apply.c| 2 +- builtin/describe.c | 2 +- builtin/difftool.c | 2 +- builtin/gc.c | 2 +- builtin/merge.c| 4 ++-- builtin