@matheusbsbs / matheus-bagliano / commits / 1c78c78d25
Fork 0

contrib/credential/netrc: make PERL_PATH configurable

The shebang path for the Perl interpreter in git-credential-netrc was hardcoded. However, some users may have it located at a different location and thus, would have had to manually edit the script. Add a .perl prefix to the script to denote it as a template and ignore the generated version. Augment the Makefile so that it generates git-credential-netrc from git-credential-netrc.perl, just like other Perl scripts. The Makefile recipes were shamelessly stolen from contrib/mw-to-git/Makefile. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Denton Liu committed Dec 20, 2019 at 10:45 UTC 1c78c78d2513eaf22105c87484c65b4eecdf0bfc
3 files changed +25 -2
contrib/credential/netrc/.gitignore new
+1
@@ -0,0 +1 @@
1 +git-credential-netrc
contrib/credential/netrc/Makefile
+24 -2
@@ -1,8 +1,30 @@
1 # The default target of this Makefile is...
2 all::
3
4 -test:
4 +SCRIPT_PERL = git-credential-netrc.perl
5 +GIT_ROOT_DIR = ../../..
6 +HERE = contrib/credential/netrc
7 +
8 +SCRIPT_PERL_FULL = $(patsubst %,$(HERE)/%,$(SCRIPT_PERL))
9 +
10 +all:: build
11 +
12 +build:
13 + $(MAKE) -C $(GIT_ROOT_DIR) SCRIPT_PERL="$(SCRIPT_PERL_FULL)" \
14 + build-perl-script
15 +
16 +install: build
17 + $(MAKE) -C $(GIT_ROOT_DIR) SCRIPT_PERL="$(SCRIPT_PERL_FULL)" \
18 + install-perl-script
19 +
20 +clean:
21 + $(MAKE) -C $(GIT_ROOT_DIR) SCRIPT_PERL="$(SCRIPT_PERL_FULL)" \
22 + clean-perl-script
23 +
24 +test: build
25 ./t-git-credential-netrc.sh
26
7 -testverbose:
27 +testverbose: build
28 ./t-git-credential-netrc.sh -d -v
29 +
30 +.PHONY: all build install clean test testverbose
contrib/credential/netrc/git-credential-netrc.perl renamed