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

Re: [PATCH] t2017: redo physical reflog existance check

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Aug 24, 2010, 04:03 UTC
Message-ID
<20100824040347.GA19817@burratino>
In-Reply-To
<AANLkTin76s-ONFuP+OWdxB5LJNf2D1Du+hKxB2s_WhTa@mail.gmail.com>
Hi Erick,

First, thanks for checkout --orphan. I was a skeptic but now that I have seen it being used for things similar to "going open source" (and the related "simplifying logs while working privately on a patch series") it looks to be a pretty nice tool.

Erick Mattos wrote:
> I don't see a need for so much reluctance: "test -f" is not a taboo
> inside a script in t folder and the added tests don't change anything
> about the design and implementation which IMHO is well fit.

The principle (though we do not always adhere to it) is that test scripts should pass or fail based only on advertised behavior, not implementation details. That way, _later_ any person who wants to improve the implementation will not be impeded by tests.

The behavior that "test -f .git/logs/refs/heads/eta" checks for is not part of the advertised behavior and though it does affect the observable behavior, it is not immediately obvious how. Wouldn't it be best if the test described that advertised behavior while checking for it?

e.g.:
	git config core.logallrefupdates false &&
	test_when_finished "git config core.logallrefupdates true" &&
  	git checkout master &&
  	git checkout -l --orphan eta &&
	test_must_fail git rev-parse --verify eta@{0} &&
	test_tick &&
	git commit -m "initial commit" &&
	git rev-parse --verify eta@{0}

Happily, I am not the man in charge, so feel free to take my words at whatever value you choose. :)

Regards, Jonathan

Previous: Erick MattosNext: Junio C Hamano
Message 6 of 8 in “t2017: redo physical reflog existance check”
  1. t2017: redo physical reflog existance checkErick Mattos, Jul 22, 2010
  2. Junio C HamanoJul 22, 2010
  3. Erick MattosJul 22, 2010
  4. Junio C HamanoJul 23, 2010
  5. Erick MattosJul 23, 2010
  6. Jonathan NiederAug 24, 2010
  7. Junio C HamanoAug 24, 2010
  8. Erick MattosAug 24, 2010

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.