All of lore.kernel.org
 help / color / mirror / Atom feed
From: Duy Nguyen <pclouds@gmail.com>
To: Git Mailing List <git@vger.kernel.org>,
	msysGit <msysgit@googlegroups.com>
Cc: Junio C Hamano <gitster@pobox.com>,
	Karsten Blees <karsten.blees@gmail.com>
Subject: Re: [RFC/PATCH] Windows tests: let $TRASH_DIRECTORY point to native Windows path
Date: Wed, 27 Aug 2014 20:08:23 +0700	[thread overview]
Message-ID: <CACsJy8CDZCkQNSfu7HMvfv6++fjr9V6KvhFmgqBQMyd4qnqMtg@mail.gmail.com> (raw)
In-Reply-To: <53D7F97B.7060607@gmail.com>

Ping...

On Wed, Jul 30, 2014 at 2:43 AM, Karsten Blees <karsten.blees@gmail.com> wrote:
> MSYS programs typically understand native Windows paths (e.g C:/git), but
> native Windows programs (including MinGW) don't understand MSYS paths (e.g.
> /c/git).
>
> On Windows, set TRASH_DIRECTORY to the absolute native path so that it can
> be used more easily in tests.
>
> MSYS 'tar -f' interprets everything before ':' as hostname, not as drive
> letter. Change respective tests to use stdin / stdout instead of '-f'. Also
> use $TAR from GIT-BUILD-OPTIONS rather than hardcoded tar.
>
> Signed-off-by: Karsten Blees <blees@dcon.de>
> ---
>
> Am 25.07.2014 14:30, schrieb Duy Nguyen:
>> On Wed, Jul 23, 2014 at 9:17 PM, Karsten Blees <karsten.blees@gmail.com> wrote:
>>> With the version in pu, three tests fail. t7001 is fixed with a newer 'cp'.
>>> The other two are unrelated (introduced by nd/multiple-work-trees topic).
>>>
>>> * t1501-worktree: failed 1
>>>   As of 5bbcb072 "setup.c: support multi-checkout repo setup"
>>>   Using $TRASH_DIRECTORY doesn't work on Windows.
>>>
>>> * t2026-prune-linked-checkouts: failed 1
>>>   As of 404a45f1 "prune: strategies for linked checkouts"
>>>   Dito.
>>
>> I need your help here. Would saving $(pwd) to a variable and using it
>> instead of $TRASH_DIRECTORY work? Some tests "cd" around and $(pwd)
>> may not be the same as $TRASH_DIRECTORY.
>>
>
> Yes, that would work.
>
> (Actually, you'd only need to change 'echo "$TRASH_DIR..."' in two places (both
> before cd'ing away). The other instances are parameters to non-msys programs and
> are thus automatically mangled by msys.dll.)
>
> However, I wonder why we don't set up TRASH_DIRECTORY to the native Windows path.
> I believe we'd get much fewer 'special' cases that way. Ideally, you shouldn't
> have to worry about the intricacies of MSYS path mangling when writing tests...
>
> [CCing msysgit for opinions]
>
>
>  t/t3513-revert-submodule.sh | 4 ++--
>  t/t6041-bisect-submodule.sh | 4 ++--
>  t/test-lib.sh               | 1 +
>  3 files changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/t/t3513-revert-submodule.sh b/t/t3513-revert-submodule.sh
> index a1c4e02..4a44dd6 100755
> --- a/t/t3513-revert-submodule.sh
> +++ b/t/t3513-revert-submodule.sh
> @@ -14,11 +14,11 @@ test_description='revert can handle submodules'
>  git_revert () {
>         git status -su >expect &&
>         ls -1pR * >>expect &&
> -       tar czf "$TRASH_DIRECTORY/tmp.tgz" * &&
> +       "$TAR" cz * >"$TRASH_DIRECTORY/tmp.tgz" &&
>         git checkout "$1" &&
>         git revert HEAD &&
>         rm -rf * &&
> -       tar xzf "$TRASH_DIRECTORY/tmp.tgz" &&
> +       "$TAR" xz <"$TRASH_DIRECTORY/tmp.tgz" &&
>         git status -su >actual &&
>         ls -1pR * >>actual &&
>         test_cmp expect actual &&
> diff --git a/t/t6041-bisect-submodule.sh b/t/t6041-bisect-submodule.sh
> index c6b7aa6..0de614f 100755
> --- a/t/t6041-bisect-submodule.sh
> +++ b/t/t6041-bisect-submodule.sh
> @@ -8,7 +8,7 @@ test_description='bisect can handle submodules'
>  git_bisect () {
>         git status -su >expect &&
>         ls -1pR * >>expect &&
> -       tar czf "$TRASH_DIRECTORY/tmp.tgz" * &&
> +       "$TAR" cz * > "$TRASH_DIRECTORY/tmp.tgz" &&
>         GOOD=$(git rev-parse --verify HEAD) &&
>         git checkout "$1" &&
>         echo "foo" >bar &&
> @@ -20,7 +20,7 @@ git_bisect () {
>         git bisect start &&
>         git bisect good $GOOD &&
>         rm -rf * &&
> -       tar xzf "$TRASH_DIRECTORY/tmp.tgz" &&
> +       "$TAR" xz <"$TRASH_DIRECTORY/tmp.tgz" &&
>         git status -su >actual &&
>         ls -1pR * >>actual &&
>         test_cmp expect actual &&
> diff --git a/t/test-lib.sh b/t/test-lib.sh
> index 5102340..5f6397b 100644
> --- a/t/test-lib.sh
> +++ b/t/test-lib.sh
> @@ -868,6 +868,7 @@ case $(uname -s) in
>                 md5sum "$@"
>         }
>         # git sees Windows-style pwd
> +       TRASH_DIRECTORY=$(pwd -W)
>         pwd () {
>                 builtin pwd -W
>         }
> --
> 2.0.2.897.g7f80809.dirty
>



-- 
Duy

      reply	other threads:[~2014-08-27 13:09 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-22 21:44 What's cooking in git.git (Jul 2014, #04; Tue, 22) Junio C Hamano
2014-07-23  6:56 ` Philip Oakley
2014-07-23 18:10   ` Junio C Hamano
2014-07-24 22:37     ` Philip Oakley
2014-07-24 22:45       ` Junio C Hamano
2014-07-25 22:08         ` Junio C Hamano
2014-07-28 22:12           ` Philip Oakley
2014-07-30 17:13           ` Everyday contents (was Re: What's cooking in git.git (Jul 2014, #04; Tue, 22)) Junio C Hamano
2014-08-05 20:26             ` Junio C Hamano
2014-08-05 21:00               ` Philip Oakley
2014-08-02 17:28           ` Everday contents (was part of " Philip Oakley
2014-08-03 17:29             ` Everday contents Junio C Hamano
2014-08-03 18:41               ` Philip Oakley
2014-08-04 17:00                 ` Junio C Hamano
2014-07-23 14:17 ` What's cooking in git.git (Jul 2014, #04; Tue, 22) Karsten Blees
2014-07-23 18:24   ` Junio C Hamano
2014-07-25 12:30   ` Duy Nguyen
2014-07-29 19:43     ` [RFC/PATCH] Windows tests: let $TRASH_DIRECTORY point to native Windows path Karsten Blees
2014-08-27 13:08       ` Duy Nguyen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CACsJy8CDZCkQNSfu7HMvfv6++fjr9V6KvhFmgqBQMyd4qnqMtg@mail.gmail.com \
    --to=pclouds@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=karsten.blees@gmail.com \
    --cc=msysgit@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.