diff mbox series

diff-highlight: link to diff-highlight in DESTDIR #Makefile #diff-highlight

Message ID pull.938.git.git.1728745399993.gitgitgadget@gmail.com (mailing list archive)
State New
Headers show
Series diff-highlight: link to diff-highlight in DESTDIR #Makefile #diff-highlight | expand

Commit Message

immeëmosol Oct. 12, 2024, 3:03 p.m. UTC
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
    
    In order to immediately make git's diff-highlight program available for
    command-line instructions; add a symlink to the generated/concatenated
    diff-highlight perl script(s) in DESTDIR

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-938%2Fimme-emosol%2Fpatch-1-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-938/imme-emosol/patch-1-v1
Pull-Request: https://github.com/git/git/pull/938

 contrib/diff-highlight/Makefile | 2 ++
 1 file changed, 2 insertions(+)


base-commit: ef8ce8f3d4344fd3af049c17eeba5cd20d98b69f

Comments

Taylor Blau Oct. 12, 2024, 3:50 p.m. UTC | #1
On Sat, Oct 12, 2024 at 03:03:19PM +0000, immeëmosol via GitGitGadget wrote:
> diff --git a/contrib/diff-highlight/Makefile b/contrib/diff-highlight/Makefile
> index f2be7cc9243..10c588a7929 100644
> --- a/contrib/diff-highlight/Makefile
> +++ b/contrib/diff-highlight/Makefile
> @@ -9,6 +9,7 @@ diff-highlight: shebang.perl DiffHighlight.pm diff-highlight.perl
>  	cat $^ >$@+
>  	chmod +x $@+
>  	mv $@+ $@
> +	ln --symbolic --target-directory=$(DESTDIR) $(abspath $@)

Hmm. I am not opposed to having diff-highlight's Makefile be responsible
for installing a symbolic link to the generated script, but I do not
think that this Makefile recipe is the right place to do it.

This recipe is about building the executable, not installing it. If you
want to introduce a separate .PHONY recipe for installing the script, I
think that would be a better place to introduce this change.

Thanks,
Taylor
diff mbox series

Patch

diff --git a/contrib/diff-highlight/Makefile b/contrib/diff-highlight/Makefile
index f2be7cc9243..10c588a7929 100644
--- a/contrib/diff-highlight/Makefile
+++ b/contrib/diff-highlight/Makefile
@@ -9,6 +9,7 @@  diff-highlight: shebang.perl DiffHighlight.pm diff-highlight.perl
 	cat $^ >$@+
 	chmod +x $@+
 	mv $@+ $@
+	ln --symbolic --target-directory=$(DESTDIR) $(abspath $@)
 
 shebang.perl: FORCE
 	@echo '#!$(PERL_PATH_SQ)' >$@+
@@ -19,5 +20,6 @@  test: all
 
 clean:
 	$(RM) diff-highlight
+	$(RM) --force $(DESTDIR)diff-highlight
 
 .PHONY: FORCE