git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC] Support TEST_GIT_PATH variable for the path for the git to test

From
Daniel Barkalow <barkalow@iabervon.org>
Date
Feb 26, 2008, 20:46 UTC
Message-ID
<alpine.LNX.1.00.0802261539130.19665@iabervon.org>
In-Reply-To
<7vpruj4ge1.fsf@gitster.siamese.dyndns.org>
On Tue, 26 Feb 2008, Junio C Hamano wrote:
Show 16 quoted lines
> Daniel Barkalow <barkalow@iabervon.org> writes:
> 
> >> I did not mean to imply I was presenting the whole solution; I
> >> was trying to hint at a different direction which may or may not
> >> work.  I did not look at what test_create_repo() actually did
> >> when I wrote the message, but you are right.  It too needs to
> >> be made conditional, and when trying an installed version, it
> >> should not do the "template" dance but let the installed "git init"
> >> figure it out.
> >
> > Does it need to be conditional, or is simply "git init" right (where we've 
> > already set environment variables for the local stuff if applicable)?
> 
> I suspect "uninstalled" cases (both "here" and "elsewhere")
> needs to do the template magic, while "installed" case should be
> just "git init".

Ah, but that doesn't have to be here, since we can (and, AFAICT do) use the GIT_TEMPLATE_DIR environment variable, and can set it as appropriate in the setup code.

Show 22 quoted lines
> >> > There's additionally the problem that things which are built for testing 
> >> > in the git directory won't be installed anywhere.
> >> 
> >> To test without installing, in order to make them call out their
> >> siblings, I have this piece that I source to a new shell:
> >> 
> >>         GIT_EXEC_PATH=`pwd`
> >>         PATH=`pwd`:/usr/bin:/bin
> >>         GITPERLLIB=`pwd`/perl/blib/lib
> >>         export GIT_EXEC_PATH PATH GITPERLLIB
> >
> > Might be nice to have a "sgitpath" (on the model of sg or su) in t/, since 
> > this is handy in general.
> 
> I have them in ./+denv and after building if I want to see it
> work in real repo elsewhere I do:
> 
> 	: gitster; sh
>         $ . ./+denv
>         $ cd ../elsewhere.git
>         $ do the real workload trial
>         $ ^D

I was thinking it would be handy to have around t/ in case you want to go step-by-step through a failing test, using the git the test would use. For that purpose, it would also be handy to pick up the environment variables I'm introducing in this thread, I guess.

Show 8 quoted lines
> > You understood correctly the first time; I was unclear the second time. 
> > The problem here is that, in order to run tests, we call 
> > "test-absolute-path", "test-genrandom", etc., and we can't use these from 
> > the user's $PATH because, being only for testing, they don't get installed 
> > there. We need to get git-remote (for example) from $PATH, but 
> > test-genrandom from $(pwd)/.. in order to make the tests run.
> 
> Ok, so even "installed" case need to rely on "test-blah" we build.

Right. Would it be okay to build those into t/helpers/* or something, instead of into the project root, so that they're just naturally separate from the actual program?

	-Daniel
*This .sig left intentionally blank*
Previous: Junio C HamanoNext: Junio C Hamano
Message 7 of 8 in “[RFC] Support TEST_GIT_PATH variable for the path for the git to test”
  1. Daniel BarkalowFeb 25, 2008
  2. Junio C HamanoFeb 26, 2008
  3. Daniel BarkalowFeb 26, 2008
  4. Junio C HamanoFeb 26, 2008
  5. Daniel BarkalowFeb 26, 2008
  6. Junio C HamanoFeb 26, 2008
  7. Daniel BarkalowFeb 26, 2008
  8. Junio C HamanoFeb 26, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.