Skip to content

Commit e91461b

Browse files
peffgitster
authored andcommitted
docs/git-submodule: fix unbalanced quote
The documentation gives an example of the submodule foreach command that uses both backticks and single-quotes. We stick the whole thing inside "+" markers to make it monospace, but the inside punctuation still needs escaping. We handle the backticks with "{backtick}", and use backslash-escaping for the single-quotes. But we missed the escaping on the second quote. Fortunately, asciidoc renders this unbalanced quote as we want (showing the quote), but asciidoctor does not. We could fix it by adding the missing backslash. However, let's take a step back. Even when rendered correctly, it's hard to read a long command stuck into the middle of a paragraph, and the important punctuation is hard to notice. Let's instead bump it into its own single-line code block. That makes both the source and the rendered result more readable, and as a bonus we don't have to worry about quoting at all. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 3b9e3c2 commit e91461b

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

Documentation/git-submodule.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,12 @@ foreach::
227227
the processing to terminate. This can be overridden by adding '|| :'
228228
to the end of the command.
229229
+
230-
As an example, +git submodule foreach \'echo $path {backtick}git
231-
rev-parse HEAD{backtick}'+ will show the path and currently checked out
232-
commit for each submodule.
230+
As an example, the command below will show the path and currently
231+
checked out commit for each submodule:
232+
+
233+
--------------
234+
git submodule foreach 'echo $path `git rev-parse HEAD`'
235+
--------------
233236

234237
sync::
235238
Synchronizes submodules' remote URL configuration setting

0 commit comments

Comments
 (0)