From: Johannes Sixt Date: Thu, 19 Jun 2008 08:11:35 GMT Subject: Re: git diff --cc bug Message-ID: <485A14B7.8080807@viscovery.net> In-Reply-To: <7vhcbpx6bq.fsf@gitster.siamese.dyndns.org> Junio C Hamano schrieb: > The problem is that the internal data structure hooks the deleted lines in > front of the surviving line that follows it. That means that showing the > sline[] that holds "void CValuesView::" will show the unwanted "-LRESULT" > deletion part as part of it. > > You can view this in action by running "git diff -U2" in your tarball > repository. By reducing the context to 2, the leading edge context now > begins at the opening brace after "void CValuesView::" line, which does > not have deletion lines in front of it, so you will see what you expect. > > This patch would fix it for the sample repository, but I am not sure if it > has unintended side effects. I can verify that it fixes the case in hands as well as a "symmetric" one where the accidentally visible deletion is against the first parent, i.e. it looks like "- delete_me" instead of the " -delete_me" above. I also did some brief tests with various "normal" conflict diffs, and looked at a number of merges in my repository, and I noticed nothing odd with this patch. So: Tested-by: Johannes Sixt -- Hannes