# [PATCH 1/1] subtree: add build targets 'man' and 'html'

12 messages from 2018-10-07 to 2018-10-18. Participants: Christian Hesse, Junio C Hamano, Johannes Schindelin, Jonathan Nieder.
Thread: https://gitlist.dev/t/49502

## Christian Hesse, 2018-10-07 07:30

Subject: [PATCH 1/1] subtree: add build targets 'man' and 'html'
Message-ID: <20181007073036.30643-1-list@eworm.de>
URL: https://gitlist.dev/e/20181007073036.30643-1-list%40eworm.de

```
From: Christian Hesse <mail@eworm.de>

We have targets 'install-man' and 'install-html', let's add build
targets as well.

Signed-off-by: Christian Hesse <mail@eworm.de>
---
 contrib/subtree/Makefile | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/contrib/subtree/Makefile b/contrib/subtree/Makefile
index 5c6cc4ab2c..6906aae441 100644
--- a/contrib/subtree/Makefile
+++ b/contrib/subtree/Makefile
@@ -59,6 +59,10 @@ $(GIT_SUBTREE): $(GIT_SUBTREE_SH)
 
 doc: $(GIT_SUBTREE_DOC) $(GIT_SUBTREE_HTML)
 
+man: $(GIT_SUBTREE_DOC)
+
+html: $(GIT_SUBTREE_HTML)
+
 install: $(GIT_SUBTREE)
 	$(INSTALL) -d -m 755 $(DESTDIR)$(gitexecdir)
 	$(INSTALL) -m 755 $(GIT_SUBTREE) $(DESTDIR)$(gitexecdir)

```

## Junio C Hamano, 2018-10-10 02:26

Subject: Re: [PATCH 1/1] subtree: add build targets 'man' and 'html'
Message-ID: <xmqqmurmmt9j.fsf@gitster-ct.c.googlers.com>
URL: https://gitlist.dev/e/xmqqmurmmt9j.fsf%40gitster-ct.c.googlers.com
In-Reply-To: <20181007073036.30643-1-list@eworm.de>

```
Christian Hesse <list@eworm.de> writes:

> From: Christian Hesse <mail@eworm.de>
>
> We have targets 'install-man' and 'install-html', let's add build
> targets as well.
>   ...
> +man: $(GIT_SUBTREE_DOC)
> +
> +html: $(GIT_SUBTREE_HTML)
> +

As 'contrib' material without real maintenance, I do not care too
deeply, but shouldn't this change be more like this to avoid
duplicating the list of targets?


diff --git a/contrib/subtree/Makefile b/contrib/subtree/Makefile
index 5c6cc4ab2c..4a10a020a0 100644
--- a/contrib/subtree/Makefile
+++ b/contrib/subtree/Makefile
@@ -59,17 +59,21 @@ $(GIT_SUBTREE): $(GIT_SUBTREE_SH)
 
 doc: $(GIT_SUBTREE_DOC) $(GIT_SUBTREE_HTML)
 
+man: $(GIT_SUBTREE_DOC)
+
+html: $(GIT_SUBTREE_HTML)
+
 install: $(GIT_SUBTREE)
 	$(INSTALL) -d -m 755 $(DESTDIR)$(gitexecdir)
 	$(INSTALL) -m 755 $(GIT_SUBTREE) $(DESTDIR)$(gitexecdir)
 
 install-doc: install-man install-html
 
-install-man: $(GIT_SUBTREE_DOC)
+install-man: man
 	$(INSTALL) -d -m 755 $(DESTDIR)$(man1dir)
 	$(INSTALL) -m 644 $^ $(DESTDIR)$(man1dir)
 
-install-html: $(GIT_SUBTREE_HTML)
+install-html: html
 	$(INSTALL) -d -m 755 $(DESTDIR)$(htmldir)
 	$(INSTALL) -m 644 $^ $(DESTDIR)$(htmldir)
 
@@ -94,4 +98,4 @@ clean:
 	$(RM) $(GIT_SUBTREE)
 	$(RM) *.xml *.html *.1
 
-.PHONY: FORCE
+.PHONY: FORCE man html install-man install-html


```

## Johannes Schindelin, 2018-10-12 08:08

Subject: Re: [PATCH 1/1] subtree: add build targets 'man' and 'html'
Message-ID: <nycvar.QRO.7.76.6.1810121006180.45@tvgsbejvaqbjf.bet>
URL: https://gitlist.dev/e/nycvar.QRO.7.76.6.1810121006180.45%40tvgsbejvaqbjf.bet
In-Reply-To: <xmqqmurmmt9j.fsf@gitster-ct.c.googlers.com>

```


On Wed, 10 Oct 2018, Junio C Hamano wrote:

> Christian Hesse <list@eworm.de> writes:
> 
> > From: Christian Hesse <mail@eworm.de>
> >
> > We have targets 'install-man' and 'install-html', let's add build
> > targets as well.
> >   ...
> > +man: $(GIT_SUBTREE_DOC)
> > +
> > +html: $(GIT_SUBTREE_HTML)
> > +
> 
> As 'contrib' material without real maintenance, I do not care too
> deeply, but shouldn't this change be more like this to avoid
> duplicating the list of targets?

Ævar mentioned that he'd like this to graduate from contrib into core, and
I had briefly looked at making subtree a built-in to that end. IOW please
do not get too used to subtree being in contrib.

Ciao,
Dscho

> 
> 
> diff --git a/contrib/subtree/Makefile b/contrib/subtree/Makefile
> index 5c6cc4ab2c..4a10a020a0 100644
> --- a/contrib/subtree/Makefile
> +++ b/contrib/subtree/Makefile
> @@ -59,17 +59,21 @@ $(GIT_SUBTREE): $(GIT_SUBTREE_SH)
>  
>  doc: $(GIT_SUBTREE_DOC) $(GIT_SUBTREE_HTML)
>  
> +man: $(GIT_SUBTREE_DOC)
> +
> +html: $(GIT_SUBTREE_HTML)
> +
>  install: $(GIT_SUBTREE)
>  	$(INSTALL) -d -m 755 $(DESTDIR)$(gitexecdir)
>  	$(INSTALL) -m 755 $(GIT_SUBTREE) $(DESTDIR)$(gitexecdir)
>  
>  install-doc: install-man install-html
>  
> -install-man: $(GIT_SUBTREE_DOC)
> +install-man: man
>  	$(INSTALL) -d -m 755 $(DESTDIR)$(man1dir)
>  	$(INSTALL) -m 644 $^ $(DESTDIR)$(man1dir)
>  
> -install-html: $(GIT_SUBTREE_HTML)
> +install-html: html
>  	$(INSTALL) -d -m 755 $(DESTDIR)$(htmldir)
>  	$(INSTALL) -m 644 $^ $(DESTDIR)$(htmldir)
>  
> @@ -94,4 +98,4 @@ clean:
>  	$(RM) $(GIT_SUBTREE)
>  	$(RM) *.xml *.html *.1
>  
> -.PHONY: FORCE
> +.PHONY: FORCE man html install-man install-html
> 
> 
```

## Christian Hesse, 2018-10-15 21:15

Subject: Re: [PATCH 1/1] subtree: add build targets 'man' and 'html'
Message-ID: <20181015231501.5a7524b0@leda>
URL: https://gitlist.dev/e/20181015231501.5a7524b0%40leda
In-Reply-To: <xmqqmurmmt9j.fsf@gitster-ct.c.googlers.com>

```
Junio C Hamano <gitster@pobox.com> on Wed, 2018/10/10 11:26:
> As 'contrib' material without real maintenance, I do not care too
> deeply, but shouldn't this change be more like this to avoid
> duplicating the list of targets?

Probably, yes.
Do you want to add this yourself or do you want me to send an updated patch
or one on top of the last change?
-- 
main(a){char*c=/*    Schoene Gruesse                         */"B?IJj;MEH"
"CX:;",b;for(a/*    Best regards             my address:    */=0;b=c[a++];)
putchar(b-1/(/*    Chris            cc -ox -xc - && ./x    */b/42*2-3)*42);}

```

## Junio C Hamano, 2018-10-16 02:05

Subject: Re: [PATCH 1/1] subtree: add build targets 'man' and 'html'
Message-ID: <xmqq1s8q4pen.fsf@gitster-ct.c.googlers.com>
URL: https://gitlist.dev/e/xmqq1s8q4pen.fsf%40gitster-ct.c.googlers.com
In-Reply-To: <20181015231501.5a7524b0@leda>

```
Christian Hesse <list@eworm.de> writes:

> Junio C Hamano <gitster@pobox.com> on Wed, 2018/10/10 11:26:
>> As 'contrib' material without real maintenance, I do not care too
>> deeply, but shouldn't this change be more like this to avoid
>> duplicating the list of targets?
>
> Probably, yes.
> Do you want to add this yourself or do you want me to send an updated patch
> or one on top of the last change?

In principle either is fine but keep in mind that I'll likely forget
if you leave it up to me.

```

## Junio C Hamano, 2018-10-16 05:01

Subject: Re: [PATCH 1/1] subtree: add build targets 'man' and 'html'
Message-ID: <xmqq8t2y1o4y.fsf@gitster-ct.c.googlers.com>
URL: https://gitlist.dev/e/xmqq8t2y1o4y.fsf%40gitster-ct.c.googlers.com
In-Reply-To: <xmqq1s8q4pen.fsf@gitster-ct.c.googlers.com>

```
Junio C Hamano <gitster@pobox.com> writes:

> Christian Hesse <list@eworm.de> writes:
>
>> Junio C Hamano <gitster@pobox.com> on Wed, 2018/10/10 11:26:
>>> As 'contrib' material without real maintenance, I do not care too
>>> deeply, but shouldn't this change be more like this to avoid
>>> duplicating the list of targets?
>>
>> Probably, yes.
>> Do you want to add this yourself or do you want me to send an updated patch
>> or one on top of the last change?
>
> In principle either is fine but keep in mind that I'll likely forget
> if you leave it up to me.

Actully, I take it back.  The original patch is already in 'next',
so an incremental on top of what you sent is the only valid
improvement ;-)


```

## Christian Hesse, 2018-10-16 07:56

Subject: [PATCH 1/1] subtree: make install targets depend on build targets
Message-ID: <20181016075624.30176-1-list@eworm.de>
URL: https://gitlist.dev/e/20181016075624.30176-1-list%40eworm.de
In-Reply-To: <xmqq8t2y1o4y.fsf@gitster-ct.c.googlers.com>

```
From: Christian Hesse <mail@eworm.de>

Now that we have build targets let the install targets depend on them.
Also make the targets phony.

Signed-off-by: Christian Hesse <mail@eworm.de>
---
 contrib/subtree/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/contrib/subtree/Makefile b/contrib/subtree/Makefile
index 6906aae441..4a10a020a0 100644
--- a/contrib/subtree/Makefile
+++ b/contrib/subtree/Makefile
@@ -69,11 +69,11 @@ install: $(GIT_SUBTREE)
 
 install-doc: install-man install-html
 
-install-man: $(GIT_SUBTREE_DOC)
+install-man: man
 	$(INSTALL) -d -m 755 $(DESTDIR)$(man1dir)
 	$(INSTALL) -m 644 $^ $(DESTDIR)$(man1dir)
 
-install-html: $(GIT_SUBTREE_HTML)
+install-html: html
 	$(INSTALL) -d -m 755 $(DESTDIR)$(htmldir)
 	$(INSTALL) -m 644 $^ $(DESTDIR)$(htmldir)
 
@@ -98,4 +98,4 @@ clean:
 	$(RM) $(GIT_SUBTREE)
 	$(RM) *.xml *.html *.1
 
-.PHONY: FORCE
+.PHONY: FORCE man html install-man install-html

```

## Junio C Hamano, 2018-10-16 08:00

Subject: Re: [PATCH 1/1] subtree: make install targets depend on build targets
Message-ID: <xmqqy3ayxqwb.fsf@gitster-ct.c.googlers.com>
URL: https://gitlist.dev/e/xmqqy3ayxqwb.fsf%40gitster-ct.c.googlers.com
In-Reply-To: <20181016075624.30176-1-list@eworm.de>

```
Christian Hesse <list@eworm.de> writes:

> From: Christian Hesse <mail@eworm.de>
>
> Now that we have build targets let the install targets depend on them.
> Also make the targets phony.
>
> Signed-off-by: Christian Hesse <mail@eworm.de>
> ---
>  contrib/subtree/Makefile | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Thanks, will queue.

> diff --git a/contrib/subtree/Makefile b/contrib/subtree/Makefile
> index 6906aae441..4a10a020a0 100644
> --- a/contrib/subtree/Makefile
> +++ b/contrib/subtree/Makefile
> @@ -69,11 +69,11 @@ install: $(GIT_SUBTREE)
>  
>  install-doc: install-man install-html
>  
> -install-man: $(GIT_SUBTREE_DOC)
> +install-man: man
>  	$(INSTALL) -d -m 755 $(DESTDIR)$(man1dir)
>  	$(INSTALL) -m 644 $^ $(DESTDIR)$(man1dir)
>  
> -install-html: $(GIT_SUBTREE_HTML)
> +install-html: html
>  	$(INSTALL) -d -m 755 $(DESTDIR)$(htmldir)
>  	$(INSTALL) -m 644 $^ $(DESTDIR)$(htmldir)
>  
> @@ -98,4 +98,4 @@ clean:
>  	$(RM) $(GIT_SUBTREE)
>  	$(RM) *.xml *.html *.1
>  
> -.PHONY: FORCE
> +.PHONY: FORCE man html install-man install-html

```

## Jonathan Nieder, 2018-10-17 02:45

Subject: Re: [PATCH 1/1] subtree: make install targets depend on build targets
Message-ID: <20181017024503.GA117170@aiede.svl.corp.google.com>
URL: https://gitlist.dev/e/20181017024503.GA117170%40aiede.svl.corp.google.com
In-Reply-To: <20181016075624.30176-1-list@eworm.de>

```
Hi,

Christian Hesse wrote:

> --- a/contrib/subtree/Makefile
> +++ b/contrib/subtree/Makefile
> @@ -69,11 +69,11 @@ install: $(GIT_SUBTREE)
[...]
> -install-html: $(GIT_SUBTREE_HTML)
> +install-html: html

This broke the build for me:

 make[2]: Entering directory '/build/git-2.19.1+next.20181016/contrib/subtree'
 install -m 644 html /build/git-2.19.1+next.20181016/debian/tmp/usr/share/doc/git/html
 install: cannot stat 'html': No such file or directory
 make[2]: *** [Makefile:78: install-html] Error 1

The rule says

 install-html: html
	$(INSTALL) -d -m 755 $(DESTDIR)$(htmldir)
	$(INSTALL) -m 644 $^ $(DESTDIR)$(htmldir)

and $^ substitutes to "html" after this change.  How was this patch
tested?

Thanks,
Jonathan

```

## Junio C Hamano, 2018-10-18 02:05

Subject: Re: [PATCH 1/1] subtree: make install targets depend on build targets
Message-ID: <xmqqk1mgvwks.fsf@gitster-ct.c.googlers.com>
URL: https://gitlist.dev/e/xmqqk1mgvwks.fsf%40gitster-ct.c.googlers.com
In-Reply-To: <20181017024503.GA117170@aiede.svl.corp.google.com>

```
Jonathan Nieder <jrnieder@gmail.com> writes:

>> -install-html: $(GIT_SUBTREE_HTML)
>> +install-html: html
>
> This broke the build for me:
>
>  make[2]: Entering directory '/build/git-2.19.1+next.20181016/contrib/subtree'
>  install -m 644 html /build/git-2.19.1+next.20181016/debian/tmp/usr/share/doc/git/html
>  install: cannot stat 'html': No such file or directory
>  make[2]: *** [Makefile:78: install-html] Error 1
>
> The rule says
>
>  install-html: html
> 	$(INSTALL) -d -m 755 $(DESTDIR)$(htmldir)
> 	$(INSTALL) -m 644 $^ $(DESTDIR)$(htmldir)
>
> and $^ substitutes to "html" after this change.  How was this patch
> tested?

Gah, that was silly of me.

```

## Junio C Hamano, 2018-10-18 02:09

Subject: Re: [PATCH 1/1] subtree: make install targets depend on build targets
Message-ID: <xmqqftx4vwe5.fsf@gitster-ct.c.googlers.com>
URL: https://gitlist.dev/e/xmqqftx4vwe5.fsf%40gitster-ct.c.googlers.com
In-Reply-To: <20181017024503.GA117170@aiede.svl.corp.google.com>

```
Jonathan Nieder <jrnieder@gmail.com> writes:

> The rule says
>
>  install-html: html
> 	$(INSTALL) -d -m 755 $(DESTDIR)$(htmldir)
> 	$(INSTALL) -m 644 $^ $(DESTDIR)$(htmldir)
>
> and $^ substitutes to "html" after this change.

Sorry about that.

From: Junio C Hamano <gitster@pobox.com>
Date: Thu, 18 Oct 2018 11:07:17 +0900
Subject: [PATCH] Revert "subtree: make install targets depend on build targets"

This reverts commit 744f7c4c314dc0e7816ac05520e8358c8318187a.

These targets do depend on the fact that each prereq is explicitly
listed via their use of $^, which I failed to notice, and broke the
build.
---
 contrib/subtree/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/contrib/subtree/Makefile b/contrib/subtree/Makefile
index 4a10a020a0..6906aae441 100644
--- a/contrib/subtree/Makefile
+++ b/contrib/subtree/Makefile
@@ -69,11 +69,11 @@ install: $(GIT_SUBTREE)
 
 install-doc: install-man install-html
 
-install-man: man
+install-man: $(GIT_SUBTREE_DOC)
 	$(INSTALL) -d -m 755 $(DESTDIR)$(man1dir)
 	$(INSTALL) -m 644 $^ $(DESTDIR)$(man1dir)
 
-install-html: html
+install-html: $(GIT_SUBTREE_HTML)
 	$(INSTALL) -d -m 755 $(DESTDIR)$(htmldir)
 	$(INSTALL) -m 644 $^ $(DESTDIR)$(htmldir)
 
@@ -98,4 +98,4 @@ clean:
 	$(RM) $(GIT_SUBTREE)
 	$(RM) *.xml *.html *.1
 
-.PHONY: FORCE man html install-man install-html
+.PHONY: FORCE
-- 
2.19.1-450-ga4b8ab5363



```

## Christian Hesse, 2018-10-18 08:05

Subject: Re: [PATCH 1/1] subtree: make install targets depend on build targets
Message-ID: <20181018100504.053e4827@leda>
URL: https://gitlist.dev/e/20181018100504.053e4827%40leda
In-Reply-To: <xmqqftx4vwe5.fsf@gitster-ct.c.googlers.com>

```
Junio C Hamano <gitster@pobox.com> on Thu, 2018/10/18 11:09:
> Jonathan Nieder <jrnieder@gmail.com> writes:
> 
> > The rule says
> >
> >  install-html: html
> > 	$(INSTALL) -d -m 755 $(DESTDIR)$(htmldir)
> > 	$(INSTALL) -m 644 $^ $(DESTDIR)$(htmldir)
> >
> > and $^ substitutes to "html" after this change.  
> 
> Sorry about that.
> 
> From: Junio C Hamano <gitster@pobox.com>
> Date: Thu, 18 Oct 2018 11:07:17 +0900
> Subject: [PATCH] Revert "subtree: make install targets depend on build
> targets"
> 
> This reverts commit 744f7c4c314dc0e7816ac05520e8358c8318187a.
> 
> These targets do depend on the fact that each prereq is explicitly
> listed via their use of $^, which I failed to notice, and broke the
> build.
>
> [...]
>
> @@ -98,4 +98,4 @@ clean:
>  	$(RM) $(GIT_SUBTREE)
>  	$(RM) *.xml *.html *.1
>  
> -.PHONY: FORCE man html install-man install-html
> +.PHONY: FORCE

We could keep the phony part at least...

-- 
main(a){char*c=/*    Schoene Gruesse                         */"B?IJj;MEH"
"CX:;",b;for(a/*    Best regards             my address:    */=0;b=c[a++];)
putchar(b-1/(/*    Chris            cc -ox -xc - && ./x    */b/42*2-3)*42);}

```
