diff mbox series

[v2] diff-highlight: make install link into DESTDIR #Makefile

Message ID pull.938.v2.git.git.1728754230466.gitgitgadget@gmail.com (mailing list archive)
State New
Headers show
Series [v2] diff-highlight: make install link into DESTDIR #Makefile | expand

Commit Message

immeëmosol Oct. 12, 2024, 5:30 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

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

Range-diff vs v1:

 1:  e23aeb1a76c ! 1:  ca76f336ded diff-highlight: link to diff-highlight in DESTDIR #Makefile #diff-highlight
     @@ Metadata
      Author: immeëmosol <will+developer@willfris.nl>
      
       ## Commit message ##
     -    diff-highlight: link to diff-highlight in DESTDIR #Makefile #diff-highlight
     +    diff-highlight: make install link into DESTDIR #Makefile
      
          Make git's diff-highlight program immediately available to the command-line.
          Create a link in DESTDIR that
     @@ Commit message
      
       ## contrib/diff-highlight/Makefile ##
      @@ contrib/diff-highlight/Makefile: diff-highlight: shebang.perl DiffHighlight.pm diff-highlight.perl
     - 	cat $^ >$@+
       	chmod +x $@+
       	mv $@+ $@
     -+	ln --symbolic --target-directory=$(DESTDIR) $(abspath $@)
       
     ++install: diff-highlight
     ++	test -w $(DESTDIR) && \
     ++		ln --symbolic --target-directory=$(DESTDIR) $(abspath $<)
     ++
       shebang.perl: FORCE
       	@echo '#!$(PERL_PATH_SQ)' >$@+
     + 	@cmp $@+ $@ >/dev/null 2>/dev/null || mv $@+ $@
      @@ contrib/diff-highlight/Makefile: test: all
     + 	$(MAKE) -C t
       
       clean:
     ++	test ! -L $(DESTDIR)/diff-highlight || \
     ++		$(RM) --force $(DESTDIR)/diff-highlight
       	$(RM) diff-highlight
     -+	$(RM) --force $(DESTDIR)diff-highlight
       
       .PHONY: FORCE
     ++.PHONY: install


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


base-commit: ef8ce8f3d4344fd3af049c17eeba5cd20d98b69f

Comments

Kristoffer Haugsbakk Oct. 12, 2024, 6:35 p.m. UTC | #1
On Sat, Oct 12, 2024, at 19:30, immeëmosol via GitGitGadget wrote:
> [PATCH v2] diff-highlight: make install link into DESTDIR #Makefile

What does `#Makefile` mean?  Previous subject had two of these:

    diff-highlight: link to diff-highlight in DESTDIR #Makefile #diff-highlight
immeëmosol Oct. 12, 2024, 7:10 p.m. UTC | #2
On Sat, 12 Oct 2024, 20:35 Kristoffer Haugsbakk,
<kristofferhaugsbakk@fastmail.com> wrote:
>
> On Sat, Oct 12, 2024, at 19:30, immeëmosol via GitGitGadget wrote:
> > [PATCH v2] diff-highlight: make install link into DESTDIR #Makefile
>
> What does `#Makefile` mean?  […]

not much.
It is an attempt to signify what the commit relates to.
In this case it might hint at the commit not impacting the sources of
what is built, but the build process itself.
Maybe #
Junio C Hamano Oct. 12, 2024, 7:22 p.m. UTC | #3
immeëmosol <will+developer@willfris.nl> writes:

> On Sat, 12 Oct 2024, 20:35 Kristoffer Haugsbakk,
> <kristofferhaugsbakk@fastmail.com> wrote:
>>
>> On Sat, Oct 12, 2024, at 19:30, immeëmosol via GitGitGadget wrote:
>> > [PATCH v2] diff-highlight: make install link into DESTDIR #Makefile
>>
>> What does `#Makefile` mean?  […]
>
> not much.
> It is an attempt to signify what the commit relates to.
> In this case it might hint at the commit not impacting the sources of
> what is built, but the build process itself.
> Maybe #
diff mbox series

Patch

diff --git a/contrib/diff-highlight/Makefile b/contrib/diff-highlight/Makefile
index f2be7cc9243..19e0cf17ccd 100644
--- a/contrib/diff-highlight/Makefile
+++ b/contrib/diff-highlight/Makefile
@@ -10,6 +10,10 @@  diff-highlight: shebang.perl DiffHighlight.pm diff-highlight.perl
 	chmod +x $@+
 	mv $@+ $@
 
+install: diff-highlight
+	test -w $(DESTDIR) && \
+		ln --symbolic --target-directory=$(DESTDIR) $(abspath $<)
+
 shebang.perl: FORCE
 	@echo '#!$(PERL_PATH_SQ)' >$@+
 	@cmp $@+ $@ >/dev/null 2>/dev/null || mv $@+ $@
@@ -18,6 +22,9 @@  test: all
 	$(MAKE) -C t
 
 clean:
+	test ! -L $(DESTDIR)/diff-highlight || \
+		$(RM) --force $(DESTDIR)/diff-highlight
 	$(RM) diff-highlight
 
 .PHONY: FORCE
+.PHONY: install