threads / patch / 33925

patch, 4 partsremote-helpers: test reorganization

Subject: [PATCH 0/4] remote-helpers: test reorganization

## tl;dr

12 messages between May 25, 2013 and May 29, 2013. Diffs are folded; open one to read it.

replies: 11people: 2as markdown or json

Felipe Contreras· May 25, 2013, 02:38 UTC · lore
Now we use PYTHON_PATH properly, and also we are able to do:
  make -C contrib/remote-helpers install
Felipe Contreras (4):
  remote-helpers: generate scripts
  remote-helpers: rename tests
  remote-helpers: allow direct test execution
  remote-helpers: add exec-path links
 .gitignore                                         |  2 ++
 contrib/remote-helpers/.gitignore                  |  2 ++
 contrib/remote-helpers/Makefile                    | 25 +++++++++++++++++-----
 .../{git-remote-bzr => git-remote-bzr.py}          |  0
 .../{git-remote-hg => git-remote-hg.py}            |  0
 contrib/remote-helpers/{test-bzr.sh => test-bzr.t} |  3 ++-
 .../{test-hg-bidi.sh => test-hg-bidi.t}            |  3 ++-
 .../{test-hg-hg-git.sh => test-hg-hg-git.t}        |  3 ++-
 contrib/remote-helpers/{test-hg.sh => test-hg.t}   |  3 ++-
 9 files changed, 32 insertions(+), 9 deletions(-)
 create mode 100644 contrib/remote-helpers/.gitignore
 rename contrib/remote-helpers/{git-remote-bzr => git-remote-bzr.py} (100%)
 rename contrib/remote-helpers/{git-remote-hg => git-remote-hg.py} (100%)
 rename contrib/remote-helpers/{test-bzr.sh => test-bzr.t} (98%)
 rename contrib/remote-helpers/{test-hg-bidi.sh => test-hg-bidi.t} (98%)
 rename contrib/remote-helpers/{test-hg-hg-git.sh => test-hg-hg-git.t} (99%)
 rename contrib/remote-helpers/{test-hg.sh => test-hg.t} (97%)
-- 
1.8.3.rc3.312.g47657de
Felipe Contreras· May 25, 2013, 02:38 UTC · re: Felipe Contreras · lore

[PATCH 1/4] remote-helpers: generate scripts

The same way other python scripts are generated, so the shebang is replaced by PYTHON_PATH.

Also, cleanup the Makefile.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 contrib/remote-helpers/.gitignore                         |  2 ++
 contrib/remote-helpers/Makefile                           | 15 ++++++++++++---
 .../remote-helpers/{git-remote-bzr => git-remote-bzr.py}  |  0
 .../remote-helpers/{git-remote-hg => git-remote-hg.py}    |  0
 4 files changed, 14 insertions(+), 3 deletions(-)
 create mode 100644 contrib/remote-helpers/.gitignore
 rename contrib/remote-helpers/{git-remote-bzr => git-remote-bzr.py} (100%)
 rename contrib/remote-helpers/{git-remote-hg => git-remote-hg.py} (100%)
Show changes to 4 files +14 −3

contrib/remote-helpers/.gitignore, contrib/remote-helpers/Makefile, contrib/remote-helpers/git-remote-bzr, contrib/remote-helpers/git-remote-hg

diff --git a/contrib/remote-helpers/.gitignore b/contrib/remote-helpers/.gitignore
new file mode 100644
index 0000000..9bf692b
--- /dev/null
+++ b/contrib/remote-helpers/.gitignore
@@ -0,0 +1,2 @@
+git-remote-bzr
+git-remote-hg
diff --git a/contrib/remote-helpers/Makefile b/contrib/remote-helpers/Makefile
index 239161d..d9b3515 100644
--- a/contrib/remote-helpers/Makefile
+++ b/contrib/remote-helpers/Makefile
@@ -1,14 +1,23 @@
 TESTS := $(wildcard test*.sh)
+SCRIPTS := $(wildcard git-remote-*.py)
 
 export T := $(addprefix $(CURDIR)/,$(TESTS))
 export MAKE := $(MAKE) -e
 export PATH := $(CURDIR):$(PATH)
 export TEST_LINT := test-lint-executable test-lint-shell-syntax
 
-test:
+export SCRIPT_PYTHON := $(addprefix $(CURDIR)/,$(SCRIPTS))
+
+all: $(SCRIPTS)
+	$(MAKE) -C ../.. build-python-script
+
+install:
+	$(MAKE) -C ../.. install-python-script
+
+test: all
 	$(MAKE) -C ../../t $@
 
-$(TESTS):
+$(TESTS): all
 	$(MAKE) -C ../../t $(CURDIR)/$@
 
-.PHONY: $(TESTS)
+.PHONY: all install test $(TESTS)
diff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr.py
similarity index 100%
rename from contrib/remote-helpers/git-remote-bzr
rename to contrib/remote-helpers/git-remote-bzr.py
diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg.py
similarity index 100%
rename from contrib/remote-helpers/git-remote-hg
rename to contrib/remote-helpers/git-remote-hg.py
-- 
1.8.3.rc3.312.g47657de
Felipe Contreras· May 25, 2013, 02:38 UTC · re: Felipe Contreras · lore

[PATCH 2/4] remote-helpers: rename tests

The .t extension is more standard for sharness tests.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 contrib/remote-helpers/Makefile                                | 2 +-
 contrib/remote-helpers/{test-bzr.sh => test-bzr.t}             | 0
 contrib/remote-helpers/{test-hg-bidi.sh => test-hg-bidi.t}     | 0
 contrib/remote-helpers/{test-hg-hg-git.sh => test-hg-hg-git.t} | 0
 contrib/remote-helpers/{test-hg.sh => test-hg.t}               | 0
 5 files changed, 1 insertion(+), 1 deletion(-)
 rename contrib/remote-helpers/{test-bzr.sh => test-bzr.t} (100%)
 rename contrib/remote-helpers/{test-hg-bidi.sh => test-hg-bidi.t} (100%)
 rename contrib/remote-helpers/{test-hg-hg-git.sh => test-hg-hg-git.t} (100%)
 rename contrib/remote-helpers/{test-hg.sh => test-hg.t} (100%)
Show changes to 5 files +1 −1

contrib/remote-helpers/Makefile, contrib/remote-helpers/test-bzr.sh, contrib/remote-helpers/test-hg-bidi.sh, contrib/remote-helpers/test-hg-hg-git.sh, contrib/remote-helpers/test-hg.sh

diff --git a/contrib/remote-helpers/Makefile b/contrib/remote-helpers/Makefile
index d9b3515..2c91ec6 100644
--- a/contrib/remote-helpers/Makefile
+++ b/contrib/remote-helpers/Makefile
@@ -1,4 +1,4 @@
-TESTS := $(wildcard test*.sh)
+TESTS := $(wildcard test-*.t)
 SCRIPTS := $(wildcard git-remote-*.py)
 
 export T := $(addprefix $(CURDIR)/,$(TESTS))
diff --git a/contrib/remote-helpers/test-bzr.sh b/contrib/remote-helpers/test-bzr.t
similarity index 100%
rename from contrib/remote-helpers/test-bzr.sh
rename to contrib/remote-helpers/test-bzr.t
diff --git a/contrib/remote-helpers/test-hg-bidi.sh b/contrib/remote-helpers/test-hg-bidi.t
similarity index 100%
rename from contrib/remote-helpers/test-hg-bidi.sh
rename to contrib/remote-helpers/test-hg-bidi.t
diff --git a/contrib/remote-helpers/test-hg-hg-git.sh b/contrib/remote-helpers/test-hg-hg-git.t
similarity index 100%
rename from contrib/remote-helpers/test-hg-hg-git.sh
rename to contrib/remote-helpers/test-hg-hg-git.t
diff --git a/contrib/remote-helpers/test-hg.sh b/contrib/remote-helpers/test-hg.t
similarity index 100%
rename from contrib/remote-helpers/test-hg.sh
rename to contrib/remote-helpers/test-hg.t
-- 
1.8.3.rc3.312.g47657de
Junio C Hamano· May 28, 2013, 20:05 UTC · re: Felipe Contreras · lore

Re: [PATCH 2/4] remote-helpers: rename tests

Felipe Contreras <felipe.contreras@gmail.com> writes:
> The .t extension is more standard for sharness tests.
>
> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
> ---

Is that "sharness" test the sh script testsuite forked from our testsuite?

I do not see how it makes sense to copy how they deviate from us back to our codebase, especially if we plan to eventually move some of these tests out of contrib/ area, but even without such a plan in the future.

Show 37 quoted lines
>  contrib/remote-helpers/Makefile                                | 2 +-
>  contrib/remote-helpers/{test-bzr.sh => test-bzr.t}             | 0
>  contrib/remote-helpers/{test-hg-bidi.sh => test-hg-bidi.t}     | 0
>  contrib/remote-helpers/{test-hg-hg-git.sh => test-hg-hg-git.t} | 0
>  contrib/remote-helpers/{test-hg.sh => test-hg.t}               | 0
>  5 files changed, 1 insertion(+), 1 deletion(-)
>  rename contrib/remote-helpers/{test-bzr.sh => test-bzr.t} (100%)
>  rename contrib/remote-helpers/{test-hg-bidi.sh => test-hg-bidi.t} (100%)
>  rename contrib/remote-helpers/{test-hg-hg-git.sh => test-hg-hg-git.t} (100%)
>  rename contrib/remote-helpers/{test-hg.sh => test-hg.t} (100%)
>
> diff --git a/contrib/remote-helpers/Makefile b/contrib/remote-helpers/Makefile
> index d9b3515..2c91ec6 100644
> --- a/contrib/remote-helpers/Makefile
> +++ b/contrib/remote-helpers/Makefile
> @@ -1,4 +1,4 @@
> -TESTS := $(wildcard test*.sh)
> +TESTS := $(wildcard test-*.t)
>  SCRIPTS := $(wildcard git-remote-*.py)
>  
>  export T := $(addprefix $(CURDIR)/,$(TESTS))
> diff --git a/contrib/remote-helpers/test-bzr.sh b/contrib/remote-helpers/test-bzr.t
> similarity index 100%
> rename from contrib/remote-helpers/test-bzr.sh
> rename to contrib/remote-helpers/test-bzr.t
> diff --git a/contrib/remote-helpers/test-hg-bidi.sh b/contrib/remote-helpers/test-hg-bidi.t
> similarity index 100%
> rename from contrib/remote-helpers/test-hg-bidi.sh
> rename to contrib/remote-helpers/test-hg-bidi.t
> diff --git a/contrib/remote-helpers/test-hg-hg-git.sh b/contrib/remote-helpers/test-hg-hg-git.t
> similarity index 100%
> rename from contrib/remote-helpers/test-hg-hg-git.sh
> rename to contrib/remote-helpers/test-hg-hg-git.t
> diff --git a/contrib/remote-helpers/test-hg.sh b/contrib/remote-helpers/test-hg.t
> similarity index 100%
> rename from contrib/remote-helpers/test-hg.sh
> rename to contrib/remote-helpers/test-hg.t
Felipe Contreras· May 29, 2013, 02:50 UTC · re: Junio C Hamano · lore

Re: [PATCH 2/4] remote-helpers: rename tests

Junio C Hamano wrote:
Show 14 quoted lines
> Felipe Contreras <felipe.contreras@gmail.com> writes:
> 
> > The .t extension is more standard for sharness tests.
> >
> > Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
> > ---
> 
> Is that "sharness" test the sh script testsuite forked from our
> testsuite?
> 
> I do not see how it makes sense to copy how they deviate from us
> back to our codebase, especially if we plan to eventually move some
> of these tests out of contrib/ area, but even without such a plan in
> the future.

They deviate from us, we deviate from them, whatever. We are a single project, what more than one project does is more standard.

% man prove
--ext             Set the extension for tests (default '.t')
-- 
Felipe Contreras
Junio C Hamano· May 29, 2013, 17:14 UTC · re: Felipe Contreras · lore

Re: [PATCH 2/4] remote-helpers: rename tests

Felipe Contreras <felipe.contreras@gmail.com> writes:
Show 7 quoted lines
>> I do not see how it makes sense to copy how they deviate from us
>> back to our codebase, especially if we plan to eventually move some
>> of these tests out of contrib/ area, but even without such a plan in
>> the future.
>
> They deviate from us, we deviate from them, whatever. We are a single project,
> what more than one project does is more standard.

We are a single project, so it is better to consistently follow the local convention established here.

If your proposal were to
 - Convert t/*.sh to end with .t intead, to change the project
   convention, and
 - Make contrib/ things also conform to that new convention.

it may make some sense to discuss the pros and cons of such a move, but changing only contrib/ has no effect other than making it even less consistent with the rest of the project.

Felipe Contreras· May 29, 2013, 17:56 UTC · re: Junio C Hamano · lore

Re: [PATCH 2/4] remote-helpers: rename tests

On Wed, May 29, 2013 at 12:14 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 23 quoted lines
> Felipe Contreras <felipe.contreras@gmail.com> writes:
>
>>> I do not see how it makes sense to copy how they deviate from us
>>> back to our codebase, especially if we plan to eventually move some
>>> of these tests out of contrib/ area, but even without such a plan in
>>> the future.
>>
>> They deviate from us, we deviate from them, whatever. We are a single project,
>> what more than one project does is more standard.
>
> We are a single project, so it is better to consistently follow the
> local convention established here.
>
> If your proposal were to
>
>  - Convert t/*.sh to end with .t intead, to change the project
>    convention, and
>
>  - Make contrib/ things also conform to that new convention.
>
> it may make some sense to discuss the pros and cons of such a move,
> but changing only contrib/ has no effect other than making it even
> less consistent with the rest of the project.

It's already inconsistent with the rest of the project, as they are not named tNNNN-foo.sh.

If you want I can give it a try at renaming all the tests in the whole project to *.t, but I don't think you are truly interested in finding a better extension for our tests.

-- 
Felipe Contreras
Junio C Hamano· May 29, 2013, 18:44 UTC · re: Felipe Contreras · lore

Re: [PATCH 2/4] remote-helpers: rename tests

Felipe Contreras <felipe.contreras@gmail.com> writes:
Show 27 quoted lines
> On Wed, May 29, 2013 at 12:14 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> Felipe Contreras <felipe.contreras@gmail.com> writes:
>>
>>>> I do not see how it makes sense to copy how they deviate from us
>>>> back to our codebase, especially if we plan to eventually move some
>>>> of these tests out of contrib/ area, but even without such a plan in
>>>> the future.
>>>
>>> They deviate from us, we deviate from them, whatever. We are a single project,
>>> what more than one project does is more standard.
>>
>> We are a single project, so it is better to consistently follow the
>> local convention established here.
>>
>> If your proposal were to
>>
>>  - Convert t/*.sh to end with .t intead, to change the project
>>    convention, and
>>
>>  - Make contrib/ things also conform to that new convention.
>>
>> it may make some sense to discuss the pros and cons of such a move,
>> but changing only contrib/ has no effect other than making it even
>> less consistent with the rest of the project.
>
> It's already inconsistent with the rest of the project, as they are
> not named tNNNN-foo.sh.
Correct; that is why I said "even less consistent".
> If you want I can give it a try at renaming all the tests in the whole
> project to *.t, but I don't think you are truly interested in finding
> a better extension for our tests.

Again, correct. I do not think it is worth the trouble to renaming them to *.t at this moment.

Having said that, I suspect that in the very longer term it might turn out to be a good thing to do (if we want to make our test suite runnable under other people's tools that expect .t suffix, for example). But I do not think that is the topic of this patch under discussion.

Felipe Contreras· May 29, 2013, 19:32 UTC · re: Junio C Hamano · lore

Re: [PATCH 2/4] remote-helpers: rename tests

On Wed, May 29, 2013 at 1:44 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 44 quoted lines
> Felipe Contreras <felipe.contreras@gmail.com> writes:
>
>> On Wed, May 29, 2013 at 12:14 PM, Junio C Hamano <gitster@pobox.com> wrote:
>>> Felipe Contreras <felipe.contreras@gmail.com> writes:
>>>
>>>>> I do not see how it makes sense to copy how they deviate from us
>>>>> back to our codebase, especially if we plan to eventually move some
>>>>> of these tests out of contrib/ area, but even without such a plan in
>>>>> the future.
>>>>
>>>> They deviate from us, we deviate from them, whatever. We are a single project,
>>>> what more than one project does is more standard.
>>>
>>> We are a single project, so it is better to consistently follow the
>>> local convention established here.
>>>
>>> If your proposal were to
>>>
>>>  - Convert t/*.sh to end with .t intead, to change the project
>>>    convention, and
>>>
>>>  - Make contrib/ things also conform to that new convention.
>>>
>>> it may make some sense to discuss the pros and cons of such a move,
>>> but changing only contrib/ has no effect other than making it even
>>> less consistent with the rest of the project.
>>
>> It's already inconsistent with the rest of the project, as they are
>> not named tNNNN-foo.sh.
>
> Correct; that is why I said "even less consistent".
>
>> If you want I can give it a try at renaming all the tests in the whole
>> project to *.t, but I don't think you are truly interested in finding
>> a better extension for our tests.
>
> Again, correct.  I do not think it is worth the trouble to renaming
> them to *.t at this moment.
>
> Having said that, I suspect that in the very longer term it might
> turn out to be a good thing to do (if we want to make our test suite
> runnable under other people's tools that expect .t suffix, for
> example).  But I do not think that is the topic of this patch under
> discussion.

That's right. I just think if we didn't have the burden of so many existing tests, and had the chance to pick the test extension from scratch, it should be .t.

-- 
Felipe Contreras
Felipe Contreras· May 25, 2013, 02:38 UTC · re: Felipe Contreras · lore

[PATCH 3/4] remote-helpers: allow direct test execution

Previously 'make' was the only option, or manually specifying the 'TEST_DIRECTORY'.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 contrib/remote-helpers/Makefile         | 1 +
 contrib/remote-helpers/test-bzr.t       | 3 ++-
 contrib/remote-helpers/test-hg-bidi.t   | 3 ++-
 contrib/remote-helpers/test-hg-hg-git.t | 3 ++-
 contrib/remote-helpers/test-hg.t        | 3 ++-
 5 files changed, 9 insertions(+), 4 deletions(-)
Show changes to 5 files +9 −4

contrib/remote-helpers/Makefile, contrib/remote-helpers/test-bzr.t, contrib/remote-helpers/test-hg-bidi.t, contrib/remote-helpers/test-hg-hg-git.t, contrib/remote-helpers/test-hg.t

diff --git a/contrib/remote-helpers/Makefile b/contrib/remote-helpers/Makefile
index 2c91ec6..55abf0b 100644
--- a/contrib/remote-helpers/Makefile
+++ b/contrib/remote-helpers/Makefile
@@ -5,6 +5,7 @@ export T := $(addprefix $(CURDIR)/,$(TESTS))
 export MAKE := $(MAKE) -e
 export PATH := $(CURDIR):$(PATH)
 export TEST_LINT := test-lint-executable test-lint-shell-syntax
+export TEST_DIRECTORY := $(CURDIR)/../../t
 
 export SCRIPT_PYTHON := $(addprefix $(CURDIR)/,$(SCRIPTS))
 
diff --git a/contrib/remote-helpers/test-bzr.t b/contrib/remote-helpers/test-bzr.t
index 5dfa070..0f24c48 100755
--- a/contrib/remote-helpers/test-bzr.t
+++ b/contrib/remote-helpers/test-bzr.t
@@ -5,7 +5,8 @@
 
 test_description='Test remote-bzr'
 
-. ./test-lib.sh
+test -z "$TEST_DIRECTORY" && TEST_DIRECTORY="$PWD/../../t"
+. "$TEST_DIRECTORY"/test-lib.sh
 
 if ! test_have_prereq PYTHON; then
 	skip_all='skipping remote-bzr tests; python not available'
diff --git a/contrib/remote-helpers/test-hg-bidi.t b/contrib/remote-helpers/test-hg-bidi.t
index f569697..8707eb9 100755
--- a/contrib/remote-helpers/test-hg-bidi.t
+++ b/contrib/remote-helpers/test-hg-bidi.t
@@ -8,7 +8,8 @@
 
 test_description='Test bidirectionality of remote-hg'
 
-. ./test-lib.sh
+test -z "$TEST_DIRECTORY" && TEST_DIRECTORY="$PWD/../../t"
+. "$TEST_DIRECTORY"/test-lib.sh
 
 if ! test_have_prereq PYTHON; then
 	skip_all='skipping remote-hg tests; python not available'
diff --git a/contrib/remote-helpers/test-hg-hg-git.t b/contrib/remote-helpers/test-hg-hg-git.t
index 7f579c8..ac1de96 100755
--- a/contrib/remote-helpers/test-hg-hg-git.t
+++ b/contrib/remote-helpers/test-hg-hg-git.t
@@ -8,7 +8,8 @@
 
 test_description='Test remote-hg output compared to hg-git'
 
-. ./test-lib.sh
+test -z "$TEST_DIRECTORY" && TEST_DIRECTORY="$PWD/../../t"
+. "$TEST_DIRECTORY"/test-lib.sh
 
 if ! test_have_prereq PYTHON; then
 	skip_all='skipping remote-hg tests; python not available'
diff --git a/contrib/remote-helpers/test-hg.t b/contrib/remote-helpers/test-hg.t
index 8de2aa7..a362867 100755
--- a/contrib/remote-helpers/test-hg.t
+++ b/contrib/remote-helpers/test-hg.t
@@ -8,7 +8,8 @@
 
 test_description='Test remote-hg'
 
-. ./test-lib.sh
+test -z "$TEST_DIRECTORY" && TEST_DIRECTORY="$PWD/../../t"
+. "$TEST_DIRECTORY"/test-lib.sh
 
 if ! test_have_prereq PYTHON; then
 	skip_all='skipping remote-hg tests; python not available'
-- 
1.8.3.rc3.312.g47657de
Felipe Contreras· May 25, 2013, 02:38 UTC · re: Felipe Contreras · lore

[PATCH 4/4] remote-helpers: add exec-path links

This way we don't have to modify the PATH ourselves and it's easier to test without 'make'.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 .gitignore                      |  2 ++
 contrib/remote-helpers/Makefile | 13 +++++++++----
 2 files changed, 11 insertions(+), 4 deletions(-)
Show changes to 2 files +11 −4

.gitignore, contrib/remote-helpers/Makefile

diff --git a/.gitignore b/.gitignore
index 10aee94..a79b412 100644
--- a/.gitignore
+++ b/.gitignore
@@ -119,11 +119,13 @@
 /git-reflog
 /git-relink
 /git-remote
+/git-remote-bzr
 /git-remote-http
 /git-remote-https
 /git-remote-ftp
 /git-remote-ftps
 /git-remote-fd
+/git-remote-hg
 /git-remote-ext
 /git-remote-testgit
 /git-remote-testpy
diff --git a/contrib/remote-helpers/Makefile b/contrib/remote-helpers/Makefile
index 55abf0b..98150b4 100644
--- a/contrib/remote-helpers/Makefile
+++ b/contrib/remote-helpers/Makefile
@@ -1,9 +1,9 @@
 TESTS := $(wildcard test-*.t)
 SCRIPTS := $(wildcard git-remote-*.py)
+LINKS := $(addprefix ../../,$(patsubst %.py,%,$(SCRIPTS)))
 
 export T := $(addprefix $(CURDIR)/,$(TESTS))
 export MAKE := $(MAKE) -e
-export PATH := $(CURDIR):$(PATH)
 export TEST_LINT := test-lint-executable test-lint-shell-syntax
 export TEST_DIRECTORY := $(CURDIR)/../../t
 
@@ -15,10 +15,15 @@ all: $(SCRIPTS)
 install:
 	$(MAKE) -C ../.. install-python-script
 
-test: all
+links: all $(LINKS)
+
+test: links
 	$(MAKE) -C ../../t $@
 
-$(TESTS): all
+$(LINKS):
+	ln -sf contrib/remote-helpers/$(notdir $@) ../..
+
+$(TESTS): links
 	$(MAKE) -C ../../t $(CURDIR)/$@
 
-.PHONY: all install test $(TESTS)
+.PHONY: all install test links $(TESTS)
-- 
1.8.3.rc3.312.g47657de
Junio C Hamano· May 28, 2013, 20:06 UTC · re: Felipe Contreras · lore

Re: [PATCH 4/4] remote-helpers: add exec-path links

Felipe Contreras <felipe.contreras@gmail.com> writes:
Show 8 quoted lines
> This way we don't have to modify the PATH ourselves and it's easier to
> test without 'make'.
>
> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
> ---
>  .gitignore                      |  2 ++
>  contrib/remote-helpers/Makefile | 13 +++++++++----
>  2 files changed, 11 insertions(+), 4 deletions(-)

If we teach the top-level .gitignore that some contrib/ stuff might contaminate the top-level directory (which is a good idea), we should also teach the top-level Makefile how to get rid of the built cruft upon "make clean", no?

Show 52 quoted lines
> diff --git a/.gitignore b/.gitignore
> index 10aee94..a79b412 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -119,11 +119,13 @@
>  /git-reflog
>  /git-relink
>  /git-remote
> +/git-remote-bzr
>  /git-remote-http
>  /git-remote-https
>  /git-remote-ftp
>  /git-remote-ftps
>  /git-remote-fd
> +/git-remote-hg
>  /git-remote-ext
>  /git-remote-testgit
>  /git-remote-testpy
> diff --git a/contrib/remote-helpers/Makefile b/contrib/remote-helpers/Makefile
> index 55abf0b..98150b4 100644
> --- a/contrib/remote-helpers/Makefile
> +++ b/contrib/remote-helpers/Makefile
> @@ -1,9 +1,9 @@
>  TESTS := $(wildcard test-*.t)
>  SCRIPTS := $(wildcard git-remote-*.py)
> +LINKS := $(addprefix ../../,$(patsubst %.py,%,$(SCRIPTS)))
>  
>  export T := $(addprefix $(CURDIR)/,$(TESTS))
>  export MAKE := $(MAKE) -e
> -export PATH := $(CURDIR):$(PATH)
>  export TEST_LINT := test-lint-executable test-lint-shell-syntax
>  export TEST_DIRECTORY := $(CURDIR)/../../t
>  
> @@ -15,10 +15,15 @@ all: $(SCRIPTS)
>  install:
>  	$(MAKE) -C ../.. install-python-script
>  
> -test: all
> +links: all $(LINKS)
> +
> +test: links
>  	$(MAKE) -C ../../t $@
>  
> -$(TESTS): all
> +$(LINKS):
> +	ln -sf contrib/remote-helpers/$(notdir $@) ../..
> +
> +$(TESTS): links
>  	$(MAKE) -C ../../t $(CURDIR)/$@
>  
> -.PHONY: all install test $(TESTS)
> +.PHONY: all install test links $(TESTS)

← back to recent threads