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

Re: [PATCH] tests: sanitize more git environment variables

From
Jeff King <peff@peff.net>
Date
Jan 27, 2011, 00:31 UTC
Message-ID
<20110127003136.GA5394@sigill.intra.peff.net>
In-Reply-To
<7v39ofl7ki.fsf@alter.siamese.dyndns.org>
On Wed, Jan 26, 2011 at 12:43:25PM -0800, Junio C Hamano wrote:
Show 12 quoted lines
> Jeff King <peff@peff.net> writes:
> 
> > These variables should generally not be set in one's
> > environment, but they do get set by rebase, which means
> > doing an interactive rebase like:
> >
> >   pick abcd1234 foo
> >   exec make test
> >
> > will cause false negatives in the test suite.
> 
> Cute.  Thanks.
BTW, for anyone interested, I am using this with the following script:
-- >8 --
#!/bin/sh
upstream=`git rev-parse --symbolic-full-name "$1@{u}" >/dev/null 2>&1`
GIT_EDITOR='sed -i "/^pick .*/aexec make -j8 test"' \
	git rebase -i "${upstream:-origin}" $1
-- 8< --

which is a convenient way of testing each commit in a patch series before submitting it upstream (and it stops on test failure so you can fix up that commit).

You can drop it in your PATH as "git-test" and run "git test" or "git test <branch>".

-Peff
Previous: Junio C Hamano
Message 4 of 4 in “tests: sanitize more git environment variables”
  1. tests: sanitize more git environment variablesJeff King, Jan 26, 2011
  2. Jeff KingJan 26, 2011
  3. Junio C HamanoJan 26, 2011
  4. Jeff KingJan 27, 2011

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.