git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/1] check-docs: fix for setups where executables have an extension

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 24, 2019, 12:54 UTC
Message-ID
<xmqqbm20ph45.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<nycvar.QRO.7.76.6.1903241055230.45@tvgsbejvaqbjf.bet>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 12 quoted lines
> Sharp eyes, and a *very* good point. The double space is actually required
> for this patch to work as intended. I added the following explanation to
> the commit message:
>
>     Note that `$(ALL_COMMANDS)` starts with a space, and that is rather
>     crucial for the `while read how cmd` loop: some of the input lines do
>     not actually have the form `<how> <cmd>`, but only `<cmd>`, therefore
>     `$cmd` evaluates to the empty string, and when we are looking for
>     `* $cmd *` in ` $(ALL_COMMANDS)`, we do find it because the latter
>     starts with a double space.
>     In other words, the double space helps us skip the lines that list
>     only a command.

That sounds more like a bug in the existing set-up even before your patch (in fact, these lines are probably from 2007 or so, long before you started touching our top-level Makefile heavily). If we want to ignore lines with only one token, I'd rather see it explicitly done, e.g.

	... generate data ... |
	while read how cmd
	do
		# skip a line with a single token
		case "$cmd" in "") continue ;; esac
		# is $cmd part of the known command list?
		case " $(ALL_COMMANDS) " in
		*" $cmd "*)	;; # skip
		*)	echo ... warning ... ;;
		esac
	done

instead of relying on "if $cmd is empty, then SP + $cmd + SP makes double space, so let's have double space somewhere in the list of known commands" cuteness.

Thanks.
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 6 of 17 in “Fix make check-docs on Windows”
  1. 0/1 Fix make check-docs on WindowsJohannes Schindelin via GitGitGadget, Mar 13, 2019
  2. 1/1 check-docs: fix for setups where executables have an extensionJohannes Schindelin via GitGitGadget, Mar 13, 2019
  3. Junio C HamanoMar 14, 2019
  4. Taylor BlauMar 22, 2019
  5. Johannes SchindelinMar 24, 2019
  6. Junio C HamanoMar 24, 2019
  7. Johannes SchindelinMar 25, 2019
  8. 0/5 Fix make check-docs on WindowsJohannes Schindelin via GitGitGadget, Mar 25, 2019
  9. 3/5 check-docs: really look at the documented commands againJohannes Schindelin via GitGitGadget, Mar 25, 2019
  10. 5/5 check-docs: fix for setups where executables have an extensionJohannes Schindelin via GitGitGadget, Mar 25, 2019
  11. 2/5 docs: do not document the `git remote-testgit` commandJohannes Schindelin via GitGitGadget, Mar 25, 2019
  12. Ævar Arnfjörð BjarmasonMar 26, 2019
  13. Johannes SchindelinMar 27, 2019
  14. Johannes SchindelinMar 29, 2019
  15. 1/5 docs: move gitremote-helpers into section 7Johannes Schindelin via GitGitGadget, Mar 25, 2019
  16. 4/5 check-docs: do not expect guide pages to correspond to commandsJohannes Schindelin via GitGitGadget, Mar 25, 2019
  17. Johannes SchindelinMar 26, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.