Re: [PATCH 14/13] test-wildmatch: avoid Windows path mangling
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 20, 2012, 20:11 UTC
- Message-ID
- <7vd2z8rq4y.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <50AB2B0F.8090808@viscovery.net>
Johannes Sixt <j.sixt@viscovery.net> writes:
Show 16 quoted lines
> From: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> > > The MSYS bash mangles arguments that begin with a forward slash > when they are passed to test-wildmatch. This causes tests to fail. > Avoid mangling by prepending "XXX", which is removed by > test-wildmatch before further processing. > > [J6t: reworded commit message] > > Reported-by: Johannes Sixt <j6t@kdbg.org> > Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> > Signed-off-by: Johannes Sixt <j6t@kdbg.org> > --- > Works well, and I'm fine with this work-around. > > -- Hannes
Thanks, but you need to fix your format-patch somehow.
Show 11 quoted lines
> @@ -187,8 +187,8 @@ match 0 0 '-' '[[-\]]' > match 1 1 '-adobe-courier-bold-o-normal--12-120-75-75-m-70-iso8859-1' '-*-*-*-*-*-*-12-*-*-*-m-*-*-*' > match 0 0 '-adobe-courier-bold-o-normal--12-120-75-75-X-70-iso8859-1' '-*-*-*-*-*-*-12-*-*-*-m-*-*-*' > match 0 0 '-adobe-courier-bold-o-normal--12-120-75-75-/-70-iso8859-1' '-*-*-*-*-*-*-12-*-*-*-m-*-*-*' > -match 1 1 '/adobe/courier/bold/o/normal//12/120/75/75/m/70/iso8859/1' '/*/*/*/*/*/*/12/*/*/*/m/*/*/*' > -match 0 0 '/adobe/courier/bold/o/normal//12/120/75/75/X/70/iso8859/1' '/*/*/*/*/*/*/12/*/*/*/m/*/*/*' > +match 1 1 'XXX/adobe/courier/bold/o/normal//12/120/75/75/m/70/iso8859/1' 'XXX/*/*/*/*/*/*/12/*/*/*/m/*/*/*' > +match 0 0 'XXX/adobe/courier/bold/o/normal//12/120/75/75/X/70/iso8859/1' 'XXX/*/*/*/*/*/*/12/*/*/*/m/*/*/*' > match 1 0 'abcd/abcdefg/abcdefghijk/abcdefghijklmnop.txt' '**/*a*b*g*n*t' > match 0 0 'abcd/abcdefg/abcdefghijk/abcdefghijklmnop.txtz' '**/*a*b*g*n*t' > diff --git a/test-wildmatch.c b/test-wildmatch.c
This hunk claims that there are 8 lines in preimage and postimage, but it is not the case. It has only 7 lines each.
You also have the first line of the next patch "diff --git" somehow indented. How did this happen?
Show 17 quoted lines
> index 74c0864..e384c8e 100644
> --- a/test-wildmatch.c
> +++ b/test-wildmatch.c
> @@ -3,6 +3,14 @@
> int main(int argc, char **argv)
> {
> + int i;
> + for (i = 2; i < argc; i++) {
> + if (argv[i][0] == '/')
> + die("Forward slash is not allowed at the beginning of the\n"
> + "pattern because Windows does not like it. Use `XXX/' instead.");
> + else if (!strncmp(argv[i], "XXX/", 4))
> + argv[i] += 3;
> + }
> if (!strcmp(argv[1], "wildmatch"))
> return !!wildmatch(argv[3], argv[2], 0);
> else if (!strcmp(argv[1], "iwildmatch"))And again this claims that the preimage has 6 lines while the postimage has 14. Somebody is overcounting, or perhaps you removed the first pre-context by hand without adjusting the line number?