threads / patch / 24936

patchinstall-webdoc: quell diff output on stdout

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

## tl;dr

7 messages between Sep 1, 2010 and Sep 6, 2010. Diffs are folded; open one to read it.

replies: 6people: 2as markdown or json

Michael J Gruber· Sep 1, 2010, 15:10 UTC · lore

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(-)
Show changes to Documentation/install-webdoc.sh +1 −1
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· Sep 1, 2010, 16:24 UTC · re: Michael J Gruber · lore

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

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(-)
Show changes to Documentation/install-webdoc.sh +1 −1
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· Sep 2, 2010, 07:29 UTC · re: Junio C Hamano · lore

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

Junio C Hamano venit, vidit, dixit 01.09.2010 18:24:
Show 13 quoted lines
> 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.]

Show 34 quoted lines
> 
> 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· Sep 2, 2010, 14:58 UTC · re: Michael J Gruber · lore

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

Michael J Gruber <git@drmicha.warpmail.net> writes:
Show 11 quoted lines
> 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· Sep 6, 2010, 06:18 UTC · re: Junio C Hamano · lore

[PATCHv2] install-webdoc: quell diff output on stdout

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(-)
Show changes to Makefile +1 −1
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· Sep 6, 2010, 07:07 UTC · re: Michael J Gruber · lore

Re: [PATCHv2] install-webdoc: quell diff output on stdout

Michael J Gruber <git@drmicha.warpmail.net> writes:
Show 5 quoted lines
> 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· Sep 6, 2010, 13:24 UTC · re: Junio C Hamano · lore

Re: [PATCHv2] install-webdoc: quell diff output on stdout

Junio C Hamano venit, vidit, dixit 06.09.2010 09:07:
Show 10 quoted lines
> 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

← back to recent threads