Re: git diff woes
- From
Andreas Ericsson <ae@op5.se>
- Date
- Nov 13, 2007, 00:03 UTC
- Message-ID
- <4738E9E6.2040001@op5.se>
- In-Reply-To
- <7vhcjr2lte.fsf@gitster.siamese.dyndns.org>
Junio C Hamano wrote:
Show 29 quoted lines
> Andreas Ericsson <ae@op5.se> writes:
>
>> In the check_ntpd.c program, there is no bug. I found the git diff output
>> surprising, so I reported it.
>
> This is what I get from "GNU diff -pu" which makes me surpried
> that anybody finds "git diff" hunk header surprising. Notice
> that hunk at line 84.
>
> --- read-cache.c 2007-11-12 12:08:00.000000000 -0800
> +++ read-cache.c+ 2007-11-12 12:07:54.000000000 -0800
> @@ -60,7 +60,7 @@ static int ce_compare_data(struct cache_
> return match;
> }
>
> -static int ce_compare_link(struct cache_entry *ce, size_t expected_size)
> +static int ce_compare_lonk(struct cache_entry *ce, size_t expected_size)
> {
> int match = -1;
> char *target;
> @@ -84,7 +84,7 @@ static int ce_compare_link(struct cache_
> match = memcmp(buffer, target, size);
> free(buffer);
> free(target);
> - return match;
> + return match + 0;
> }
>
> static int ce_compare_gitlink(struct cache_entry *ce)I notice it, and I don't like it. I guess I'm just used to git being smarter than their GNU tool equivalents, especially since it only ever applies patches in full.
I have a patch ready to make it configurable but it lacks doc updates and tests, so I'll send it tomorrow morning when I've had time to fiddle a bit with that.
-- Andreas Ericsson andreas.ericsson@op5.se OP5 AB www.op5.se Tel: +46 8-230225 Fax: +46 8-230231