From: Petr Baudis Date: Sun, 08 May 2005 16:59:15 GMT Subject: Re: Broken adding of cache entries Message-ID: <20050508165915.GW9495@pasky.ji.cz> In-Reply-To: <7vll6q70mg.fsf@assigned-by-dhcp.cox.net> Dear diary, on Sun, May 08, 2005 at 07:22:31AM CEST, I got a letter where Junio C Hamano told me that... > >>>>> "JCH" == Junio C Hamano writes: > > JCH> I am not quite sure the semantics is quite right, so I am > JCH> holding it off from putting it in git-jc repository for now, but > JCH> please review it, give it a try and tell me what you think. > > Ok, I have two updates pushed out at git-jc archive at > http://members.cox.net/junkio/git-jc.git/ I wanted to merge with you, but I'd like to make some (mostly minor) nitpicks first. Sorry for totally garbled whitespace and everything, this is just gpm. --- e19665d8d42877246ac7e98a7c671d11adbe8b56/read-cache.c (mode:100644) +++ uncommitted/read-cache.c (mode:100644) + char *ep = strchr(cp, '/'); + if (ep == 0) Please use NULL. +static struct alternate_object_database +{ + char *base; + char *name; +} *alt_odb; The commonly accepted style is to have the { bracket on the same line as the struct identifier. Sticking a brief explanation to prepare_alt_odb(), like "pass 0 allocates the array and pass 1 fills it" couldn't hurt, it took me a while of staring at it to figure out. There's also unused @buf variable. But I personally think all this alt_odb code is quite creepy. ;-) --- e19665d8d42877246ac7e98a7c671d11adbe8b56/write-tree.c (mode:100644) +++ uncommitted/write-tree.c (mode:100644) - if (++unmerged > 10) { + if (10 < ++funny) { Do those changes make any sense? The former version is certainly much easier to read for me. I can live with it in the new code, but changing old code to it... With the current update-cache protections, how can you legally achieve a cache with duplicate entries, so that you need to check for that in write-tree? Thanks, -- Petr "Pasky" Baudis Stuff: http://pasky.or.cz/ C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor