Re: git diff --cc bug
- From
Johannes Sixt <j.sixt@viscovery.net>
- Date
- Jun 19, 2008, 08:11 UTC
- Message-ID
- <485A14B7.8080807@viscovery.net>
- In-Reply-To
- <7vhcbpx6bq.fsf@gitster.siamese.dyndns.org>
Junio C Hamano schrieb:
Show 12 quoted lines
> 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 <johannes.sixt@telecom.at>
-- Hannes