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

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

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

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

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: > >

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:

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

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

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

[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