Re: [PATCH v2 1/3] merge: setup `opts` later in `checkout_fast_forward()`

2018-05-17 Thread Jacob Keller
On Thu, May 17, 2018 at 2:48 PM, Junio C Hamano wrote: > Martin Ågren writes: > >> After we initialize the various fields in `opts` but before we actually >> use them, we might return early. Move the initialization further down, >> to immediately before

Re: [PATCH v2 1/3] merge: setup `opts` later in `checkout_fast_forward()`

2018-05-17 Thread Junio C Hamano
Martin Ågren writes: > After we initialize the various fields in `opts` but before we actually > use them, we might return early. Move the initialization further down, > to immediately before we use `opts`. > > This limits the scope of `opts` and will help a later commit

Re: [PATCH v2 1/3] merge: setup `opts` later in `checkout_fast_forward()`

2018-05-16 Thread Jacob Keller
On Wed, May 16, 2018 at 12:29 PM, Martin Ågren wrote: > On 16 May 2018 at 18:41, Stefan Beller wrote: >> On Wed, May 16, 2018 at 9:30 AM, Martin Ågren wrote: >>> >>> This patch is best viewed using something like this (note the

Re: [PATCH v2 1/3] merge: setup `opts` later in `checkout_fast_forward()`

2018-05-16 Thread Jacob Keller
On Wed, May 16, 2018 at 9:41 AM, Stefan Beller wrote: > + Jonathan Tan for a side discussion on anchoring. > > On Wed, May 16, 2018 at 9:30 AM, Martin Ågren wrote: >> >> This patch is best viewed using something like this (note the tab!): >>

Re: [PATCH v2 1/3] merge: setup `opts` later in `checkout_fast_forward()`

2018-05-16 Thread Martin Ågren
On 16 May 2018 at 18:41, Stefan Beller wrote: > On Wed, May 16, 2018 at 9:30 AM, Martin Ågren wrote: >> >> This patch is best viewed using something like this (note the tab!): >> --color-moved --anchored=" trees[nr_trees] = parse_tree_indirect" >

Re: [PATCH v2 1/3] merge: setup `opts` later in `checkout_fast_forward()`

2018-05-16 Thread Stefan Beller
+ Jonathan Tan for a side discussion on anchoring. On Wed, May 16, 2018 at 9:30 AM, Martin Ågren wrote: > > This patch is best viewed using something like this (note the tab!): > --color-moved --anchored=" trees[nr_trees] = parse_tree_indirect" Heh! Having a "is

[PATCH v2 1/3] merge: setup `opts` later in `checkout_fast_forward()`

2018-05-16 Thread Martin Ågren
After we initialize the various fields in `opts` but before we actually use them, we might return early. Move the initialization further down, to immediately before we use `opts`. This limits the scope of `opts` and will help a later commit fix a memory leak without having to worry about those