# [PATCH] install-webdoc: quell diff output on stdout

7 messages from 2010-09-01 to 2010-09-06. Participants: Michael J Gruber, Junio C Hamano.
Thread: https://gitlist.dev/t/24936

## Michael J Gruber, 2010-09-01 15:10

Subject: [PATCH] install-webdoc: quell diff output on stdout
Message-ID: <2730e927194a15f708ea4c5ffa72353f793f2ed4.1283353628.git.git@drmicha.warpmail.net>
URL: https://gitlist.dev/e/2730e927194a15f708ea4c5ffa72353f793f2ed4.1283353628.git.git%40drmicha.warpmail.net

```
When installing html-doc, install-webdoc.sh compares the installed html
with the version to be installed using diff. Currently, the diff output
fills up stdout.

Redirect this to /dev/null so that the actual progress report can be
spotted again. (Note that install-webdoc.sh actually uses $DIFF so that
redirecting stdout is safer than using an option which $DIFF may or may
not understand.)

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
---
 Documentation/install-webdoc.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Documentation/install-webdoc.sh b/Documentation/install-webdoc.sh
index 34d02a2..43c09d2 100755
--- a/Documentation/install-webdoc.sh
+++ b/Documentation/install-webdoc.sh
@@ -12,7 +12,7 @@ do
 	then
 		: did not match
 	elif test -f "$T/$h" &&
-	   $DIFF -u -I'Last updated [0-9][0-9]-[A-Z][a-z][a-z]-' "$T/$h" "$h"
+	   $DIFF -u -I'Last updated [0-9][0-9]-[A-Z][a-z][a-z]-' "$T/$h" "$h" >/dev/null
 	then
 		:; # up to date
 	else
-- 
1.7.2.2.540.g9d56f.dirty

```

## Junio C Hamano, 2010-09-01 16:24

Subject: Re: [PATCH] install-webdoc: quell diff output on stdout
Message-ID: <7vzkw15t50.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vzkw15t50.fsf%40alter.siamese.dyndns.org
In-Reply-To: <2730e927194a15f708ea4c5ffa72353f793f2ed4.1283353628.git.git@drmicha.warpmail.net>

```
Michael J Gruber <git@drmicha.warpmail.net> writes:

> When installing html-doc, install-webdoc.sh compares the installed html
> with the version to be installed using diff. Currently, the diff output
> fills up stdout.

As I've been using this output as the final sanity check on k.org
environment, I personally do not want to lose the output from that
particular diff.

When I push to the public repository, a hook is triggered to build and
install the documentation, sending its progress to a log file, and I have
a window open running "tail -f" on it.

Actually why don't we do the attached instead as the first step?

The timestamp that follows "Last updated " is formatted differently
depending on the version of AsciiDoc.  Looking at 4604fe56 on "html"
branch, you can see that AsciiDoc 7.0.2 used to give "02-Jul-2008 03:02:14
UTC" but AsciiDoc 8.2.5 gave "2008-09-19 06:33:25 UTC".  We haven't been
correctly filtering out phantom changes that result from only the build
date for some time now, it seems.

    Side note:

    How can you find the above easily?  Here is one way, if you run git
    with f506b8e (git log/diff: add -G<regexp> that greps in the patch
    text, 2010-08-23) currently parked in 'pu':

	git log -p -G"Last updated [0-9][0-9]-[A-Z][a-z][a-z]-" origin/html

 Documentation/install-webdoc.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Documentation/install-webdoc.sh b/Documentation/install-webdoc.sh
index 34d02a2..37e67d1 100755
--- a/Documentation/install-webdoc.sh
+++ b/Documentation/install-webdoc.sh
@@ -12,7 +12,7 @@ do
 	then
 		: did not match
 	elif test -f "$T/$h" &&
-	   $DIFF -u -I'Last updated [0-9][0-9]-[A-Z][a-z][a-z]-' "$T/$h" "$h"
+		$DIFF -u -I'^Last updated ' "$T/$h" "$h"
 	then
 		:; # up to date
 	else

```

## Michael J Gruber, 2010-09-02 07:29

Subject: Re: [PATCH] install-webdoc: quell diff output on stdout
Message-ID: <4C7F5267.5030708@drmicha.warpmail.net>
URL: https://gitlist.dev/e/4C7F5267.5030708%40drmicha.warpmail.net
In-Reply-To: <7vzkw15t50.fsf@alter.siamese.dyndns.org>

```
Junio C Hamano venit, vidit, dixit 01.09.2010 18:24:
> Michael J Gruber <git@drmicha.warpmail.net> writes:
> 
>> When installing html-doc, install-webdoc.sh compares the installed html
>> with the version to be installed using diff. Currently, the diff output
>> fills up stdout.
> 
> As I've been using this output as the final sanity check on k.org
> environment, I personally do not want to lose the output from that
> particular diff.
> 
> When I push to the public repository, a hook is triggered to build and
> install the documentation, sending its progress to a log file, and I have
> a window open running "tail -f" on it.

Sorry, isn't that a somewhat crazy type of sanity check? You're getting
the complete diff for the generated htmls flying by. Wouldn't the actual
"install..." be sufficient, or maybe, a QUIET_DIFF variant which
displays the command line? And not only sufficient, but actually easier
to check visually as you seem to do?

[A more throrough check would be comparing the name-diff of
Documentation/*.txt with that of the generated html.]

> 
> Actually why don't we do the attached instead as the first step?
> 
> The timestamp that follows "Last updated " is formatted differently
> depending on the version of AsciiDoc.  Looking at 4604fe56 on "html"
> branch, you can see that AsciiDoc 7.0.2 used to give "02-Jul-2008 03:02:14
> UTC" but AsciiDoc 8.2.5 gave "2008-09-19 06:33:25 UTC".  We haven't been
> correctly filtering out phantom changes that result from only the build
> date for some time now, it seems.
> 
>     Side note:
> 
>     How can you find the above easily?  Here is one way, if you run git
>     with f506b8e (git log/diff: add -G<regexp> that greps in the patch
>     text, 2010-08-23) currently parked in 'pu':
> 
> 	git log -p -G"Last updated [0-9][0-9]-[A-Z][a-z][a-z]-" origin/html
> 
>  Documentation/install-webdoc.sh |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/Documentation/install-webdoc.sh b/Documentation/install-webdoc.sh
> index 34d02a2..37e67d1 100755
> --- a/Documentation/install-webdoc.sh
> +++ b/Documentation/install-webdoc.sh
> @@ -12,7 +12,7 @@ do
>  	then
>  		: did not match
>  	elif test -f "$T/$h" &&
> -	   $DIFF -u -I'Last updated [0-9][0-9]-[A-Z][a-z][a-z]-' "$T/$h" "$h"
> +		$DIFF -u -I'^Last updated ' "$T/$h" "$h"
>  	then
>  		:; # up to date
>  	else

I think that is the right fix for the problem you mentioned, which is a
different one ;)

With your fix, the problem I'm after occurs less often, of course, maybe
to the extent of not being a real problem any more.

Michael

```

## Junio C Hamano, 2010-09-02 14:58

Subject: Re: [PATCH] install-webdoc: quell diff output on stdout
Message-ID: <7vhbi842gx.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vhbi842gx.fsf%40alter.siamese.dyndns.org
In-Reply-To: <4C7F5267.5030708@drmicha.warpmail.net>

```
Michael J Gruber <git@drmicha.warpmail.net> writes:

> Junio C Hamano venit, vidit, dixit 01.09.2010 18:24:
> ...
>> When I push to the public repository, a hook is triggered to build and
>> install the documentation, sending its progress to a log file, and I have
>> a window open running "tail -f" on it.
>
> Sorry, isn't that a somewhat crazy type of sanity check? You're getting
> the complete diff for the generated htmls flying by. Wouldn't the actual
> "install..." be sufficient, or maybe, a QUIET_DIFF variant which
> displays the command line? And not only sufficient, but actually easier
> to check visually as you seem to do?

I use the diff to see what text actually changed, so the answer is no.

But I am file with a patch to squelch the output by default, while giving
me an option (perhaps by setting an environment variable when the hook
triggers the build and install of the documentation) to unsquelch.

```

## Michael J Gruber, 2010-09-06 06:18

Subject: [PATCHv2] install-webdoc: quell diff output on stdout
Message-ID: <52f347f82734e5d75d0b93a67edca9941efaa5a9.1283612149.git.git@drmicha.warpmail.net>
URL: https://gitlist.dev/e/52f347f82734e5d75d0b93a67edca9941efaa5a9.1283612149.git.git%40drmicha.warpmail.net
In-Reply-To: <7vhbi842gx.fsf@alter.siamese.dyndns.org>

```
When installing html-doc, install-webdoc.sh compares the installed html
with the version to be installed using diff. Currently, the diff output
fills up stdout.

install-webdoc.sh actually uses $DIFF, and is the only user. Redefine
DIFF from "diff" to "diff -q" to quell the output which is a more useful
general default and in line with the default "QUIET" make rules.

This can be easily overriden by prefixing make with "DIFF=diff" or
putting this in config.mak.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
---
 Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index 38a8b65..b5d9c51 100644
--- a/Makefile
+++ b/Makefile
@@ -301,7 +301,7 @@ export prefix bindir sharedir sysconfdir gitwebdir
 CC = gcc
 AR = ar
 RM = rm -f
-DIFF = diff
+DIFF ?= diff -q
 TAR = tar
 FIND = find
 INSTALL = install
-- 
1.7.2.2.540.g9d56f.dirty

```

## Junio C Hamano, 2010-09-06 07:07

Subject: Re: [PATCHv2] install-webdoc: quell diff output on stdout
Message-ID: <7v7hizuz7h.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7v7hizuz7h.fsf%40alter.siamese.dyndns.org
In-Reply-To: <52f347f82734e5d75d0b93a67edca9941efaa5a9.1283612149.git.git@drmicha.warpmail.net>

```
Michael J Gruber <git@drmicha.warpmail.net> writes:

> When installing html-doc, install-webdoc.sh compares the installed html
> with the version to be installed using diff. Currently, the diff output
> fills up stdout.
>
> install-webdoc.sh actually uses $DIFF, and is the only user.

I think you broke "tNNNN-X.sh -v"; isn't $DIFF used in t/ scripts
everywhere?

Even if install-webdoc.sh were the sole user (which is not), please don't
do it this way.  Instead, introduce "SHOW_PATCH_WHILE_INSTALLING_WEBDOC"
or something, and run "$DIFF" with "-q" when it is not set.

Otherwise you would forbid people from using $DIFF for its intended
purpose: name a diff binary that can be used that is different from a
crappy diff your platform gives you by default.

```

## Michael J Gruber, 2010-09-06 13:24

Subject: Re: [PATCHv2] install-webdoc: quell diff output on stdout
Message-ID: <4C84EB73.4040901@drmicha.warpmail.net>
URL: https://gitlist.dev/e/4C84EB73.4040901%40drmicha.warpmail.net
In-Reply-To: <7v7hizuz7h.fsf@alter.siamese.dyndns.org>

```
Junio C Hamano venit, vidit, dixit 06.09.2010 09:07:
> Michael J Gruber <git@drmicha.warpmail.net> writes:
> 
>> When installing html-doc, install-webdoc.sh compares the installed html
>> with the version to be installed using diff. Currently, the diff output
>> fills up stdout.
>>
>> install-webdoc.sh actually uses $DIFF, and is the only user.
> 
> I think you broke "tNNNN-X.sh -v"; isn't $DIFF used in t/ scripts
> everywhere?

Um, OK, sorry. I grepped for it but not everywhere it seems. I'll be
partially online only this week but I'll try to come up with something
agreeable.

Michael

```
