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

2014-07-16 Thread Junio C Hamano
Duy Nguyen 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" wi

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 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 until we ren

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

2014-07-15 Thread Junio C Hamano
Duy Nguyen 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 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 >> > upd

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

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

2014-07-14 Thread Junio C Hamano
On Mon, Jul 14, 2014 at 7:15 PM, Duy Nguyen 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 if the cach

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 wrote: > Ramsay Jones writes: > >> On 14/07/14 18:51, Junio C Hamano wrote: >>> Ramsay Jones writes: >>> that the merge commit 7608c87e fails. Looking at the details of the merge resolution, made me think of Duy's split index work. >>> >>

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 writes: > > > On 14/07/14 18:51, Junio C Hamano wrote: > >> Ramsay Jones writes: > >> > >>> that the merge commit 7608c87e fails. Looking at the details of the > >>> merge resolution, made me think of Duy's split index work

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

2014-07-14 Thread Junio C Hamano
Ramsay Jones writes: > On 14/07/14 18:51, Junio C Hamano wrote: >> Ramsay Jones 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-r

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

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

2014-07-14 Thread Junio C Hamano
Ramsay Jones 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 able to say "here is the fi

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

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

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 writes: > >> On Sat, Jul 12, 2014 at 11:44 AM, David Turner >> wrote: >>> @@ -342,6 +342,15 @@ static char *prepare_index(int argc, const char >>> **argv, const char *prefix, >>> >>> discard_cache(); >>> read

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

2014-07-14 Thread Junio C Hamano
Duy Nguyen writes: > On Sat, Jul 12, 2014 at 11:44 AM, David Turner > 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); >> +

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 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 (update_main_cache_tree(WRIT

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

2014-07-11 Thread David Turner
During the commit process, update the cache-tree. Write this updated cache-tree so that it's ready for subsequent commands. Add test code which demonstrates that git commit now writes the cache tree. Make all tests test the entire cache-tree, not just the root level. Signed-off-by: David Turner