Re: [PATCH 8/4] check-docs: get documented command list from Makefile

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jeff King <peff@xxxxxxxx> writes:

> The current code tries to get a list of documented commands
> by doing "ls Documentation/git*txt" and culling a bunch of
> special cases from the result. Looking for "git-*.txt" would
> be more accurate, but would miss a few commands like
> "gitweb" and "gitk".
>
> Fortunately, Documentation/Makefile already knows what this
> list is, so we can just ask it. Annoyingly, we still have to
> post-process its output a little, since make will print
> extra cruft like "GIT-VERSION-FILE is up to date" to stdout.

Yeah, traditional way to do this is to give special markers around
what you want your Makefile to tell you, e.g.

	sayit:
        	echo "@@@ $(FOO) ###"
	useit:
        	$(MAKE) sayit | \
                sed -ne 's/^@@@ \(.*\) ###$/\1/p' | \
                ... use it ...

but in this case we know we want "*.txt", so the way you filtered
the output is sufficient.

> Now that our list is accurate, we can remove all of the ugly
> special-cases.
>
> Signed-off-by: Jeff King <peff@xxxxxxxx>
> ---
>  Documentation/Makefile |  3 +++
>  Makefile               | 26 ++------------------------

Yay, maintainability comes with a large line reduction bonus ;-)

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]