git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Daniel Barkalow <barkalow@iabervon.org>
Cc: git@vger.kernel.org
Subject: Re: [RFC] Support TEST_GIT_PATH variable for the path for the git to test
Date: Mon, 25 Feb 2008 16:00:29 -0800	[thread overview]
Message-ID: <7v63wch9ia.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <alpine.LNX.1.00.0802251600220.19024@iabervon.org> (Daniel Barkalow's message of "Mon, 25 Feb 2008 18:21:34 -0500 (EST)")

Daniel Barkalow <barkalow@iabervon.org> writes:

> @@ -281,7 +281,8 @@ test_create_repo () {
>  	cd "$repo" || error "Cannot setup test environment"
>  	"$GIT_EXEC_PATH/git" init --template=$GIT_EXEC_PATH/templates/blt/ >/dev/null 2>&1 ||
>  	error "cannot run git init -- have you built things yet?"
> -	mv .git/hooks .git/hooks-disabled
> +	[ ! -e .git/hooks ] || mv .git/hooks .git/hooks-disabled
> +	[ -e .git/info ] || mkdir .git/info

This is just a style issue, but if you try to be old fashioned,
please say "test frotz || xyzzy".  If you prefer to be modern,
"if ! test frotz; then xyzzy; fi".  I'd prefer the former, but
in either case I really do not want to see [ ... ] that do not
make anything more readable.

Also we tend to avoid "test -e" unless absolutely needed.

> @@ -321,8 +322,8 @@ test_done () {
>  
>  # Test the binaries we have just built.  The tests are kept in
>  # t/ subdirectory and are run in trash subdirectory.
> -PATH=$(pwd)/..:$PATH
> -GIT_EXEC_PATH=$(pwd)/..
> +GIT_EXEC_PATH=${TEST_GIT_PATH:-$(pwd)/..}
> +PATH=$GIT_EXEC_PATH:$(pwd)/..:$PATH

Hmmmm.

I have bunch of gits installed under $HOME/git-vX.Y.Z/bin and
when I need to test one from a different vintage, I just say:

	PATH=$HOME/git-vX.Y.Z/bin:/usr/bin:/bin
	... do git stuff which all use version X.Y.Z

and have $HOME/git-vX.Y.Z/bin/git find its corresponding friends
on the GIT_EXEC_PATH embedded in it.  Because you are interested
in testing installed versions, I suspect something like:

	if test -z "$TEST_GIT_ON_PATH"
	then
                GIT_EXEC_PATH=$(pwd)/..
        	PATH=$GIT_EXEC_PATH:$PATH
	else
        	: We do not do any customization
	fi

would be easier to read and more to the point.  Perhaps the
tester even has his own GIT_EXEC_PATH that is unrelated to
TEST_GIT_PATH.

  reply	other threads:[~2008-02-26  0:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-25 23:21 [RFC] Support TEST_GIT_PATH variable for the path for the git to test Daniel Barkalow
2008-02-26  0:00 ` Junio C Hamano [this message]
2008-02-26 18:02   ` Daniel Barkalow
2008-02-26 18:46     ` Junio C Hamano
2008-02-26 19:16       ` Daniel Barkalow
2008-02-26 20:22         ` Junio C Hamano
2008-02-26 20:46           ` Daniel Barkalow
2008-02-26 21:01             ` Junio C Hamano

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=7v63wch9ia.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=barkalow@iabervon.org \
    --cc=git@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).