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

Re: [PATCH] git config: do not create .git/ if it does not exist yet

From
Jeff King <peff@peff.net>
Date
Feb 24, 2016, 10:31 UTC
Message-ID
<20160224103152.GA21448@sigill.intra.peff.net>
In-Reply-To
<20160224101403.GN1766@serenity.lan>
On Wed, Feb 24, 2016 at 10:14:03AM +0000, John Keeping wrote:
Show 13 quoted lines
> On Wed, Feb 24, 2016 at 03:26:57AM -0500, Jeff King wrote:
> > On Wed, Feb 24, 2016 at 08:47:00AM +0100, Johannes Schindelin wrote:
> > 
> > > 	I cannot think of a way how to test this: all of the regression
> > > 	tests run inside Git's own worktree, and we cannot even assume
> > > 	that /tmp/ is outside of a worktree (or that it exists).
> > 
> > We could make the test conditional on whether we are in a repo. Anybody
> > who builds from a tarball, or who uses --root would then run the test.
> 
> Could we use GIT_CEILING_DIRECTORIES for this?  If it's set to
> TEST_OUTPUT_DIRECTORY won't that cover the in-tree and out-of-tree test
> cases?
Oh, right. That's much less nasty than my suggestion.
> We probably do still want Peff's REPOLESS prereq just in case someone is
> collecting test results in a repository,

We can create arbitrary hierarchies within the trash directory. So even without removing the trash-dir .git, we could probably do:

  mkdir -p non-repo/foo &&
  (
	cd non-repo &&
	GIT_CEILING_DIRECTORIES=$(pwd) &&
	export GIT_CEILING_DIRECTORIES &&
	cd foo &&
	git config foo.bar baz
  )
or something. That should work everywhere.
> but I think that will see much
> better coverage than relying on people running tests from the tarball.

With mine I think we'd see coverage from git devs, as it works with --root, too (and if you're not using --root with a RAM disk, I highly recommend it for the speedup). But your suggestion is way better.

-Peff
Previous: John KeepingNext: Johannes Schindelin
Message 4 of 16 in “git config: do not create .git/ if it does not exist yet”
  1. git config: do not create .git/ if it does not exist yetJohannes Schindelin, Feb 24, 2016
  2. Jeff KingFeb 24, 2016
  3. John KeepingFeb 24, 2016
  4. Jeff KingFeb 24, 2016
  5. Johannes SchindelinFeb 24, 2016
  6. Johannes SchindelinFeb 24, 2016
  7. Jeff KingFeb 24, 2016
  8. Junio C HamanoFeb 24, 2016
  9. Duy NguyenFeb 24, 2016
  10. git config: report when trying to modify a non-existing repo configJohannes Schindelin, Feb 24, 2016
  11. Duy NguyenFeb 24, 2016
  12. Johannes SchindelinFeb 24, 2016
  13. Duy NguyenFeb 24, 2016
  14. Junio C HamanoFeb 24, 2016
  15. Junio C HamanoFeb 24, 2016
  16. Johannes SchindelinFeb 25, 2016

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.