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

[PATCH v5 05/18] Do not use "diff" found on PATH while building and installing

From
GVGary V. Vaughan <git@mlists.thewrittenword.com>
Date
May 14, 2010, 09:31 UTC
Message-ID
<20100514093746.689775000@mlists.thewrittenword.com>
In-Reply-To
<20100514093131.249094000@mlists.thewrittenword.com>

Some of the flags used with the first diff found in PATH cause the vendor diff to choke.

Signed-off-by: Gary V. Vaughan <gary@thewrittenword.com>
---
 Documentation/install-webdoc.sh |    2 +-
 Makefile                        |    4 +++-
 config.mak.in                   |    1 +
 configure.ac                    |    1 +
 git-merge-one-file.sh           |    2 +-
 5 files changed, 7 insertions(+), 3 deletions(-)
Index: b/Makefile
===================================================================
--- a/Makefile
+++ b/Makefile
@@ -287,6 +287,7 @@ export prefix bindir sharedir sysconfdir
 CC = gcc
 AR = ar
 RM = rm -f
+DIFF = diff
 TAR = tar
 FIND = find
 INSTALL = install
@@ -1460,7 +1461,7 @@ endif
 ALL_CFLAGS += $(BASIC_CFLAGS)
 ALL_LDFLAGS += $(BASIC_LDFLAGS)
 
-export TAR INSTALL DESTDIR SHELL_PATH
+export DIFF TAR INSTALL DESTDIR SHELL_PATH
 
 
 ### Build rules
@@ -1877,6 +1878,7 @@ GIT-CFLAGS: FORCE
 GIT-BUILD-OPTIONS: FORCE
 	@echo SHELL_PATH=\''$(subst ','\'',$(SHELL_PATH_SQ))'\' >$@
 	@echo PERL_PATH=\''$(subst ','\'',$(PERL_PATH_SQ))'\' >>$@
+	@echo DIFF=\''$(subst ','\'',$(subst ','\'',$(DIFF)))'\' >>$@
 	@echo TAR=\''$(subst ','\'',$(subst ','\'',$(TAR)))'\' >>$@
 	@echo NO_CURL=\''$(subst ','\'',$(subst ','\'',$(NO_CURL)))'\' >>$@
 	@echo NO_PERL=\''$(subst ','\'',$(subst ','\'',$(NO_PERL)))'\' >>$@
Index: b/configure.ac
===================================================================
--- a/configure.ac
+++ b/configure.ac
@@ -362,6 +362,7 @@ fi
 #AC_PROG_INSTALL		# needs install-sh or install.sh in sources
 AC_CHECK_TOOLS(AR, [gar ar], :)
 AC_CHECK_PROGS(TAR, [gtar tar])
+AC_CHECK_PROGS(DIFF, [gnudiff gdiff diff])
 # TCLTK_PATH will be set to some value if we want Tcl/Tk
 # or will be empty otherwise.
 if test -z "$NO_TCLTK"; then
Index: b/Documentation/install-webdoc.sh
===================================================================
--- a/Documentation/install-webdoc.sh
+++ b/Documentation/install-webdoc.sh
@@ -12,7 +12,7 @@ do
 	then
 		: did not match
 	elif test -f "$T/$h" &&
-	   diff -u -I'Last updated [0-9][0-9]-[A-Z][a-z][a-z]-' "$T/$h" "$h"
+	   $DIFF -u -I'Last updated [0-9][0-9]-[A-Z][a-z][a-z]-' "$T/$h" "$h"
 	then
 		:; # up to date
 	else
Index: b/git-merge-one-file.sh
===================================================================
--- a/git-merge-one-file.sh
+++ b/git-merge-one-file.sh
@@ -107,7 +107,7 @@ case "${1:-.}${2:-.}${3:-.}" in
 		# remove lines that are unique to ours.
 		orig=`git-unpack-file $2`
 		sz0=`wc -c <"$orig"`
-		diff -u -La/$orig -Lb/$orig $orig $src2 | git apply --no-add
+		$DIFF -u -La/$orig -Lb/$orig $orig $src2 | git apply --no-add
 		sz1=`wc -c <"$orig"`
 
 		# If we do not have enough common material, it is not
Index: b/config.mak.in
===================================================================
--- a/config.mak.in
+++ b/config.mak.in
@@ -8,6 +8,7 @@ LDFLAGS = @LDFLAGS@
 CC_LD_DYNPATH = @CC_LD_DYNPATH@
 AR = @AR@
 TAR = @TAR@
+DIFF = @DIFF@
 #INSTALL = @INSTALL@		# needs install-sh or install.sh in sources
 TCLTK_PATH = @TCLTK_PATH@
 
-- 
Gary V. Vaughan (gary@thewrittenword.com)
Previous: Gary V. VaughanNext: Junio C Hamano
Message 11 of 34 in “Portability patches for git-1.7.1”
  1. 00/18 Portability patches for git-1.7.1Gary V. Vaughan, May 14, 2010
  2. 01/18 Makefile: pass CPPFLAGS through to fllow customizationGary V. Vaughan, May 14, 2010
  3. Robin H. JohnsonMay 14, 2010
  4. Gary V. VaughanMay 14, 2010
  5. Robin H. JohnsonMay 14, 2010
  6. Gary V. VaughanMay 14, 2010
  7. 02/18 Rewrite dynamic structure initializations to runtime assignmentGary V. Vaughan, May 14, 2010
  8. Junio C HamanoJun 2, 2010
  9. 03/18 Makefile: -lpthread may still be necessary when libc has only pthread stubsGary V. Vaughan, May 14, 2010
  10. 04/18 enums: omit trailing comma for portabilityGary V. Vaughan, May 14, 2010
  11. 05/18 Do not use "diff" found on PATH while building and installingGary V. Vaughan, May 14, 2010
  12. Junio C HamanoJun 2, 2010
  13. 06/18 tests: use "test_cmp", not "diff", when verifying the resultGary V. Vaughan, May 14, 2010
  14. Junio C HamanoJun 2, 2010
  15. 07/18 test_cmp: do not use "diff -u" on platforms that lack oneGary V. Vaughan, May 14, 2010
  16. 08/18 git-compat-util.h: some platforms with mmap() lack MAP_FAILED definitionGary V. Vaughan, May 14, 2010
  17. 09/18 Makefile: some platforms do not have hstrerror anywhereGary V. Vaughan, May 14, 2010
  18. 10/18 Make NO_{INET_NTOP,INET_PTON} configured independentlyGary V. Vaughan, May 14, 2010
  19. 11/18 Some platforms lack socklen_t typeGary V. Vaughan, May 14, 2010
  20. 12/18 Allow disabling "inline"Gary V. Vaughan, May 14, 2010
  21. 13/18 inline declaration does not work on AIXGary V. Vaughan, May 14, 2010
  22. 14/18 Makefile: SunOS 5.6 portability fixGary V. Vaughan, May 14, 2010
  23. 15/18 git-compat-util.h: Irix 6.5 defines sgi but not __sgi.Gary V. Vaughan, May 14, 2010
  24. git-compat-util.h: use apparently more common __sgi macro to detect SGI IRIXBrandon Casey, Jun 2, 2010
  25. Gary V. VaughanJun 2, 2010
  26. Tor ArntsenJun 2, 2010
  27. 16/18 Makefile: HPUX11 portability fixes.Gary V. Vaughan, May 14, 2010
  28. 17/18 Makefile: HP-UX 10.20 portability fixes.Gary V. Vaughan, May 14, 2010
  29. 18/18 Makefile: Tru64 portability fixGary V. Vaughan, May 14, 2010
  30. Gary V. VaughanMay 26, 2010
  31. Gary V. VaughanJun 7, 2010
  32. Junio C HamanoJun 7, 2010
  33. Tor ArntsenJun 9, 2010
  34. Junio C HamanoJun 11, 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.