{"thread":{"id":"62324","subject":"[PATCH] diff-highlight: link to diff-highlight in DESTDIR #Makefile #diff-highlight","startedAt":"2024-10-12T15:03:23Z","lastAt":"2024-10-14T22:17:03Z","messageCount":11,"participants":["immeëmosol via GitGitGadget","Taylor Blau","Kristoffer Haugsbakk","immeëmosol","Junio C Hamano","Jeff King","Đoàn Trần Công Danh"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"504917","messageId":"pull.938.git.git.1728745399993.gitgitgadget@gmail.com","threadId":"62324","inReplyTo":null,"subject":"[PATCH] diff-highlight: link to diff-highlight in DESTDIR #Makefile #diff-highlight","fromName":"immeëmosol via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2024-10-12T15:03:19Z","receivedAt":"2024-10-12T15:03:23Z","isPatch":true,"sender":{"key":"will+developer@willfris.nl","avatar":"https://gravatar.com/avatar/96b20c11170f6723e1b074c6540ac6a2dc010d0c7f80823a831357fab9e7208f?d=mp&s=160"},"body":"From: =?UTF-8?q?imme=C3=ABmosol?= <will+developer@willfris.nl>\n\nMake git's diff-highlight program immediately available to the command-line.\nCreate a link in DESTDIR that\nrefers to the generated/concatenated diff-highlight perl script\n\nSigned-off-by: immeëmosol <will+developer@willfris.nl>\n---\n    add symlinking diff-highlight into DESTDIR\n    \n    In order to immediately make git's diff-highlight program available for\n    command-line instructions; add a symlink to the generated/concatenated\n    diff-highlight perl script(s) in DESTDIR\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-938%2Fimme-emosol%2Fpatch-1-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-938/imme-emosol/patch-1-v1\nPull-Request: https://github.com/git/git/pull/938\n\n contrib/diff-highlight/Makefile | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/contrib/diff-highlight/Makefile b/contrib/diff-highlight/Makefile\nindex f2be7cc9243..10c588a7929 100644\n--- a/contrib/diff-highlight/Makefile\n+++ b/contrib/diff-highlight/Makefile\n@@ -9,6 +9,7 @@ diff-highlight: shebang.perl DiffHighlight.pm diff-highlight.perl\n \tcat $^ >$@+\n \tchmod +x $@+\n \tmv $@+ $@\n+\tln --symbolic --target-directory=$(DESTDIR) $(abspath $@)\n \n shebang.perl: FORCE\n \t@echo '#!$(PERL_PATH_SQ)' >$@+\n@@ -19,5 +20,6 @@ test: all\n \n clean:\n \t$(RM) diff-highlight\n+\t$(RM) --force $(DESTDIR)diff-highlight\n \n .PHONY: FORCE\n\nbase-commit: ef8ce8f3d4344fd3af049c17eeba5cd20d98b69f\n-- \ngitgitgadget\n"},{"id":"504918","messageId":"Zwqa3YFt9+dfKmHM@nand.local","threadId":"62324","inReplyTo":"pull.938.git.git.1728745399993.gitgitgadget@gmail.com","subject":"Re: [PATCH] diff-highlight: link to diff-highlight in DESTDIR #Makefile #diff-highlight","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2024-10-12T15:50:53Z","receivedAt":"2024-10-12T15:50:56Z","isPatch":true,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"On Sat, Oct 12, 2024 at 03:03:19PM +0000, immeëmosol via GitGitGadget wrote:\n> diff --git a/contrib/diff-highlight/Makefile b/contrib/diff-highlight/Makefile\n> index f2be7cc9243..10c588a7929 100644\n> --- a/contrib/diff-highlight/Makefile\n> +++ b/contrib/diff-highlight/Makefile\n> @@ -9,6 +9,7 @@ diff-highlight: shebang.perl DiffHighlight.pm diff-highlight.perl\n>  \tcat $^ >$@+\n>  \tchmod +x $@+\n>  \tmv $@+ $@\n> +\tln --symbolic --target-directory=$(DESTDIR) $(abspath $@)\n\nHmm. I am not opposed to having diff-highlight's Makefile be responsible\nfor installing a symbolic link to the generated script, but I do not\nthink that this Makefile recipe is the right place to do it.\n\nThis recipe is about building the executable, not installing it. If you\nwant to introduce a separate .PHONY recipe for installing the script, I\nthink that would be a better place to introduce this change.\n\nThanks,\nTaylor\n"},{"id":"504921","messageId":"pull.938.v2.git.git.1728754230466.gitgitgadget@gmail.com","threadId":"62324","inReplyTo":"pull.938.git.git.1728745399993.gitgitgadget@gmail.com","subject":"[PATCH v2] diff-highlight: make install link into DESTDIR #Makefile","fromName":"immeëmosol via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2024-10-12T17:30:30Z","receivedAt":"2024-10-12T17:30:33Z","isPatch":true,"sender":{"key":"will+developer@willfris.nl","avatar":"https://gravatar.com/avatar/96b20c11170f6723e1b074c6540ac6a2dc010d0c7f80823a831357fab9e7208f?d=mp&s=160"},"body":"From: =?UTF-8?q?imme=C3=ABmosol?= <will+developer@willfris.nl>\n\nMake git's diff-highlight program immediately available to the command-line.\nCreate a link in DESTDIR that\nrefers to the generated/concatenated diff-highlight perl script\n\nSigned-off-by: immeëmosol <will+developer@willfris.nl>\n---\n    add symlinking diff-highlight into DESTDIR\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-938%2Fimme-emosol%2Fpatch-1-v2\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-938/imme-emosol/patch-1-v2\nPull-Request: https://github.com/git/git/pull/938\n\nRange-diff vs v1:\n\n 1:  e23aeb1a76c ! 1:  ca76f336ded diff-highlight: link to diff-highlight in DESTDIR #Makefile #diff-highlight\n     @@ Metadata\n      Author: immeëmosol <will+developer@willfris.nl>\n      \n       ## Commit message ##\n     -    diff-highlight: link to diff-highlight in DESTDIR #Makefile #diff-highlight\n     +    diff-highlight: make install link into DESTDIR #Makefile\n      \n          Make git's diff-highlight program immediately available to the command-line.\n          Create a link in DESTDIR that\n     @@ Commit message\n      \n       ## contrib/diff-highlight/Makefile ##\n      @@ contrib/diff-highlight/Makefile: diff-highlight: shebang.perl DiffHighlight.pm diff-highlight.perl\n     - \tcat $^ >$@+\n       \tchmod +x $@+\n       \tmv $@+ $@\n     -+\tln --symbolic --target-directory=$(DESTDIR) $(abspath $@)\n       \n     ++install: diff-highlight\n     ++\ttest -w $(DESTDIR) && \\\n     ++\t\tln --symbolic --target-directory=$(DESTDIR) $(abspath $<)\n     ++\n       shebang.perl: FORCE\n       \t@echo '#!$(PERL_PATH_SQ)' >$@+\n     + \t@cmp $@+ $@ >/dev/null 2>/dev/null || mv $@+ $@\n      @@ contrib/diff-highlight/Makefile: test: all\n     + \t$(MAKE) -C t\n       \n       clean:\n     ++\ttest ! -L $(DESTDIR)/diff-highlight || \\\n     ++\t\t$(RM) --force $(DESTDIR)/diff-highlight\n       \t$(RM) diff-highlight\n     -+\t$(RM) --force $(DESTDIR)diff-highlight\n       \n       .PHONY: FORCE\n     ++.PHONY: install\n\n\n contrib/diff-highlight/Makefile | 7 +++++++\n 1 file changed, 7 insertions(+)\n\ndiff --git a/contrib/diff-highlight/Makefile b/contrib/diff-highlight/Makefile\nindex f2be7cc9243..19e0cf17ccd 100644\n--- a/contrib/diff-highlight/Makefile\n+++ b/contrib/diff-highlight/Makefile\n@@ -10,6 +10,10 @@ diff-highlight: shebang.perl DiffHighlight.pm diff-highlight.perl\n \tchmod +x $@+\n \tmv $@+ $@\n \n+install: diff-highlight\n+\ttest -w $(DESTDIR) && \\\n+\t\tln --symbolic --target-directory=$(DESTDIR) $(abspath $<)\n+\n shebang.perl: FORCE\n \t@echo '#!$(PERL_PATH_SQ)' >$@+\n \t@cmp $@+ $@ >/dev/null 2>/dev/null || mv $@+ $@\n@@ -18,6 +22,9 @@ test: all\n \t$(MAKE) -C t\n \n clean:\n+\ttest ! -L $(DESTDIR)/diff-highlight || \\\n+\t\t$(RM) --force $(DESTDIR)/diff-highlight\n \t$(RM) diff-highlight\n \n .PHONY: FORCE\n+.PHONY: install\n\nbase-commit: ef8ce8f3d4344fd3af049c17eeba5cd20d98b69f\n-- \ngitgitgadget\n"},{"id":"504922","messageId":"d2aeda41-84fe-4ddb-89e2-5cafbbb213fc@app.fastmail.com","threadId":"62324","inReplyTo":"pull.938.v2.git.git.1728754230466.gitgitgadget@gmail.com","subject":"Re: [PATCH v2] diff-highlight: make install link into DESTDIR #Makefile","fromName":"Kristoffer Haugsbakk","fromEmail":"kristofferhaugsbakk@fastmail.com","sentAt":"2024-10-12T18:35:12Z","receivedAt":"2024-10-12T18:35:33Z","isPatch":true,"sender":{"key":"kristofferhaugsbakk@fastmail.com","avatar":null},"body":"On Sat, Oct 12, 2024, at 19:30, immeëmosol via GitGitGadget wrote:\n> [PATCH v2] diff-highlight: make install link into DESTDIR #Makefile\n\nWhat does `#Makefile` mean?  Previous subject had two of these:\n\n    diff-highlight: link to diff-highlight in DESTDIR #Makefile #diff-highlight\n\n-- \nKristoffer Haugsbakk\n"},{"id":"504924","messageId":"CABOUa4aY6GdoBH+XZFCRknpiOP-F=SE_b=B3RLjO-WdS_Quikw@mail.gmail.com","threadId":"62324","inReplyTo":"d2aeda41-84fe-4ddb-89e2-5cafbbb213fc@app.fastmail.com","subject":"Re: [PATCH v2] diff-highlight: make install link into DESTDIR #Makefile","fromName":"immeëmosol","fromEmail":"will+developer@willfris.nl","sentAt":"2024-10-12T19:10:09Z","receivedAt":"2024-10-12T19:10:47Z","isPatch":true,"sender":{"key":"will+developer@willfris.nl","avatar":"https://gravatar.com/avatar/96b20c11170f6723e1b074c6540ac6a2dc010d0c7f80823a831357fab9e7208f?d=mp&s=160"},"body":"On Sat, 12 Oct 2024, 20:35 Kristoffer Haugsbakk,\n<kristofferhaugsbakk@fastmail.com> wrote:\n>\n> On Sat, Oct 12, 2024, at 19:30, immeëmosol via GitGitGadget wrote:\n> > [PATCH v2] diff-highlight: make install link into DESTDIR #Makefile\n>\n> What does `#Makefile` mean?  […]\n\nnot much.\nIt is an attempt to signify what the commit relates to.\nIn this case it might hint at the commit not impacting the sources of\nwhat is built, but the build process itself.\nMaybe #🏗️ would be more clear.\n"},{"id":"504925","messageId":"xmqq8qut9ldz.fsf@gitster.g","threadId":"62324","inReplyTo":"CABOUa4aY6GdoBH+XZFCRknpiOP-F=SE_b=B3RLjO-WdS_Quikw@mail.gmail.com","subject":"Re: [PATCH v2] diff-highlight: make install link into DESTDIR #Makefile","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-10-12T19:22:32Z","receivedAt":"2024-10-12T19:22:35Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"immeëmosol <will+developer@willfris.nl> writes:\n\n> On Sat, 12 Oct 2024, 20:35 Kristoffer Haugsbakk,\n> <kristofferhaugsbakk@fastmail.com> wrote:\n>>\n>> On Sat, Oct 12, 2024, at 19:30, immeëmosol via GitGitGadget wrote:\n>> > [PATCH v2] diff-highlight: make install link into DESTDIR #Makefile\n>>\n>> What does `#Makefile` mean?  […]\n>\n> not much.\n> It is an attempt to signify what the commit relates to.\n> In this case it might hint at the commit not impacting the sources of\n> what is built, but the build process itself.\n> Maybe #🏗️ would be more clear.\n\nDrop all these.  Study \"git shortlog --no-merges\" from the recent\nhistory and try to blend in.  Don't try to be original where the\noriginality does not matter.\n\nAlso, resist the temptation to go outside POSIX.1 needlessly.\n\n  https://pubs.opengroup.org/onlinepubs/9799919799/utilities/rm.html#tag_20_104\n\ndoes not say \"rm\" takes \"--force\" and\n\n  https://pubs.opengroup.org/onlinepubs/9799919799/utilities/ln.html#tag_20_67\n\ndoes not say \"ln\" takes \"--symbolic\" nor \"--target-directory\".\n\nBe inclusive and help those whose userland tools are not tainted by\nGNUisms.\n\nThanks.\n"},{"id":"504927","messageId":"pull.938.v3.git.git.1728764613835.gitgitgadget@gmail.com","threadId":"62324","inReplyTo":"pull.938.v2.git.git.1728754230466.gitgitgadget@gmail.com","subject":"[PATCH v3] diff-highlight: make install link into DESTDIR","fromName":"immeëmosol via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2024-10-12T20:23:33Z","receivedAt":"2024-10-12T20:23:36Z","isPatch":true,"sender":{"key":"will+developer@willfris.nl","avatar":"https://gravatar.com/avatar/96b20c11170f6723e1b074c6540ac6a2dc010d0c7f80823a831357fab9e7208f?d=mp&s=160"},"body":"From: =?UTF-8?q?imme=C3=ABmosol?= <will+developer@willfris.nl>\n\nMake git's diff-highlight program immediately available to the command-line.\nCreate a link in DESTDIR that\nrefers to the generated/concatenated diff-highlight perl script\n\nSigned-off-by: immeëmosol <will+developer@willfris.nl>\n---\n    add symlinking diff-highlight into DESTDIR\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-938%2Fimme-emosol%2Fpatch-1-v3\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-938/imme-emosol/patch-1-v3\nPull-Request: https://github.com/git/git/pull/938\n\nRange-diff vs v2:\n\n 1:  ca76f336ded ! 1:  af4bea815fa diff-highlight: make install link into DESTDIR #Makefile\n     @@ Metadata\n      Author: immeëmosol <will+developer@willfris.nl>\n      \n       ## Commit message ##\n     -    diff-highlight: make install link into DESTDIR #Makefile\n     +    diff-highlight: make install link into DESTDIR\n      \n          Make git's diff-highlight program immediately available to the command-line.\n          Create a link in DESTDIR that\n     @@ contrib/diff-highlight/Makefile: diff-highlight: shebang.perl DiffHighlight.pm d\n       \tmv $@+ $@\n       \n      +install: diff-highlight\n     -+\ttest -w $(DESTDIR) && \\\n     -+\t\tln --symbolic --target-directory=$(DESTDIR) $(abspath $<)\n     ++\ttest -w $(DESTDIR) && ln -s $(abspath $<) $(DESTDIR)\n      +\n       shebang.perl: FORCE\n       \t@echo '#!$(PERL_PATH_SQ)' >$@+\n     @@ contrib/diff-highlight/Makefile: test: all\n       \n       clean:\n      +\ttest ! -L $(DESTDIR)/diff-highlight || \\\n     -+\t\t$(RM) --force $(DESTDIR)/diff-highlight\n     ++\t\t$(RM) -f $(DESTDIR)/diff-highlight\n       \t$(RM) diff-highlight\n       \n       .PHONY: FORCE\n\n\n contrib/diff-highlight/Makefile | 6 ++++++\n 1 file changed, 6 insertions(+)\n\ndiff --git a/contrib/diff-highlight/Makefile b/contrib/diff-highlight/Makefile\nindex f2be7cc9243..a53e09e0bdd 100644\n--- a/contrib/diff-highlight/Makefile\n+++ b/contrib/diff-highlight/Makefile\n@@ -10,6 +10,9 @@ diff-highlight: shebang.perl DiffHighlight.pm diff-highlight.perl\n \tchmod +x $@+\n \tmv $@+ $@\n \n+install: diff-highlight\n+\ttest -w $(DESTDIR) && ln -s $(abspath $<) $(DESTDIR)\n+\n shebang.perl: FORCE\n \t@echo '#!$(PERL_PATH_SQ)' >$@+\n \t@cmp $@+ $@ >/dev/null 2>/dev/null || mv $@+ $@\n@@ -18,6 +21,9 @@ test: all\n \t$(MAKE) -C t\n \n clean:\n+\ttest ! -L $(DESTDIR)/diff-highlight || \\\n+\t\t$(RM) -f $(DESTDIR)/diff-highlight\n \t$(RM) diff-highlight\n \n .PHONY: FORCE\n+.PHONY: install\n\nbase-commit: ef8ce8f3d4344fd3af049c17eeba5cd20d98b69f\n-- \ngitgitgadget\n"},{"id":"504928","messageId":"20241012205506.GA55242@coredump.intra.peff.net","threadId":"62324","inReplyTo":"pull.938.v3.git.git.1728764613835.gitgitgadget@gmail.com","subject":"Re: [PATCH v3] diff-highlight: make install link into DESTDIR","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2024-10-12T20:55:06Z","receivedAt":"2024-10-12T20:55:14Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Oct 12, 2024 at 08:23:33PM +0000, immeëmosol via GitGitGadget wrote:\n\n> diff --git a/contrib/diff-highlight/Makefile b/contrib/diff-highlight/Makefile\n> index f2be7cc9243..a53e09e0bdd 100644\n> --- a/contrib/diff-highlight/Makefile\n> +++ b/contrib/diff-highlight/Makefile\n> @@ -10,6 +10,9 @@ diff-highlight: shebang.perl DiffHighlight.pm diff-highlight.perl\n>  \tchmod +x $@+\n>  \tmv $@+ $@\n>  \n> +install: diff-highlight\n> +\ttest -w $(DESTDIR) && ln -s $(abspath $<) $(DESTDIR)\n> +\n\nI'm not opposed to having an install target here, like we do in the main\nMakefile and in a few other contrib directories.\n\nBut in that case, I think it should behave more like those other\ntargets:\n\n  1. Actually copy the program rather than making a symlink. Preferably\n     using $(INSTALL).\n\n  2. Respect $(prefix) in the usual way.\n\nAnd also...\n\n>  clean:\n> +\ttest ! -L $(DESTDIR)/diff-highlight || \\\n> +\t\t$(RM) -f $(DESTDIR)/diff-highlight\n>  \t$(RM) diff-highlight\n\n  3. It's unusual for \"clean\" to reach outside of the build directory.\n     What you're doing here is more like an \"uninstall\" target, but we\n     don't usually provide one.\n\nThere are a few different approaches other contrib/ items take to\nwork like the rest of the Git:\n\n  - in contrib/contacts, we source config.mak from the top-level, and\n    then define a default $(prefix). This gives some repeated\n    boilerplate, but is pretty independent from the top-level Makefile.\n\n  - in contrib/credential/netrc, we piggy-back on the top-level\n    Makefile's \"install-perl-script\", which knows where the user has\n    asked us to install things. That might not be appropriate here,\n    though, as I think it only puts things in libexec/, so\n    \"diff-highlight\" wouldn't be generally available in the user's $PATH\n    (though it would be enough to use as a pager within git).\n\n-Peff\n"},{"id":"504940","messageId":"CABOUa4bqPiUM+=6dxW5TTHOdMzXiFD02vWoVJcgAQDhZs8DoXg@mail.gmail.com","threadId":"62324","inReplyTo":"20241012205506.GA55242@coredump.intra.peff.net","subject":"Re: [PATCH v3] diff-highlight: make install link into DESTDIR","fromName":"immeëmosol","fromEmail":"will+developer@willfris.nl","sentAt":"2024-10-12T23:41:06Z","receivedAt":"2024-10-12T23:41:43Z","isPatch":true,"sender":{"key":"will+developer@willfris.nl","avatar":"https://gravatar.com/avatar/96b20c11170f6723e1b074c6540ac6a2dc010d0c7f80823a831357fab9e7208f?d=mp&s=160"},"body":"Resending this mail to the list 'cause mail-client added html to previous mail.\n\nOn Sat, 12 Oct 2024 at 22:55, Jeff King <peff@peff.net> wrote:\n>\n> On Sat, Oct 12, 2024 at 08:23:33PM +0000, immeëmosol via GitGitGadget wrote:\n>\n> > diff --git a/contrib/diff-highlight/Makefile b/contrib/diff-highlight/Makefile\n> > index f2be7cc9243..a53e09e0bdd 100644\n> > --- a/contrib/diff-highlight/Makefile\n> > +++ b/contrib/diff-highlight/Makefile\n> > @@ -10,6 +10,9 @@ diff-highlight: shebang.perl DiffHighlight.pm diff-highlight.perl\n> >       chmod +x $@+\n> >       mv $@+ $@\n> >\n> > +install: diff-highlight\n> > +     test -w $(DESTDIR) && ln -s $(abspath $<) $(DESTDIR)\n> > +\n>\n> I'm not opposed to having an install target here, like we do in the main\n> Makefile and in a few other contrib directories.\n>\n> But in that case, I think it should behave more like those other\n> targets:\n>\n>   1. Actually copy the program rather than making a symlink. Preferably\n>      using $(INSTALL).\n>\n>   2. Respect $(prefix) in the usual way.\n>\n> And also...\n>\n> >  clean:\n> > +     test ! -L $(DESTDIR)/diff-highlight || \\\n> > +             $(RM) -f $(DESTDIR)/diff-highlight\n> >       $(RM) diff-highlight\n>\n>   3. It's unusual for \"clean\" to reach outside of the build directory.\n>      What you're doing here is more like an \"uninstall\" target, but we\n>      don't usually provide one.\n>\n> There are a few different approaches other contrib/ items take to\n> work like the rest of the Git:\n>\n>   - in contrib/contacts, we source config.mak from the top-level, and\n>     then define a default $(prefix). This gives some repeated\n>     boilerplate, but is pretty independent from the top-level Makefile.\n>\n>   - in contrib/credential/netrc, we piggy-back on the top-level\n>     Makefile's \"install-perl-script\", which knows where the user has\n>     asked us to install things. That might not be appropriate here,\n>     though, as I think it only puts things in libexec/, so\n>     \"diff-highlight\" wouldn't be generally available in the user's $PATH\n>     (though it would be enough to use as a pager within git).\n>\n> -Peff\n\nAs mentioned, `contrib/diff-highlight` is less like other perl contribs\nlike `contrib/contacts` and `contrib/credential/netrc`, those two seem to\nbe git subcommands (`git-*`) where diff-highlight is more of a \"standalone\"\ncommand.\n\nMy usecase was to peek at what the command does by making it available in a\n`$PATH` writable by a non-root user. (Much like what is mentioned in\n`contrib/diff-highlight/README#Use`: `git log -p --color | diff-highlight`.=\n)\n\n```sh\necho '# Given ~/.local/bin is in $PATH,'\n( export DESTDIR=3D\"${HOME?}/.local/bin/\" ; make linked-in-destdir )\necho '# In another already open shell, try suggestion from readme.'\n( export DESTDIR=3D\"${HOME?}/.local/bin/\" ; make clean )\n```\n\nThanks to all of you for the introduction into how contributions to git/git\nare handled.\nThough it has been quite an informative introduction, and i can understand\nthe suggestion of making it a install-target like other contrib-parts, i am\ncurrently not spending more time on this. Thanks again, and have a good day=\n.\n\n---\nMake git's diff-highlight program immediately available to the command-line=\n.\nCreate a link in DESTDIR that\nrefers to the generated/concatenated diff-highlight perl script\n\nSigned-off-by: imme=C3=ABmosol <will+developer@willfris.nl>\n---\n contrib/diff-highlight/Makefile | 13 ++++++++++++-\n 1 file changed, 12 insertions(+), 1 deletion(-)\n\ndiff --git a/contrib/diff-highlight/Makefile\nb/contrib/diff-highlight/Makefile\nindex f2be7cc9243719..84f6e65c730380 100644\n--- a/contrib/diff-highlight/Makefile\n+++ b/contrib/diff-highlight/Makefile\n@@ -10,6 +10,11 @@ diff-highlight: shebang.perl DiffHighlight.pm\ndiff-highlight.perl\n     chmod +x $@+\n     mv $@+ $@\n\n+linked-in-destdir: diff-highlight\n+    test -n \"$(DESTDIR)\" && \\\n+        test -w $(DESTDIR) && \\\n+        ln -s $(abspath $<) $(DESTDIR)\n+\n shebang.perl: FORCE\n     @echo '#!$(PERL_PATH_SQ)' >$@+\n     @cmp $@+ $@ >/dev/null 2>/dev/null || mv $@+ $@\n@@ -17,7 +22,13 @@ shebang.perl: FORCE\n test: all\n     $(MAKE) -C t\n\n-clean:\n+unlink-from-destdir:\n+    test -z \"$(DESTDIR)\" || \\\n+        test ! -L $(DESTDIR)/diff-highlight || \\\n+        $(RM) $(DESTDIR)/diff-highlight\n+\n+clean: unlink-from-destdir\n     $(RM) diff-highlight\n\n .PHONY: FORCE\n+.PHONY: linked-in-destdir unlink-from-destdir\n"},{"id":"504965","messageId":"ZwyQE-BMTn3Fj-BO@danh.dev","threadId":"62324","inReplyTo":"CABOUa4bqPiUM+=6dxW5TTHOdMzXiFD02vWoVJcgAQDhZs8DoXg@mail.gmail.com","subject":"Re: [PATCH v3] diff-highlight: make install link into DESTDIR","fromName":"Đoàn Trần Công Danh","fromEmail":"congdanhqx@gmail.com","sentAt":"2024-10-14T03:29:23Z","receivedAt":"2024-10-14T03:29:27Z","isPatch":true,"sender":{"key":"congdanhqx@gmail.com","avatar":"https://avatars.githubusercontent.com/u/42673067?v=4"},"body":"On 2024-10-13 01:41:06+0200, immeëmosol <will+developer@willfris.nl> wrote:\n> As mentioned, `contrib/diff-highlight` is less like other perl contribs\n> like `contrib/contacts` and `contrib/credential/netrc`, those two seem to\n> be git subcommands (`git-*`) where diff-highlight is more of a \"standalone\"\n> command.\n> \n> My usecase was to peek at what the command does by making it available in a\n> `$PATH` writable by a non-root user. (Much like what is mentioned in\n> `contrib/diff-highlight/README#Use`: `git log -p --color | diff-highlight`.=\n> )\n> \n> ```sh\n> echo '# Given ~/.local/bin is in $PATH,'\n> ( export DESTDIR=3D\"${HOME?}/.local/bin/\" ; make linked-in-destdir )\n> echo '# In another already open shell, try suggestion from readme.'\n> ( export DESTDIR=3D\"${HOME?}/.local/bin/\" ; make clean )\n> ```\n\nNah, it isn't DESTDIR's usage, it's prefix job!\n\n\tmake prefix=${HOME}/.local install\n\n> ---\n> Make git's diff-highlight program immediately available to the command-line=\n> .\n> Create a link in DESTDIR that\n> refers to the generated/concatenated diff-highlight perl script\n> \n> Signed-off-by: imme=C3=ABmosol <will+developer@willfris.nl>\n> ---\n>  contrib/diff-highlight/Makefile | 13 ++++++++++++-\n>  1 file changed, 12 insertions(+), 1 deletion(-)\n> \n> diff --git a/contrib/diff-highlight/Makefile\n> b/contrib/diff-highlight/Makefile\n> index f2be7cc9243719..84f6e65c730380 100644\n> --- a/contrib/diff-highlight/Makefile\n> +++ b/contrib/diff-highlight/Makefile\n> @@ -10,6 +10,11 @@ diff-highlight: shebang.perl DiffHighlight.pm\n> diff-highlight.perl\n>      chmod +x $@+\n>      mv $@+ $@\n> \n> +linked-in-destdir: diff-highlight\n> +    test -n \"$(DESTDIR)\" && \\\n> +        test -w $(DESTDIR) && \\\n> +        ln -s $(abspath $<) $(DESTDIR)\n\nSo it would be something like this:\n\n\tinstall: diff-highlight\n\t\t$(INSTALL) diff-highlight '$(DESTDIR)$(bindir_SQ)'\n\n> +\n>  shebang.perl: FORCE\n>      @echo '#!$(PERL_PATH_SQ)' >$@+\n>      @cmp $@+ $@ >/dev/null 2>/dev/null || mv $@+ $@\n> @@ -17,7 +22,13 @@ shebang.perl: FORCE\n>  test: all\n>      $(MAKE) -C t\n> \n> -clean:\n> +unlink-from-destdir:\n> +    test -z \"$(DESTDIR)\" || \\\n> +        test ! -L $(DESTDIR)/diff-highlight || \\\n> +        $(RM) $(DESTDIR)/diff-highlight\n> +\n> +clean: unlink-from-destdir\n>      $(RM) diff-highlight\n> \n>  .PHONY: FORCE\n> +.PHONY: linked-in-destdir unlink-from-destdir\n> \n\n-- \nDanh\n"},{"id":"505084","messageId":"Zw2YXD6XEiQVKj9j@nand.local","threadId":"62324","inReplyTo":"CABOUa4bqPiUM+=6dxW5TTHOdMzXiFD02vWoVJcgAQDhZs8DoXg@mail.gmail.com","subject":"Re: [PATCH v3] diff-highlight: make install link into DESTDIR","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2024-10-14T22:17:00Z","receivedAt":"2024-10-14T22:17:03Z","isPatch":true,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"On Sun, Oct 13, 2024 at 01:41:06AM +0200, immeëmosol wrote:\n> Thanks to all of you for the introduction into how contributions to\n> git/git are handled.\n\n> Though it has been quite an informative introduction, and i can\n> understand the suggestion of making it a install-target like other\n> contrib-parts, i am currently not spending more time on this. Thanks\n> again, and have a good day=\n\nIt is a bit sad to hear that you do not have time to bring this patch\nover the finish line, having received some useful pointers from others\non the list.\n\nAny takers who might want to pick this up instead?\n\nThanks,\nTaylor\n"}]}