Re: [PATCH 2/2] reset: support --mixed --intent-to-add mode

2014-02-05 Thread Junio C Hamano
Duy Nguyen pclo...@gmail.com writes: On Tue, Feb 04, 2014 at 02:25:25PM -0800, Junio C Hamano wrote: Junio C Hamano gits...@pobox.com writes: While I do not have any problem with adding an optional keep lost paths as intent-to-add entries feature, I am not sure why this has to be so

Re: [PATCH 2/2] reset: support --mixed --intent-to-add mode

2014-02-05 Thread Junio C Hamano
Junio C Hamano gits...@pobox.com writes: Duy Nguyen pclo...@gmail.com writes: On Tue, Feb 04, 2014 at 02:25:25PM -0800, Junio C Hamano wrote: Junio C Hamano gits...@pobox.com writes: While I do not have any problem with adding an optional keep lost paths as intent-to-add entries

Re: [PATCH 2/2] reset: support --mixed --intent-to-add mode

2014-02-05 Thread Duy Nguyen
On Thu, Feb 6, 2014 at 1:25 AM, Junio C Hamano gits...@pobox.com wrote: Yes, indeed. I wonder why your new test did not notice it, though ;-) ... and the answer turns out to be that it was not testing the right thing. On top of that faulty version, this will fix it. Yes, write-tree should

Re: [PATCH 2/2] reset: support --mixed --intent-to-add mode

2014-02-05 Thread Junio C Hamano
On Wed, Feb 5, 2014 at 3:48 PM, Duy Nguyen pclo...@gmail.com wrote: No no. I found that duplicate, but I did not suggest removing it because it is needed there.. Hmph, if that is the case, we probably should make it the responsibility of the calling side to actually mark ce-flags with the bit

Re: [PATCH 2/2] reset: support --mixed --intent-to-add mode

2014-02-05 Thread Junio C Hamano
Junio C Hamano gits...@pobox.com writes: On Wed, Feb 5, 2014 at 3:48 PM, Duy Nguyen pclo...@gmail.com wrote: No no. I found that duplicate, but I did not suggest removing it because it is needed there.. Hmph, if that is the case, we probably should make it the responsibility of the calling

Re: [PATCH 2/2] reset: support --mixed --intent-to-add mode

2014-02-04 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy pclo...@gmail.com writes: @@ -128,13 +129,20 @@ static void update_index_from_diff(struct diff_queue_struct *q, one-path); add_cache_entry(ce, ADD_CACHE_OK_TO_ADD |

Re: [PATCH 2/2] reset: support --mixed --intent-to-add mode

2014-02-04 Thread Junio C Hamano
Junio C Hamano gits...@pobox.com writes: While I do not have any problem with adding an optional keep lost paths as intent-to-add entries feature, I am not sure why this has to be so different from the usual add-cache-entry codepath. The if/elseif chain you are touching inside this loop

Re: [PATCH 2/2] reset: support --mixed --intent-to-add mode

2014-02-04 Thread Duy Nguyen
On Tue, Feb 04, 2014 at 02:25:25PM -0800, Junio C Hamano wrote: Junio C Hamano gits...@pobox.com writes: While I do not have any problem with adding an optional keep lost paths as intent-to-add entries feature, I am not sure why this has to be so different from the usual add-cache-entry

[PATCH 2/2] reset: support --mixed --intent-to-add mode

2014-02-03 Thread Nguyễn Thái Ngọc Duy
When --mixed is used, entries could be removed from index if the target ref does not have them. When reset is used in preparation for commit spliting (in a dirty worktree), it could be hard to track what files to be added back. The new option --intent-to-add simplifies it by marking all removed