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

Re: [PATCH] Do check_repository_format() early

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Dec 3, 2007, 10:44 UTC
Message-ID
<Pine.LNX.4.64.0712031036530.27959@racer.site>
In-Reply-To
<fcaeb9bf0712022003w4a3df0f0j21a5b23f3f073597@mail.gmail.com>
Hi,
On Mon, 3 Dec 2007, Nguyen Thai Ngoc Duy wrote:
> The patch's behaviour is barf if the repository version is too new.
> The list of files that use setup_git_directory_gently is not long. I
> am going to have a look over the files before amending the patch again
> to make it only barf if nongit_ok is NULL.

In the interest of least surprise, _gently() should not ignore a too new repository format. It is also keeping the semantics simpler, which is good for users like me.

So I'd test it with "git apply", just because it is the first on the list. Something like

-- snip -- cat > patch << EOF diff a/empty-file b/empty-file

--- a/empty-file
+++ b/empty-file
@@ -0,0 +1,1 @@
+narf
EOF

test_expect_success '_gently() respects repositoryversion' '

	mkdir way_too_new &&
	(cd way_too_new &&
	 git init &&
	 git config core.repositoryFormatVersion 999999 &&
	 : > empty-file &&
	 ! git apply < ../patch 2> error.out &&
	 grep "git repo version" error.out &&
	 ! test -s empty-file

'
-- snap --

Hmm?

Ciao,
Dscho
Previous: Nguyen Thai Ngoc DuyNext: Nguyen Thai Ngoc Duy
Message 11 of 16 in “Do check_repository_format() early”
  1. Do check_repository_format() earlyNguyễn Thái Ngọc Duy, Nov 28, 2007
  2. Johannes SchindelinNov 28, 2007
  3. Nguyen Thai Ngoc DuyNov 28, 2007
  4. Johannes SchindelinNov 28, 2007
  5. Nguyen Thai Ngoc DuyNov 28, 2007
  6. Johannes SchindelinNov 28, 2007
  7. Junio C HamanoDec 1, 2007
  8. Nguyen Thai Ngoc DuyDec 1, 2007
  9. Junio C HamanoDec 1, 2007
  10. Nguyen Thai Ngoc DuyDec 3, 2007
  11. Johannes SchindelinDec 3, 2007
  12. Nguyen Thai Ngoc DuyDec 3, 2007
  13. Junio C HamanoDec 3, 2007
  14. Do check_repository_format() earlyNguyễn Thái Ngọc Duy, Dec 5, 2007
  15. Nguyen Thai Ngoc DuyDec 5, 2007
  16. Junio C HamanoDec 6, 2007

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.