Re: [PATCH v8 4/4] cache-tree: Write updated cache-tree after commit

2014-07-16 Thread Duy Nguyen
On Tue, Jul 15, 2014 at 11:45 PM, Junio C Hamano gits...@pobox.com wrote: What is the real point of writing into *.lock and renaming? It serves two purposes: (1) everybody adheres to that convention---if we managed to take the lock index.lock, nobody else will compete and interfere with us

Re: [PATCH v8 4/4] cache-tree: Write updated cache-tree after commit

2014-07-16 Thread Junio C Hamano
Duy Nguyen pclo...@gmail.com writes: If you do not use the extra temporary file, you start from index.lock left by add -i, write the updated index into index.lock and if you fail to write, you have to roll back the entire index---you lose the option to use the index left by add -i

Re: [PATCH v8 4/4] cache-tree: Write updated cache-tree after commit

2014-07-15 Thread Junio C Hamano
On Mon, Jul 14, 2014 at 7:15 PM, Duy Nguyen pclo...@gmail.com wrote: It makes me wonder if a cleaner way of rebuilding cache-treei in this case is from git-add--interactive.perl, or by simply spawn git update-index --rebuild-cache-tree after running git-add--interactive.perl. We could check

Re: [PATCH v8 4/4] cache-tree: Write updated cache-tree after commit

2014-07-15 Thread Duy Nguyen
On Mon, Jul 14, 2014 at 11:38:06PM -0700, Junio C Hamano wrote: On Mon, Jul 14, 2014 at 7:15 PM, Duy Nguyen pclo...@gmail.com wrote: It makes me wonder if a cleaner way of rebuilding cache-treei in this case is from git-add--interactive.perl, or by simply spawn git update-index

Re: [PATCH v8 4/4] cache-tree: Write updated cache-tree after commit

2014-07-15 Thread Junio C Hamano
Duy Nguyen pclo...@gmail.com writes: On Mon, Jul 14, 2014 at 11:38:06PM -0700, Junio C Hamano wrote: On Mon, Jul 14, 2014 at 7:15 PM, Duy Nguyen pclo...@gmail.com wrote: It makes me wonder if a cleaner way of rebuilding cache-treei in this case is from git-add--interactive.perl, or by

Re: [PATCH v8 4/4] cache-tree: Write updated cache-tree after commit

2014-07-14 Thread Junio C Hamano
Duy Nguyen pclo...@gmail.com writes: On Sat, Jul 12, 2014 at 11:44 AM, David Turner dtur...@twopensource.com wrote: @@ -342,6 +342,15 @@ static char *prepare_index(int argc, const char **argv, const char *prefix, discard_cache();

Re: [PATCH v8 4/4] cache-tree: Write updated cache-tree after commit

2014-07-14 Thread Ramsay Jones
On 14/07/14 16:54, Junio C Hamano wrote: Duy Nguyen pclo...@gmail.com writes: On Sat, Jul 12, 2014 at 11:44 AM, David Turner dtur...@twopensource.com wrote: @@ -342,6 +342,15 @@ static char *prepare_index(int argc, const char **argv, const char *prefix, discard_cache();

Re: [PATCH v8 4/4] cache-tree: Write updated cache-tree after commit

2014-07-14 Thread Junio C Hamano
Junio C Hamano gits...@pobox.com writes: Duy Nguyen pclo...@gmail.com writes: On Sat, Jul 12, 2014 at 11:44 AM, David Turner dtur...@twopensource.com wrote: @@ -342,6 +342,15 @@ static char *prepare_index(int argc, const char **argv, const char *prefix, discard_cache();

Re: [PATCH v8 4/4] cache-tree: Write updated cache-tree after commit

2014-07-14 Thread Junio C Hamano
Ramsay Jones ram...@ramsay1.demon.co.uk writes: that the merge commit 7608c87e fails. Looking at the details of the merge resolution, made me think of Duy's split index work. Yes, there is a deliberately dropped hunk from dt/cache-tree-repair in that merge, because the topic relied on being

Re: [PATCH v8 4/4] cache-tree: Write updated cache-tree after commit

2014-07-14 Thread Ramsay Jones
On 14/07/14 18:51, Junio C Hamano wrote: Ramsay Jones ram...@ramsay1.demon.co.uk writes: that the merge commit 7608c87e fails. Looking at the details of the merge resolution, made me think of Duy's split index work. Yes, there is a deliberately dropped hunk from dt/cache-tree-repair in

Re: [PATCH v8 4/4] cache-tree: Write updated cache-tree after commit

2014-07-14 Thread Junio C Hamano
Ramsay Jones ram...@ramsay1.demon.co.uk writes: On 14/07/14 18:51, Junio C Hamano wrote: Ramsay Jones ram...@ramsay1.demon.co.uk writes: that the merge commit 7608c87e fails. Looking at the details of the merge resolution, made me think of Duy's split index work. Yes, there is a

Re: [PATCH v8 4/4] cache-tree: Write updated cache-tree after commit

2014-07-14 Thread David Turner
On Mon, 2014-07-14 at 15:16 -0700, Junio C Hamano wrote: Ramsay Jones ram...@ramsay1.demon.co.uk writes: On 14/07/14 18:51, Junio C Hamano wrote: Ramsay Jones ram...@ramsay1.demon.co.uk writes: that the merge commit 7608c87e fails. Looking at the details of the merge resolution, made

Re: [PATCH v8 4/4] cache-tree: Write updated cache-tree after commit

2014-07-14 Thread Duy Nguyen
On Tue, Jul 15, 2014 at 5:16 AM, Junio C Hamano gits...@pobox.com wrote: Ramsay Jones ram...@ramsay1.demon.co.uk writes: On 14/07/14 18:51, Junio C Hamano wrote: Ramsay Jones ram...@ramsay1.demon.co.uk writes: that the merge commit 7608c87e fails. Looking at the details of the merge

Re: [PATCH v8 4/4] cache-tree: Write updated cache-tree after commit

2014-07-12 Thread Duy Nguyen
On Sat, Jul 12, 2014 at 11:44 AM, David Turner dtur...@twopensource.com wrote: @@ -342,6 +342,15 @@ static char *prepare_index(int argc, const char **argv, const char *prefix, discard_cache(); read_cache_from(index_lock.filename); + if