Re: [PATCH] add a script to diff rendered documentation

2018-08-06 Thread Junio C Hamano
Jeff King writes: >> > + case "$1" in >> > + -j) >> > + parallel=${1#-j} ;; >> >> This is curious. Did you mean "-j*)" on the line above this one? > > Hmph, yes, I think this was broken even in the original. And after going > through "rev-parse --parseopt", we should have a separate

Re: [PATCH] add a script to diff rendered documentation

2018-08-06 Thread Jeff King
On Mon, Aug 06, 2018 at 11:25:07AM -0700, Junio C Hamano wrote: > Jeff King writes: > > > +while test $# -gt 0 > > +do > > + case "$1" in > > + -j) > > + parallel=${1#-j} ;; > > This is curious. Did you mean "-j*)" on the line above this one? Hmph, yes, I think this was broken

Re: [PATCH] add a script to diff rendered documentation

2018-08-06 Thread Junio C Hamano
Jeff King writes: > +while test $# -gt 0 > +do > + case "$1" in > + -j) > + parallel=${1#-j} ;; This is curious. Did you mean "-j*)" on the line above this one? > + -f) > + force=t ;; > + --) > + shift; break ;; > + *) > +

Re: [PATCH] add a script to diff rendered documentation

2018-08-06 Thread Jeff King
h threads. So I've left it for now, but if anybody is interested in poking at it, go for it. -- >8 -- Subject: [PATCH] add a script to diff rendered documentation After making a change to the documentation, it's easy to forget to check the rendered version to make sure it was formatted as

Re: [PATCH] add a script to diff rendered documentation

2018-08-06 Thread Jeff King
On Mon, Aug 06, 2018 at 08:16:47AM -0700, Junio C Hamano wrote: > It's a bit dissapointing that we cannot express personal preference > in config.mak ;-) Try this: diff --git a/Makefile b/Makefile index e7994888e8..36bddff3be 100644 --- a/Makefile +++ b/Makefile @@ -1119,6 +1119,11 @@ ifdef

Re: [PATCH] add a script to diff rendered documentation

2018-08-06 Thread Jeff King
On Mon, Aug 06, 2018 at 08:01:00AM -0700, Jonathan Nieder wrote: > Jeff King wrote: > > > 3. Default to number of CPUs, which is what a lot of other threading > > in Git does. Unfortunately getting that from the shell is > > non-trivial. I'm OK with $(grep -c ^processor

Re: [PATCH] add a script to diff rendered documentation

2018-08-06 Thread Junio C Hamano
Jeff King writes: > On Mon, Aug 06, 2018 at 09:39:55AM -0400, Jeff King wrote: > >> 3. Default to number of CPUs, which is what a lot of other threading >> in Git does. Unfortunately getting that from the shell is >> non-trivial. I'm OK with $(grep -c ^processor /proc/cpuinfo), but

Re: [PATCH] add a script to diff rendered documentation

2018-08-06 Thread Jonathan Nieder
Jeff King wrote: > 3. Default to number of CPUs, which is what a lot of other threading > in Git does. Unfortunately getting that from the shell is > non-trivial. I'm OK with $(grep -c ^processor /proc/cpuinfo), but > people on non-Linux platforms would have to fill in their own

Re: [PATCH] add a script to diff rendered documentation

2018-08-06 Thread Jeff King
On Mon, Aug 06, 2018 at 09:39:55AM -0400, Jeff King wrote: > 3. Default to number of CPUs, which is what a lot of other threading > in Git does. Unfortunately getting that from the shell is > non-trivial. I'm OK with $(grep -c ^processor /proc/cpuinfo), but > people on non-Linux

Re: [PATCH] add a script to diff rendered documentation

2018-08-06 Thread Jeff King
On Sun, Aug 05, 2018 at 08:49:31PM +, brian m. carlson wrote: > > +parallel=8 > > I'm not sure -j8 is a great default. There are still a lot of > two-core/four-thread machines out there, such as my laptop (from 2016). > Maybe we should default this to 1 unless -j is provided, like make

Re: [PATCH] add a script to diff rendered documentation

2018-08-05 Thread brian m. carlson
On Fri, Aug 03, 2018 at 04:52:05PM -0400, Jeff King wrote: > I wrote this up for my own use after our discussion in [1]. I'm not sure > if it's too ugly for inclusion, or if it might be helpful to others. > I've only just written it, but my plan is to try to run it on anything I > submit to check

Re: [PATCH] add a script to diff rendered documentation

2018-08-03 Thread Eric Sunshine
On Fri, Aug 3, 2018 at 5:47 PM Junio C Hamano wrote: > Eric Sunshine writes: > > There doesn't seem to a usage() function defined anywhere (and > > OPTIONS_SPEC doesn't seem to be used). > > Isn't this using the parse-options thing git-sh-setup gives us for > free? Yes. I saw that git-sh-setup

Re: [PATCH] add a script to diff rendered documentation

2018-08-03 Thread Junio C Hamano
Eric Sunshine writes: >> + shift; break ;; >> + *) >> + usage ;; > > There doesn't seem to a usage() function defined anywhere (and > OPTIONS_SPEC doesn't seem to be used). Isn't this using the parse-options thing git-sh-setup gives us for free?

Re: [PATCH] add a script to diff rendered documentation

2018-08-03 Thread Eric Sunshine
On Fri, Aug 3, 2018 at 5:38 PM Jeff King wrote: > On Fri, Aug 03, 2018 at 05:33:17PM -0400, Eric Sunshine wrote: > I suppose so. Frankly I only added that line to appease git-sh-options > anyway. > > Should "j" and "f" be "-j" and "-f", respectively? > No, they're input to "rev-parse --parseopt".

Re: [PATCH] add a script to diff rendered documentation

2018-08-03 Thread Jeff King
On Fri, Aug 03, 2018 at 05:33:17PM -0400, Eric Sunshine wrote: > > +OPTIONS_SPEC="\ > > +doc-diff [-- diff options] > > Should this be? > > doc-diff [] [-- ] I suppose so. Frankly I only added that line to appease git-sh-options anyway. > > +-- > > +j parallel argument to pass to

Re: [PATCH] add a script to diff rendered documentation

2018-08-03 Thread Eric Sunshine
On Fri, Aug 3, 2018 at 4:52 PM Jeff King wrote: > [...] > Let's provide a script that builds and installs the manpages > for two commits, renders the results using "man", and diffs > the result. Since this is time-consuming, we'll also do our > best to avoid repeated work, keeping intermediate

[PATCH] add a script to diff rendered documentation

2018-08-03 Thread Jeff King
After making a change to the documentation, it's easy to forget to check the rendered version to make sure it was formatted as you intended. And simply doing a diff between the two built versions is less trivial than you might hope: - diffing the roff or html output isn't particularly