# [PATCH 1/1] contrib/subtree: Make testing easier

2 messages from 2016-01-17 to 2016-01-20. Participants: David Greene, Junio C Hamano.
Thread: https://gitlist.dev/t/41209

## David Greene, 2016-01-17 23:47

Subject: [PATCH 1/1] contrib/subtree: Make testing easier
Message-ID: <44704afe6f728263b5200da2b343783a5a209eca.1453074427.git.greened@obbligato.org>
URL: https://gitlist.dev/e/44704afe6f728263b5200da2b343783a5a209eca.1453074427.git.greened%40obbligato.org

```
From: David A. Greene <greened@obbligato.org>

Add some Makefile dependencies to ensure an updated git-subtree
gets copied to the main area before testing begins.

Signed-off-by: David A. Greene <greened@obbligato.org>
---

Notes:
    v1 - Initial patch

 contrib/subtree/Makefile | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/contrib/subtree/Makefile b/contrib/subtree/Makefile
index 3071baf..6afa9aa 100644
--- a/contrib/subtree/Makefile
+++ b/contrib/subtree/Makefile
@@ -37,6 +37,7 @@ GIT_SUBTREE_DOC := git-subtree.1
 GIT_SUBTREE_XML := git-subtree.xml
 GIT_SUBTREE_TXT := git-subtree.txt
 GIT_SUBTREE_HTML := git-subtree.html
+GIT_SUBTREE_TEST := ../../git-subtree
 
 all:: $(GIT_SUBTREE)
 
@@ -71,7 +72,10 @@ $(GIT_SUBTREE_HTML): $(GIT_SUBTREE_TXT)
 	$(ASCIIDOC) -b xhtml11 -d manpage -f $(ASCIIDOC_CONF) \
 		-agit_version=$(GIT_VERSION) $^
 
-test:
+$(GIT_SUBTREE_TEST): $(GIT_SUBTREE)
+	cp $< $@
+
+test: $(GIT_SUBTREE_TEST)
 	$(MAKE) -C t/ test
 
 clean:
-- 
2.6.1

```

## Junio C Hamano, 2016-01-20 19:28

Subject: Re: [PATCH 1/1] contrib/subtree: Make testing easier
Message-ID: <xmqqvb6o59um.fsf@gitster.mtv.corp.google.com>
URL: https://gitlist.dev/e/xmqqvb6o59um.fsf%40gitster.mtv.corp.google.com
In-Reply-To: <44704afe6f728263b5200da2b343783a5a209eca.1453074427.git.greened@obbligato.org>

```
David Greene <greened@obbligato.org> writes:

> From: David A. Greene <greened@obbligato.org>
>
> Add some Makefile dependencies to ensure an updated git-subtree
> gets copied to the main area before testing begins.
>
> Signed-off-by: David A. Greene <greened@obbligato.org>
> ---
>
> Notes:
>     v1 - Initial patch

This looks OK to me, but does this change make what's written in
contrib/subtree/INSTALL somewhat stale?

>
>  contrib/subtree/Makefile | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/contrib/subtree/Makefile b/contrib/subtree/Makefile
> index 3071baf..6afa9aa 100644
> --- a/contrib/subtree/Makefile
> +++ b/contrib/subtree/Makefile
> @@ -37,6 +37,7 @@ GIT_SUBTREE_DOC := git-subtree.1
>  GIT_SUBTREE_XML := git-subtree.xml
>  GIT_SUBTREE_TXT := git-subtree.txt
>  GIT_SUBTREE_HTML := git-subtree.html
> +GIT_SUBTREE_TEST := ../../git-subtree
>  
>  all:: $(GIT_SUBTREE)
>  
> @@ -71,7 +72,10 @@ $(GIT_SUBTREE_HTML): $(GIT_SUBTREE_TXT)
>  	$(ASCIIDOC) -b xhtml11 -d manpage -f $(ASCIIDOC_CONF) \
>  		-agit_version=$(GIT_VERSION) $^
>  
> -test:
> +$(GIT_SUBTREE_TEST): $(GIT_SUBTREE)
> +	cp $< $@
> +
> +test: $(GIT_SUBTREE_TEST)
>  	$(MAKE) -C t/ test
>  
>  clean:

```
