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

Re: [PATCH 08/10] run test suite without dashed git-commands in PATH

From
MOMatthew Ogilvie <mmogilvi_git@miniinfo.net>
Date
Jan 26, 2009, 06:40 UTC
Message-ID
<20090126064004.GA3004@comcast.net>
In-Reply-To
<alpine.DEB.1.00.0901250255250.14855@racer>
Hi,
On Sun, Jan 25, 2009 at 02:59:53AM +0100, Johannes Schindelin wrote:
Show 26 quoted lines
> Hi,
> 
> On Sat, 24 Jan 2009, Matthew Ogilvie wrote:
> 
> >  .gitignore          |    1 +
> >  Makefile            |   42 +++++++++++++++++++++++++++++++-----------
> >  t/test-lib.sh       |   14 +++++++++++++-
> >  test-bin-wrapper.sh |   12 ++++++++++++
> >  4 files changed, 57 insertions(+), 12 deletions(-)
> >  create mode 100644 test-bin-wrapper.sh
> 
> I am strongly opposed to a patch this big, just for something as 3rd class 
> as CVS server faking.  We already have a big fallout from all that bending 
> over for Windows support, and I do not like it at all.
> 
> Note: I do not even have to look further than the diffstat to see that it 
> is wrong.
> 
> The point is: if cvsserver wants to pretend that it is in a fake bin where 
> almost none of the other Git programs are, fine, let's do that _in the 
> test for cvsserver_.
> 
> Let's not fsck up the whole test suite just for one user.
> 
> Ciao,
> Dscho

Since by default git is installed such that most of the dashed-form commands are not in a user's default PATH, my thought was that it would make sense for the test suite to mimick that environment as much as possible. This could detect regressions in any installed/tested git script that erroneously assumes the dashed form commands are in the PATH, not just git-cvsserver.

I can think of ways it could be made smaller, but they seem uglier than the current patch to me:

    1. Perhaps just list the executables for the fake bin directory
separately, but then it is all too easy for the list to get out of sync
with what the final install environment will be.
    2. Perhaps strip off the $X's (.exe on windows; currently empty
elsewhere) from the words of the existing variables, in the rule
for building the "fake bin" directory.  But generally I'ld rather
not assume that pattern-matching replacement of
$X's will never conflict with a part of a script name.
    3. Perhaps just use symlinks or hardlinks instead of a wrapper
script.  This might have some promise, except that links are more
likely to fail on windows, and the wrappers generally give you
more flexibility for testing odd scenarios.
    4. The test-bin-wrapper.sh script does not actually need to
set environment variables (GIT_EXEC_DIT and templates) for
purposes of this patch.  But my thought was that in this form
you could run things straight out of the test-bin directory
to manually try out new code without needing to actually install
a build or mess with the environment variables yourself.  It could
also be extended to handle other global wrapper needs
relatively easily, such as valgrind.
Any other ideas?

-- Matthew Ogilvie [mmogilvi_git@miniinfo.net]

Previous: Johannes SchindelinNext: Johannes Schindelin
Message 13 of 16 in “Misc. cvsserver, dashless, and test suite patches”
  1. 00/10 Misc. cvsserver, dashless, and test suite patchesMatthew Ogilvie, Jan 24, 2009
  2. 01/10 cvsserver: removed unused sha1Or-k mode from kopts_from_pathMatthew Ogilvie, Jan 24, 2009
  3. 02/10 cvsserver: add comments about database schema/usageMatthew Ogilvie, Jan 24, 2009
  4. 03/10 cvsserver: remove unused functions _headrev and gethistoryMatthew Ogilvie, Jan 24, 2009
  5. 04/10 git-shell: allow running git-cvsserver, not just cvsMatthew Ogilvie, Jan 24, 2009
  6. 05/10 cvsserver: run dashless "git command"s to access plumbingMatthew Ogilvie, Jan 24, 2009
  7. 06/10 t2300: use documented technique to invoke git-sh-setupMatthew Ogilvie, Jan 24, 2009
  8. 07/10 t3409: use dashless "git commit" instead of "git-commit"Matthew Ogilvie, Jan 24, 2009
  9. 08/10 run test suite without dashed git-commands in PATHMatthew Ogilvie, Jan 24, 2009
  10. 09/10 Revert "adapt git-cvsserver manpage to dash-free syntax"Matthew Ogilvie, Jan 24, 2009
  11. 10/10 cvsserver doc: emphasize using CVS_SERVER= phrase within CVSROOTMatthew Ogilvie, Jan 24, 2009
  12. Johannes SchindelinJan 25, 2009
  13. Matthew OgilvieJan 26, 2009
  14. Johannes SchindelinJan 26, 2009
  15. Matthew OgilvieJan 27, 2009
  16. Johannes SchindelinJan 25, 2009

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.