threads / discuss / 2568

"make test" fails with current HEAD

Subject: "make test" fails with current HEAD

## tl;dr

20 messages between Nov 17, 2005 and Nov 18, 2005.

replies: 19people: 6as markdown or json

Matthias Urlichs· Nov 17, 2005, 15:31 UTC · lore
t4103.sh:
fatal: patch with only garbage at line 30
* FAIL 7: check binary diff with replacement.
        git-checkout master
                 git-apply --check --allow-binary-replacement BF.diff
May I suggest to please run "make test" before pushing? Thanks! ;-)
-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
She balanced dignity on the tip of her nose.
Johannes Schindelin· Nov 17, 2005, 15:52 UTC · re: Matthias Urlichs · lore

Re: "make test" fails with current HEAD

Hi,
On Thu, 17 Nov 2005, Matthias Urlichs wrote:
Show 6 quoted lines
> t4103.sh:
> 
> fatal: patch with only garbage at line 30
> * FAIL 7: check binary diff with replacement.
>         git-checkout master
>                  git-apply --check --allow-binary-replacement BF.diff
Does not fail here.
Did you set your GIT_EXEC_PATH?

Hth, Dscho

Matthias Urlichs· Nov 17, 2005, 16:03 UTC · re: Johannes Schindelin · lore

Re: "make test" fails with current HEAD

Hi,
Johannes Schindelin:
> Does not fail here.
> 
Does fail here...
> Did you set your GIT_EXEC_PATH?
> 
Yes. :-/
I'll dig.
-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
"Today, the theory of evolution is an accepted fact for everyone but
 a fundamentalist minority, whose objections are based not on reasoning
 but on doctrinaire adherence to religious principles."
           [Dr. James D. Watson, winner of the Nobel prize
            for his co-discovery of the structure of DNA]
A Large Angry SCM· Nov 18, 2005, 03:23 UTC · re: Johannes Schindelin · lore

Re: "make test" fails with current HEAD

Fails at home (Suse 9.3) but passes a work (Ubuntu Hoary).
*** t4103-apply-binary.sh ***
*   ok 1: stat binary diff -- should not fail.
*   ok 2: stat binary diff (copy) -- should not fail.
*   ok 3: check binary diff -- should fail.
*   ok 4: check binary diff (copy) -- should fail.
*   ok 5: check incomplete binary diff with replacement -- should fail.
*   ok 6: check incomplete binary diff with replacement (copy) -- should 
fail.
* FAIL 7: check binary diff with replacement.
         git-checkout master
                  git-apply --check --allow-binary-replacement BF.diff
* FAIL 8: check binary diff with replacement (copy).
         git-checkout master
                  git-apply --check --allow-binary-replacement CF.diff
*   ok 9: apply binary diff -- should fail.
*   ok 10: apply binary diff -- should fail.
*   ok 11: apply binary diff (copy) -- should fail.
*   ok 12: apply binary diff (copy) -- should fail.
*   ok 13: apply binary diff without replacement -- should fail.
*   ok 14: apply binary diff without replacement (copy) -- should fail.
* FAIL 15: apply binary diff.
         do_reset
                  git-apply --allow-binary-replacement --index BF.diff &&
                  test -z "$(git-diff --name-status binary)"
* FAIL 16: apply binary diff (copy).
         do_reset
                  git-apply --allow-binary-replacement --index CF.diff &&
                  test -z "$(git-diff --name-status binary)"
* failed 4 among 16 test(s)
make[1]: *** [t4103-apply-binary.sh] Error 1
Johannes Schindelin wrote:
Show 22 quoted lines
> Hi,
> 
> On Thu, 17 Nov 2005, Matthias Urlichs wrote:
> 
>>t4103.sh:
>>
>>fatal: patch with only garbage at line 30
>>* FAIL 7: check binary diff with replacement.
>>        git-checkout master
>>                 git-apply --check --allow-binary-replacement BF.diff
> 
> Does not fail here.
> 
> Did you set your GIT_EXEC_PATH?
> 
> Hth,
> Dscho
> -
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
Johannes Schindelin· Nov 18, 2005, 03:27 UTC · re: A Large Angry SCM · lore

Re: "make test" fails with current HEAD

Hi,
On Thu, 17 Nov 2005, A Large Angry SCM wrote:
Show 12 quoted lines
> Fails at home (Suse 9.3) but passes a work (Ubuntu Hoary).
> 
> *** t4103-apply-binary.sh ***
> *   ok 1: stat binary diff -- should not fail.
> *   ok 2: stat binary diff (copy) -- should not fail.
> *   ok 3: check binary diff -- should fail.
> *   ok 4: check binary diff (copy) -- should fail.
> *   ok 5: check incomplete binary diff with replacement -- should fail.
> *   ok 6: check incomplete binary diff with replacement (copy) -- should fail.
> * FAIL 7: check binary diff with replacement.
>         git-checkout master
>                  git-apply --check --allow-binary-replacement BF.diff

Any chance you investigate this in detail? Like inserting "test_done; exit" right before that test, only running t4103-*, and then executing the command yourself?

Hth, Dscho

Matthias Urlichs· Nov 18, 2005, 07:21 UTC · re: Johannes Schindelin · lore

Re: "make test" fails with current HEAD

Hi,
Johannes Schindelin:
> Any chance you investigate this in detail? Like inserting "test_done; 
> exit" right before that test, only running t4103-*, and then executing
> the command yourself?
> 
Thank you, I know how to debug ;-)
Already in progress.
-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
A life spent in search of the perfect hash brownie is a life well spent.
Junio C Hamano· Nov 18, 2005, 07:30 UTC · re: Matthias Urlichs · lore

Re: "make test" fails with current HEAD

Matthias Urlichs <smurf@smurf.noris.de> writes:
Show 8 quoted lines
> t4103.sh:
>
> fatal: patch with only garbage at line 30
> * FAIL 7: check binary diff with replacement.
>         git-checkout master
>                  git-apply --check --allow-binary-replacement BF.diff
>
> May I suggest to please run "make test" before pushing? Thanks! ;-)

Well, I do, but the thing is, I do not have an access to your particular machine ;-).

I *think* this is the same problem as I fixed tonight with help from LASCM and John Benes, and I'm hoping to push the fix out before going to bed tonight. If you are impatient the patch has already been sent out.

Matthias Urlichs· Nov 18, 2005, 07:51 UTC · re: Junio C Hamano · lore

Re: "make test" fails with current HEAD

Hi,
Junio C Hamano:
Show 5 quoted lines
> > May I suggest to please run "make test" before pushing? Thanks! ;-)
> 
> Well, I do, but the thing is, I do not have an access to your
> particular machine ;-).
> 
*Sigh*.

Sorry about that. It's not you, it's diff 2.8.7 -- which conveniently omits the word "Binary".

>> Files /dev/null and b/file3 differ
Of course, with LANG=de_DE.UTF-8 the situation is worse ...
>> Dateien /dev/null und b/file3 sind verschieden.
... so git-diff-* might want to set LANG=C.
-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
They're only trying to make me LOOK paranoid!
Junio C Hamano· Nov 18, 2005, 08:03 UTC · re: Matthias Urlichs · lore

Re: "make test" fails with current HEAD

Matthias Urlichs <smurf@smurf.noris.de> writes:
>>> Files /dev/null and b/file3 differ
>
> Of course, with LANG=de_DE.UTF-8 the situation is worse ...

And at this point it becomes more and more tempting to have our own internal diff generator, without relying on external diff.

A midway compromise solution would be to detect if either file is binary ourselves and not to call diff but always say "Binary files difer".

Matthias Urlichs· Nov 18, 2005, 08:56 UTC · re: Junio C Hamano · lore

Re: "make test" fails with current HEAD

Hi, Junio C Hamano wrote:
Show 9 quoted lines
> Matthias Urlichs <smurf@smurf.noris.de> writes:
> 
>>>> Files /dev/null and b/file3 differ
>>
>> Of course, with LANG=de_DE.UTF-8 the situation is worse ...
> 
> A midway compromise solution would be to detect if either file
> is binary ourselves and not to call diff but always say "Binary
> files difer".
Actually, there's a better way:

$ diff -u /dev/null /tmp/ra Binary files /dev/null and /tmp/ra differ $ echo $? 2

So the trivial fix is to emit our own "Binary files FOO and BAR differ" line if the exit status is 2.

-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
If a man will go as far as he can see, he will be able to see farther when
he gets there.
Johannes Schindelin· Nov 18, 2005, 10:35 UTC · re: Matthias Urlichs · lore

Re: "make test" fails with current HEAD

Hi,
On Fri, 18 Nov 2005, Matthias Urlichs wrote:
> So the trivial fix is to emit our own "Binary files FOO and BAR differ"
> line if the exit status is 2.
>From my diff man page:
-- snip --
DIAGNOSTICS
       An  exit status of 0 means no differences were found, 1 means some 
       differences were found, and 2 means trouble.
-- snap --
The exit value 2 is ambiguous for at least one version of GNU diff.

Hth, Dscho

Matthias Urlichs· Nov 18, 2005, 10:54 UTC · re: Johannes Schindelin · lore

Re: "make test" fails with current HEAD

Hi,
Johannes Schindelin:
Show 10 quoted lines
> From my diff man page:
> 
> -- snip --
> DIAGNOSTICS
>        An  exit status of 0 means no differences were found, 1 means some 
>        differences were found, and 2 means trouble.
> -- snap --
> 
> The exit value 2 is ambiguous for at least one version of GNU diff.
> 
AFAIK, We have
0 - no difference
1 - produced a reasonable diff
1 - produced a bad diff because binary stuff starts
    after 4096-or-whatever bytes and diff didn't notice
2 - didn't produce a diff -- binary files differ
2 - something else broke

Right now we simply don't consider the second -2- case, because we just successfully wrote the two files in question; there's not *that* much that can fail after that. The second -1- case is sufficiently rare too.

So I still think a "Just write a 'Binary files FOO and BAR differ' line if the exit status is 2" rule would at least fix the current bug with diff 2.8.7.

-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
<Knghtbrd> xtifr - beware of james when he's off his medication  =3D>
Johannes Schindelin· Nov 18, 2005, 11:04 UTC · re: Matthias Urlichs · lore

Re: "make test" fails with current HEAD

Hi,
On Fri, 18 Nov 2005, Matthias Urlichs wrote:
Show 26 quoted lines
> Johannes Schindelin:
> > From my diff man page:
> > 
> > -- snip --
> > DIAGNOSTICS
> >        An  exit status of 0 means no differences were found, 1 means some 
> >        differences were found, and 2 means trouble.
> > -- snap --
> > 
> > The exit value 2 is ambiguous for at least one version of GNU diff.
> > 
> AFAIK, We have
> 0 - no difference
> 1 - produced a reasonable diff
> 1 - produced a bad diff because binary stuff starts
>     after 4096-or-whatever bytes and diff didn't notice
> 2 - didn't produce a diff -- binary files differ
> 2 - something else broke
> 
> Right now we simply don't consider the second -2- case, because we just
> successfully wrote the two files in question; there's not *that* much
> that can fail after that. The second -1- case is sufficiently rare too.
> 
> So I still think a "Just write a 'Binary files FOO and BAR differ' line
> if the exit status is 2" rule would at least fix the current bug with
> diff 2.8.7.
Dunno. Am I the only one with an odd feeling about that?

Ciao, Dscho

Matthias Urlichs· Nov 18, 2005, 11:12 UTC · re: Johannes Schindelin · lore

Re: "make test" fails with current HEAD

Hi,
Johannes Schindelin:
Show 6 quoted lines
> > So I still think a "Just write a 'Binary files FOO and BAR differ' line
> > if the exit status is 2" rule would at least fix the current bug with
> > diff 2.8.7.
> 
> Dunno. Am I the only one with an odd feeling about that?
> 

I don't really like it either, but frankly I'm not going to write a new (or integrate an existing) diff implementation for 1.0 ... you want to do it, feel free. ;-)

-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
BOFH excuse #217:

The MGs ran out of gas.
Linus Torvalds· Nov 18, 2005, 16:14 UTC · re: Junio C Hamano · lore

Re: "make test" fails with current HEAD

On Fri, 18 Nov 2005, Junio C Hamano wrote:
Show 7 quoted lines
> 
> And at this point it becomes more and more tempting to have our
> own internal diff generator, without relying on external diff.
> 
> A midway compromise solution would be to detect if either file
> is binary ourselves and not to call diff but always say "Binary
> files difer".

Umm.. Why not just say "if the line after the 'diff' line doesn't start with '@@ ', then it's a binary diff"?

And not care at _all_ about what it says.

We require unified diffs, and they _always_ start with '@@ ' after the header. No need to check anything else.

		Linus
Junio C Hamano· Nov 18, 2005, 17:16 UTC · re: Linus Torvalds · lore

Re: "make test" fails with current HEAD

Linus Torvalds <torvalds@osdl.org> writes:
> Umm.. Why not just say "if the line after the 'diff' line doesn't start 
> with '@@ ', then it's a binary diff"?
Thanks, that makes sense.
Junio C Hamano· Nov 18, 2005, 19:13 UTC · re: Junio C Hamano · lore

Re: "make test" fails with current HEAD

Junio C Hamano <junkio@cox.net> writes:
Show 6 quoted lines
> Linus Torvalds <torvalds@osdl.org> writes:
>
>> Umm.. Why not just say "if the line after the 'diff' line doesn't start 
>> with '@@ ', then it's a binary diff"?
>
> Thanks, that makes sense.

Maybe not; parse_single_patch would have eaten '@@ -' lines so in practice that amounts to not checking anything at all.

Which is not a bad idea, though... That means we would treat all empty patches as binary diffs, which is certainly simple, but is it safe enough?

Junio C Hamano· Nov 18, 2005, 08:03 UTC · re: Matthias Urlichs · lore

Re: "make test" fails with current HEAD

Matthias Urlichs <smurf@smurf.noris.de> writes:
>>> Files /dev/null and b/file3 differ
>
> Of course, with LANG=de_DE.UTF-8 the situation is worse ...

And at this point it becomes more and more tempting to have our own internal diff generator, without relying on external diff.

A midway compromise solution would be to detect if either file is binary ourselves and not to call diff but always say "Binary files differ".

John Benes· Nov 18, 2005, 22:49 UTC · re: Junio C Hamano · lore

Re: "make test" fails with current HEAD

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Junio C Hamano wrote:
> I *think* this is the same problem as I fixed tonight with help
> from LASCM and John Benes, and I'm hoping to push the fix out
> before going to bed tonight.  If you are impatient the patch has
> already been sent out.
I can verify that "make test" now passes on Cygwin without NO_MMAP
uncommented.
Commit: 2e67a5f449f4026097494569f871d79bf263ab28
Desc: Cygwin *might* be helped with NO_MMAP
- --
John Benes
GPG Fingerprint: D519 25DB BB5C 38FC 9D02  02E7 596D BC50 F880 27FA
"It is not only the living who are killed in war." - Isaac Asimov
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQIVAwUBQ35aeWF0oWcU9kCNAQIpgg/9GFi++HvW5J2GYZbcHhAld2cqd6KtgbPN oUsbPuvGKSM9uP/9pKhOxp+DKJMuFd9mK5FG63jS8i8bthbEzegErLWcfbfM1+Js 0kYIfQEZpJu0+S1uMfsHX1CfS/OtjHebQCD7M9jgMFa1kgJXZl0Zu1rvG5hxTIZV OwssVwxz9Z2/gWzKFlAwyL4UgI4/mr2f7t43AVSKI0gR0Dry8Ou6B7vjBid9clMd JNoVHF437FVzAypoSUjmgHJJt+GHYn5noQTOMD0KnokznQckFVxNdALXaoAgkT1Q adgY+8TObmTbctJ9q2Qi1Z9Y0CAncC0TEGt8D8FBxiH+eJKqEKdmL7JT3ckaQO6S WZJf/u9SnkUJ089rYbYCvV10hqXz0y5XcGxo8kRKS6XGnY+Ff0hqtxVtHqbog8+y RtPyeST3vymkPuxx3g/gHrGtXJSZStE2/uNTKyA6IHA9dRUkLn70vHRKZsKKyj/f n5Ka1CJhIw+DzN4tANsQz9U/Q1olbQIr1khykds5DOhTvdSydSQtT3yOx9Wtt8QZ OH16pbWSGRNuL/vtwmonnVDsX/JJkUKSn3Z5gwmIvThvrD5TbJjyyYBaYZ9xvtkK XShm05Xf0yaryVlyUNCjlfNoLhi+gBoTVeaZmx/c1yrDZL6I53g3S79Bktdfd/rE r0eQqS7GEWc= =+a+2 -----END PGP SIGNATURE-----

Junio C Hamano· Nov 18, 2005, 23:44 UTC · re: John Benes · lore

[PATCH] Do not show .exe in git command list.

Truncate the result from readdir() in the exec-path if they end with .exe, to make it a bit more readable on Cygwin.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
 Today I borrowed a Cygwin environment to build things without
 any customization (no config.mak nor make command line
 override), and I have to report that make test passed OK for
 me.
 git.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

applies-to: ff891e258456492507934e82d90fd8aacb124845 f9039f30d56e3815eaab870d8b19c7b94aded8aa

diff --git a/git.c b/git.c
index b9b8c62..bdd3f8d 100644
--- a/git.c
+++ b/git.c
@@ -59,7 +59,8 @@ static void add_cmdname(const char *name
 	if (!ent)
 		oom();
 	ent->len = len;
-	memcpy(ent->name, name, len+1);
+	memcpy(ent->name, name, len);
+	ent->name[len] = 0;
 	cmdname[cmdname_cnt++] = ent;
 }
 
@@ -132,6 +133,8 @@ static void list_commands(const char *ex
 			continue;
 
 		entlen = strlen(de->d_name);
+		if (4 < entlen && !strcmp(de->d_name + entlen - 4, ".exe"))
+			entlen -= 4;
 
 		if (longest < entlen)
 			longest = entlen;
---
0.99.9.GIT

← back to recent threads