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

[PATCH v3] diff-highlight: make install link into DESTDIR

From
immeëmosol via GitGitGadget <gitgitgadget@gmail.com>
Date
Oct 12, 2024, 20:23 UTC
Message-ID
<pull.938.v3.git.git.1728764613835.gitgitgadget@gmail.com>
In-Reply-To
<pull.938.v2.git.git.1728754230466.gitgitgadget@gmail.com>
From: =?UTF-8?q?imme=C3=ABmosol?= <will+developer@willfris.nl>

Make git's diff-highlight program immediately available to the command-line. Create a link in DESTDIR that refers to the generated/concatenated diff-highlight perl script

Signed-off-by: immeëmosol <will+developer@willfris.nl>
---
    add symlinking diff-highlight into DESTDIR
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-938%2Fimme-emosol%2Fpatch-1-v3
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-938/imme-emosol/patch-1-v3
Pull-Request: https://github.com/git/git/pull/938
Range-diff vs v2:
 1:  ca76f336ded ! 1:  af4bea815fa diff-highlight: make install link into DESTDIR #Makefile
     @@ Metadata
      Author: immeëmosol <will+developer@willfris.nl>
      
       ## Commit message ##
     -    diff-highlight: make install link into DESTDIR #Makefile
     +    diff-highlight: make install link into DESTDIR
      
          Make git's diff-highlight program immediately available to the command-line.
          Create a link in DESTDIR that
     @@ contrib/diff-highlight/Makefile: diff-highlight: shebang.perl DiffHighlight.pm d
       	mv $@+ $@
       
      +install: diff-highlight
     -+	test -w $(DESTDIR) && \
     -+		ln --symbolic --target-directory=$(DESTDIR) $(abspath $<)
     ++	test -w $(DESTDIR) && ln -s $(abspath $<) $(DESTDIR)
      +
       shebang.perl: FORCE
       	@echo '#!$(PERL_PATH_SQ)' >$@+
     @@ contrib/diff-highlight/Makefile: test: all
       
       clean:
      +	test ! -L $(DESTDIR)/diff-highlight || \
     -+		$(RM) --force $(DESTDIR)/diff-highlight
     ++		$(RM) -f $(DESTDIR)/diff-highlight
       	$(RM) diff-highlight
       
       .PHONY: FORCE
 contrib/diff-highlight/Makefile | 6 ++++++
 1 file changed, 6 insertions(+)
diff --git a/contrib/diff-highlight/Makefile b/contrib/diff-highlight/Makefile
index f2be7cc9243..a53e09e0bdd 100644
--- a/contrib/diff-highlight/Makefile
+++ b/contrib/diff-highlight/Makefile
@@ -10,6 +10,9 @@ diff-highlight: shebang.perl DiffHighlight.pm diff-highlight.perl
 	chmod +x $@+
 	mv $@+ $@
 
+install: diff-highlight
+	test -w $(DESTDIR) && ln -s $(abspath $<) $(DESTDIR)
+
 shebang.perl: FORCE
 	@echo '#!$(PERL_PATH_SQ)' >$@+
 	@cmp $@+ $@ >/dev/null 2>/dev/null || mv $@+ $@
@@ -18,6 +21,9 @@ test: all
 	$(MAKE) -C t
 
 clean:
+	test ! -L $(DESTDIR)/diff-highlight || \
+		$(RM) -f $(DESTDIR)/diff-highlight
 	$(RM) diff-highlight
 
 .PHONY: FORCE
+.PHONY: install

base-commit: ef8ce8f3d4344fd3af049c17eeba5cd20d98b69f
-- 
gitgitgadget
Previous: Junio C HamanoNext: Jeff King
Message 7 of 11 in “diff-highlight: link to diff-highlight in DESTDIR #Makefile #diff-highlight”
  1. diff-highlight: link to diff-highlight in DESTDIR #Makefile #diff-highlightimmeëmosol via GitGitGadget, Oct 12, 2024
  2. Taylor BlauOct 12, 2024
  3. diff-highlight: make install link into DESTDIR #Makefileimmeëmosol via GitGitGadget, Oct 12, 2024
  4. Kristoffer HaugsbakkOct 12, 2024
  5. immeëmosolOct 12, 2024
  6. Junio C HamanoOct 12, 2024
  7. diff-highlight: make install link into DESTDIRimmeëmosol via GitGitGadget, Oct 12, 2024
  8. Jeff KingOct 12, 2024
  9. immeëmosolOct 12, 2024
  10. Đoàn Trần Công DanhOct 14, 2024
  11. Taylor BlauOct 14, 2024

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.