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

Re: [PATCH] Fix t3701 if core.filemode disabled

From
Jeff King <peff@peff.net>
Date
May 21, 2008, 14:36 UTC
Message-ID
<20080521143607.GA3575@sigill.intra.peff.net>
In-Reply-To
<20080520215932.GB10437@steel.home>
On Tue, May 20, 2008 at 11:59:32PM +0200, Alex Riesen wrote:
> Sure. I have explicitely test for core.filemode=false, because
> some older setups (where git init did not set it) don't have
> the setting and git config core.filemode reports nothing.

I don't think that is relevant here; this is a test script, and as such is testing the results of the current version of git-init (from when we git-init the trash directory).

That being said, I think the test you have is perfectly fine, and the patch is correct.

And I am OK with the patch as-is, though I have a few style nits:
Show 13 quoted lines
> @@ -65,6 +65,7 @@ test_expect_success 'revert works (commit)' '
>  	git add -i </dev/null >output &&
>  	grep "unchanged *+3/-0 file" output
>  '
> +if test "$(git config core.filemode)" != false ; then
>  
>  test_expect_success 'patch does not affect mode' '
>  	git reset --hard &&
> @@ -84,5 +85,6 @@ test_expect_success 'stage mode but not hunk' '
>  	git diff          file | grep "+content"
>  '
>  
> +fi
1. It should be $(git config --bool core.filemode). As it happens,
git-init always uses the word "false" so this works OK, but it is
probably better to model good behavior and to be more robust.
2. It's a little hard to see which tests are affected. I would have done
   something more like:
  if test "$(git config --bool core.filemode)" = true
    test_filemode=
  else
    test_filemode=:
  fi
  $test_filemode test_expect_success ...
  But maybe that is just overengineering.
3. Usually when we skip tests we do something like
  say 'skipping filemode tests (filesystem does not properly support modes')
-Peff
Previous: Alex RiesenNext: Alex Riesen
Message 9 of 15 in “t3701 fails if core.filemode disabled”
  1. Alex RiesenMay 18, 2008
  2. Johannes SchindelinMay 18, 2008
  3. Alex RiesenMay 18, 2008
  4. Jeff KingMay 18, 2008
  5. Alex RiesenMay 18, 2008
  6. Alex RiesenMay 19, 2008
  7. Jeff KingMay 19, 2008
  8. Fix t3701 if core.filemode disabledAlex Riesen, May 20, 2008
  9. Jeff KingMay 21, 2008
  10. Alex RiesenMay 22, 2008
  11. Junio C HamanoMay 22, 2008
  12. Jeff KingMay 22, 2008
  13. Alex RiesenMay 22, 2008
  14. Mark LevedahlMay 19, 2008
  15. Alex RiesenMay 19, 2008

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.