Re: [PATCH v10 33/40] environment: add set_index_file()

2016-08-11 Thread Junio C Hamano
Christian Couder writes: > Yeah, it is feasible and perhaps even simpler using > hold_lock_file_for_update() than with set_index_file(), so I > dropped the set_index_file() patch and added a new one that uses > hold_lock_file_for_update(). I wasn't paying too close

Re: [PATCH v10 33/40] environment: add set_index_file()

2016-08-11 Thread Christian Couder
On Wed, Aug 10, 2016 at 7:34 PM, Junio C Hamano wrote: > Christian Couder writes: > >>> Isn't the mention on NO_THE_INDEX_COMPATIBILITY_MACROS in the added >>> comments (there are two) pure red-herring? >> >> Yeah, true. >> >> So do you want me to

Re: [PATCH v10 33/40] environment: add set_index_file()

2016-08-10 Thread Christian Couder
On Tue, Aug 9, 2016 at 12:13 AM, Junio C Hamano wrote: > Christian Couder writes: > >> Now if someone really needs to use this new function, it should be >> used like this: >> >> /* Save current index file */ >> old_index_file =

Re: [PATCH v10 33/40] environment: add set_index_file()

2016-08-10 Thread Junio C Hamano
Christian Couder writes: >> Isn't the mention on NO_THE_INDEX_COMPATIBILITY_MACROS in the added >> comments (there are two) pure red-herring? > > Yeah, true. > > So do you want me to refactor the code to use > hold_lock_file_for_update() instead of hold_locked_index()

Re: [PATCH v10 33/40] environment: add set_index_file()

2016-08-08 Thread Junio C Hamano
Christian Couder writes: > Now if someone really needs to use this new function, it should be > used like this: > > /* Save current index file */ > old_index_file = get_index_file(); > set_index_file((char *)tmp_index_file); > > /* Do stuff that will

[PATCH v10 33/40] environment: add set_index_file()

2016-08-08 Thread Christian Couder
Introduce set_index_file() to be able to temporarily change the index file. Yeah, this is a short cut and this new function should not be used by other code. It adds a small technical debt, because unfortunately a very big technical debt already exists as the apply code and a lot of other