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

Re: jn/apply-filename-with-sp (Re: What's cooking in git.git (Aug 2010, #02; Wed, 11))

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 12, 2010, 23:17 UTC
Message-ID
<7v1va3pgio.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20100812224044.GK2029@burratino>
Jonathan Nieder <jrnieder@gmail.com> writes:
Show 22 quoted lines
> Johannes Sixt wrote:
>> Am 8/12/2010 1:35, schrieb Junio C Hamano:
>
>>> * jn/apply-filename-with-sp (2010-07-23) 4 commits
>>>  - apply: Handle traditional patches with space in filename
>>>  - t4135 (apply): use expand instead of pr for portability
>>>  - tests: Test how well "git apply" copes with weird filenames
>>>  - apply: Split quoted filename handling into new function
>>> 
>>> Looked Ok.  Will merge to 'next'.
>>
>> The test cases that work with files with tabs must have a prerequisite;
>> see t3600-rm.sh.
>
> Would this work?
>
> -- 8< --
> Subject: t4135 (apply): filenames with tabs are not usable on NTFS
>
> Move the code setting up the FUNNYNAMES prerequisite from
> v1.3.0-rc1~67 (workaround fat/ntfs deficiences for t3600-rm.sh,
> 2006-03-03) to test-lib and use it.

Hmm. FUNNYNAMES is used by only these two but we have nearly 500 individual test scripts in the test suite, and that was the original reason why we don't have it in test-lib.sh.

I wonder if we can/should lazily check this kind of thing upon the first use of symbol during a single test session?

 * Create an empty $TEST_DIRECTORY/test-prereq file part of pre-clean
   target of t/Makefile.  This file needs to be removed as part of clean
   target;
 * t/test-lib.sh "."-sources the test-prereq file before doing anything
   else;
 * Instead of using "satisfied" variable as a SP separated list of
   prerequisite tokens, use PREREQ_FOO shell variable (whose value can be
   true, false) to represent FOO prerequisite we have already checked;
 * When checking for prerequite FOO, test_have_prereq checks if PREREQ_FOO
   variable is set.  If not, then it calls a shell function of the same
   name (i.e. PREREQ_FOO) defined in test-lib.sh (the function can exit
   with zero or non-zero just like usual tests to signal if the
   prerequisite is met), sets PREREQ_FOO to an appropriate value, and then
   runs "echo PREREQ_FOO=$PREREQ_FOO >>$TEST_DIRECTORY/test-prereq".
   Then $PREREQ_FOO can be examined to see if prerequisite FOO is
   satisfied.

The file based caching of the above wouldn't work well under "make -j"; without it, we can still have a prerequisite checked only once per a test script run, which is not worse than the current situation (and it would even save cycles if a test does not check for a particular prereq, e.g. SYMLINKS, that is always checked in test-lib).

Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 36 of 56 in “What's cooking in git.git (Aug 2010, #02; Wed, 11)”
  1. Junio C HamanoAug 11, 2010
  2. Jonathan NiederAug 12, 2010
  3. Ævar Arnfjörð BjarmasonAug 12, 2010
  4. jn/commit-no-change-wo-status (Re: What's cooking in git.git (Aug 2010, #02; Wed, 11))Jonathan Nieder, Aug 12, 2010
  5. Elijah NewrenAug 12, 2010
  6. Junio C HamanoAug 12, 2010
  7. Elijah NewrenAug 12, 2010
  8. Johannes SixtAug 12, 2010
  9. Greg BrockmanAug 12, 2010
  10. Ævar Arnfjörð BjarmasonAug 12, 2010
  11. Junio C HamanoAug 12, 2010
  12. Greg BrockmanAug 12, 2010
  13. Junio C HamanoAug 12, 2010
  14. Ævar Arnfjörð BjarmasonAug 12, 2010
  15. Erik Faye-LundAug 12, 2010
  16. Ævar Arnfjörð BjarmasonAug 12, 2010
  17. Chris PackhamAug 12, 2010
  18. Ævar Arnfjörð BjarmasonAug 12, 2010
  19. windows smoke tester (was Re: What's cooking in git.git (Aug 2010, #02; Wed, 11))Chris Packham, Aug 12, 2010
  20. Ævar Arnfjörð BjarmasonAug 12, 2010
  21. Chris PackhamAug 12, 2010
  22. Ævar Arnfjörð BjarmasonAug 13, 2010
  23. Chris PackhamAug 14, 2010
  24. Ævar Arnfjörð BjarmasonAug 14, 2010
  25. Tay Ray ChuanAug 15, 2010
  26. Ævar Arnfjörð BjarmasonAug 15, 2010
  27. Tay Ray ChuanAug 15, 2010
  28. Ilari LiusvaaraAug 12, 2010
  29. Johannes SixtAug 12, 2010
  30. Ilari LiusvaaraAug 12, 2010
  31. Elijah NewrenAug 12, 2010
  32. Junio C HamanoAug 12, 2010
  33. Junio C HamanoAug 12, 2010
  34. jn/apply-filename-with-sp (Re: What's cooking in git.git (Aug 2010, #02; Wed, 11))Jonathan Nieder, Aug 12, 2010
  35. Ævar Arnfjörð BjarmasonAug 12, 2010
  36. Junio C HamanoAug 12, 2010
  37. Ævar Arnfjörð BjarmasonAug 13, 2010
  38. Johannes SixtAug 13, 2010
  39. Jonathan NiederAug 14, 2010
  40. Johannes SixtAug 14, 2010
  41. Jonathan NiederAug 15, 2010
  42. 0/3 apply: handle traditional patches with space in filenameJonathan Nieder, Aug 19, 2010
  43. 1/3 apply: split quoted filename handling into new functionJonathan Nieder, Aug 19, 2010
  44. 2/3 tests: exercise "git apply" with weird filenamesJonathan Nieder, Aug 19, 2010
  45. 3/3 apply: handle traditional patches with space in filenameJonathan Nieder, Aug 19, 2010
  46. Johannes SixtAug 19, 2010
  47. Jonathan NiederAug 20, 2010
  48. jn/svn-feJonathan Nieder, Aug 13, 2010
  49. Jakub NarebskiAug 13, 2010
  50. Johannes SixtAug 13, 2010
  51. 0/5 vcs-svn: Port to WindowsJonathan Nieder, Aug 13, 2010
  52. 1/5 compat: add strtok_r()Jonathan Nieder, Aug 13, 2010
  53. 2/5 vcs-svn: Rename dirent pool to build on WindowsJonathan Nieder, Aug 14, 2010
  54. 3/5 vcs-svn: Avoid %z in format stringJonathan Nieder, Aug 14, 2010
  55. 4/5 t9010 (svn-fe): use Unix-style path in URIJonathan Nieder, Aug 14, 2010
  56. 5/5 t9010 (svn-fe): avoid symlinks in testJonathan Nieder, Aug 14, 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.