git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] docs/gitremote-helpers: fix unbalanced quotes
@ 2017-02-13 20:38 Jeff King
  2017-02-13 21:05 ` [PATCH] docs/git-submodule: fix unbalanced quote Jeff King
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff King @ 2017-02-13 20:38 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano

Each of these options is missing the closing single-quote on
the option name. This understandably confuses asciidoc,
which ends up rendering a stray quote, like:

  option cloning {'true|false}

Signed-off-by: Jeff King <peff@peff.net>
---
 Documentation/gitremote-helpers.txt | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Documentation/gitremote-helpers.txt b/Documentation/gitremote-helpers.txt
index 9e8681f9e..7e59c50b1 100644
--- a/Documentation/gitremote-helpers.txt
+++ b/Documentation/gitremote-helpers.txt
@@ -452,14 +452,14 @@ set by Git if the remote helper has the 'option' capability.
 	Request the helper to perform a force update.  Defaults to
 	'false'.
 
-'option cloning {'true'|'false'}::
+'option cloning' {'true'|'false'}::
 	Notify the helper this is a clone request (i.e. the current
 	repository is guaranteed empty).
 
-'option update-shallow {'true'|'false'}::
+'option update-shallow' {'true'|'false'}::
 	Allow to extend .git/shallow if the new refs require it.
 
-'option pushcert {'true'|'false'}::
+'option pushcert' {'true'|'false'}::
 	GPG sign pushes.
 
 SEE ALSO
-- 
2.12.0.rc1.466.g70234cfd8

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] docs/git-submodule: fix unbalanced quote
  2017-02-13 20:38 [PATCH] docs/gitremote-helpers: fix unbalanced quotes Jeff King
@ 2017-02-13 21:05 ` Jeff King
  2017-02-13 22:06   ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff King @ 2017-02-13 21:05 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano

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>
---
Not textually related to the previous fix, but obviously along the same
lines.

 Documentation/git-submodule.txt | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt
index 918bd1d1b..a8eb1c7ce 100644
--- a/Documentation/git-submodule.txt
+++ b/Documentation/git-submodule.txt
@@ -228,9 +228,12 @@ foreach::
 	the processing to terminate. This can be overridden by adding '|| :'
 	to the end of the command.
 +
-As an example, +git submodule foreach \'echo $path {backtick}git
-rev-parse HEAD{backtick}'+ will show the path and currently checked out
-commit for each submodule.
+As an example, the command below will show the path and currently
+checked out commit for each submodule:
++
+--------------
+git submodule foreach 'echo $path `git rev-parse HEAD`'
+--------------
 
 sync::
 	Synchronizes submodules' remote URL configuration setting
-- 
2.12.0.rc1.466.g70234cfd8


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] docs/git-submodule: fix unbalanced quote
  2017-02-13 21:05 ` [PATCH] docs/git-submodule: fix unbalanced quote Jeff King
@ 2017-02-13 22:06   ` Junio C Hamano
  0 siblings, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2017-02-13 22:06 UTC (permalink / raw)
  To: Jeff King; +Cc: git

Jeff King <peff@peff.net> writes:

> 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.

Yes, I like this reasoning behind the solution very much.

Thanks.

>  Documentation/git-submodule.txt | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt
> index 918bd1d1b..a8eb1c7ce 100644
> --- a/Documentation/git-submodule.txt
> +++ b/Documentation/git-submodule.txt
> @@ -228,9 +228,12 @@ foreach::
>  	the processing to terminate. This can be overridden by adding '|| :'
>  	to the end of the command.
>  +
> -As an example, +git submodule foreach \'echo $path {backtick}git
> -rev-parse HEAD{backtick}'+ will show the path and currently checked out
> -commit for each submodule.
> +As an example, the command below will show the path and currently
> +checked out commit for each submodule:
> ++
> +--------------
> +git submodule foreach 'echo $path `git rev-parse HEAD`'
> +--------------
>  
>  sync::
>  	Synchronizes submodules' remote URL configuration setting

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-02-13 22:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-13 20:38 [PATCH] docs/gitremote-helpers: fix unbalanced quotes Jeff King
2017-02-13 21:05 ` [PATCH] docs/git-submodule: fix unbalanced quote Jeff King
2017-02-13 22:06   ` Junio C Hamano

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).