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
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Mar 25, 2019, 21:08 UTC
Message-ID
<nycvar.QRO.7.76.6.1903252206201.41@tvgsbejvaqbjf.bet>
In-Reply-To
<xmqqbm20ph45.fsf@gitster-ct.c.googlers.com>
Hi Junio,
On Sun, 24 Mar 2019, Junio C Hamano wrote:
Show 37 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
> > 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.
You are right, I should have root-caused it, it had a funny smell to it.

Turns out that we should not just skip those lines with a single token, but instead fix the bug that prevents the `how` variable to be set to `documented` in those cases, as had been intended all along.

I fixed the commit, and accompanied it with a bug fix for this, plus for the fall-out bugs that had been hidden by this bug.

Ciao, Dscho

Previous: Junio C HamanoNext: Johannes Schindelin via GitGitGadget
Message 7 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.