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

Re: [PATCH v2 7/8] t4124: fix test for non-compliant diff(1)

From
Danh Doan <congdanhqx@gmail.com>
Date
Mar 24, 2020, 03:40 UTC
Message-ID
<20200324034025.GE11801@danh.dev>
In-Reply-To
<xmqq8sjq4wyf.fsf@gitster.c.googlers.com>
On 2020-03-23 13:50:48-0700, Junio C Hamano <gitster@pobox.com> wrote:
Show 28 quoted lines
> Danh Doan <congdanhqx@gmail.com> writes:
> 
> > A comment in test-lib-functions::test_cmp mentions that
> > there _is_ a diff out there that doesn't understand "-u".
> 
> That came from 82ebb0b6 (add test_cmp function for test scripts,
> 2008-03-12).
> 
> The change history at the end of the page:
> 
>   https://pubs.opengroup.org/onlinepubs/9699919799/utilities/diff.html
> 
> suggests that POSIX did not require "diff -u" until Issue 7, so it
> is not surprising that the lack of "diff -u" to cause test_cmp to
> fail was of real concern back in March 2008, as the application of
> the errata have been only an year and half old, according to:
> 
>   https://www.opengroup.org/austin/docs/austin_325.txt
> 
> I vaguely recall that some open source projects only took the copied
> context diffs and not unified ones the last time I checked, but
> admittedly (1) that "last time" was a long time ago and (2) our
> popularity and the fact that we do not understand copied context
> [*1*] may have forced people to move away from "-c" and adopt "-u"
> at the same time.  
> 
> So it might be OK to write off any system that does not understand
> "diff -u" as an unusable trash these days ;-)

From the setting in "config.mak.uname", it's likely those systems don't understand "diff -u":

- Solaris 5.6, 5.7, 5.8, 5.9: both of them are un-supported version
  by their vendor
- AIX, only AIX 5.3 doesn't understand "-u",
  the end-of-support AIX 6.1's diff(1) understand "-u" (1)
- HP-UX: From what I can collect, HP-UX still conforms to UNIX-03, and
  its diff(1) doesn't understand "-u"
Hence, if we're going to drop support for system that doesn't
understand "diff -u", we're going to:
- remove support for those variables:
  + GIT_TEST_CMP_USE_COPIED_CONTEXT
  + GIT_TEST_CMP
- drop support for:
  + Solaris 5.{6,7,8,} and AIX 5.3, which will be fine
  + HP-UX: which needs to be discussed
[1]: https://public.dhe.ibm.com/systems/power/docs/aix/61/aixcmds2_pdf.pdf page 133(143)
-- 
Danh
Previous: Junio C HamanoNext: Junio C Hamano
Message 19 of 36 in “fix test failure with busybox”
  1. 0/8 fix test failure with busyboxĐoàn Trần Công Danh, Mar 22, 2020
  2. 1/8 t4061: use POSIX compliant regex(7)Đoàn Trần Công Danh, Mar 22, 2020
  3. 3/8 t5003: drop the subshell in test_lazy_prereqĐoàn Trần Công Danh, Mar 22, 2020
  4. 2/8 test-lib-functions: test_cmp: eval $GIT_TEST_CMPĐoàn Trần Công Danh, Mar 22, 2020
  5. 4/8 t5003: skip conversion test if unzip -a is unavailableĐoàn Trần Công Danh, Mar 22, 2020
  6. 5/8 t5616: use rev-parse instead to get HEAD's object_idĐoàn Trần Công Danh, Mar 22, 2020
  7. 6/8 t7063: drop non-POSIX argument "-ls" from find(1)Đoàn Trần Công Danh, Mar 22, 2020
  8. Johannes SchindelinMar 23, 2020
  9. Torsten BögershausenMar 23, 2020
  10. Danh DoanMar 23, 2020
  11. Junio C HamanoMar 23, 2020
  12. Junio C HamanoMar 23, 2020
  13. Johannes SchindelinMar 24, 2020
  14. Junio C HamanoMar 24, 2020
  15. 7/8 t4124: fix test for non-compliant diff(1)Đoàn Trần Công Danh, Mar 22, 2020
  16. Johannes SchindelinMar 23, 2020
  17. Danh DoanMar 23, 2020
  18. Junio C HamanoMar 23, 2020
  19. Danh DoanMar 24, 2020
  20. Junio C HamanoMar 24, 2020
  21. Danh DoanMar 25, 2020
  22. Johannes SchindelinMar 24, 2020
  23. Junio C HamanoMar 24, 2020
  24. Johannes SchindelinMar 25, 2020
  25. 8/8 t5703: feed raw data into test-tool unpack-sidebandĐoàn Trần Công Danh, Mar 22, 2020
  26. Jeff KingMar 22, 2020
  27. 0/8 fix test failure with busyboxĐoàn Trần Công Danh, Mar 26, 2020
  28. 1/8 t4061: use POSIX compliant regex(7)Đoàn Trần Công Danh, Mar 26, 2020
  29. 2/8 test-lib-functions: test_cmp: eval $GIT_TEST_CMPĐoàn Trần Công Danh, Mar 26, 2020
  30. 3/8 t5003: drop the subshell in test_lazy_prereqĐoàn Trần Công Danh, Mar 26, 2020
  31. 4/8 t5003: skip conversion test if unzip -a is unavailableĐoàn Trần Công Danh, Mar 26, 2020
  32. 5/8 t5616: use rev-parse instead to get HEAD's object_idĐoàn Trần Công Danh, Mar 26, 2020
  33. 7/8 t4124: fix test for non-compliant diff(1)Đoàn Trần Công Danh, Mar 26, 2020
  34. Junio C HamanoMar 27, 2020
  35. 6/8 t7063: drop non-POSIX argument "-ls" from find(1)Đoàn Trần Công Danh, Mar 26, 2020
  36. 8/8 t5703: feed raw data into test-tool unpack-sidebandĐoàn Trần Công Danh, Mar 26, 2020

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.