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

Re: [PATCH] documentation: escape '~' in git revert

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 2, 2010, 18:05 UTC
Message-ID
<7v8w08rqx3.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1291311393-31843-1-git-send-email-sylvain.rabot@f-secure.com>
Sylvain Rabot <sylvain.rabot@f-secure.com> writes:
> backslashing '~' characters do not have any effect, quoting with +++ has.

I vaguely recall that we tried to avoid using '+++' because versions of AsciiDoc that were widely used back when the bulk of documentation was written either did not handle the construct correctly, or did not know about it at all. So I would be very hesitant to take this patch as-is.

Giving a cursory look at:
    http://www.kernel.org/pub/software/scm/git/docs/git-revert.html

the first instance (HEAD~3) seems to be formatted Ok there (they run AsciiDoc 8.4.5 with xmlto 0.0.23 on F13), but it seems that we do need to do something with the second one (~5..master~2).

I think the problem is that AsciiDoc takes ~something~ as a mark-up for something. Does it work to drop the backslash before ~5 and replace ~ with {tilde}, which was invented to deal with problems like this?

Show 26 quoted lines
> Signed-off-by: Sylvain Rabot <sylvain.rabot@f-secure.com>
> ---
>  Documentation/git-revert.txt |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/git-revert.txt b/Documentation/git-revert.txt
> index f40984d..9368892 100644
> --- a/Documentation/git-revert.txt
> +++ b/Documentation/git-revert.txt
> @@ -82,12 +82,12 @@ effect to your index in a row.
>  
>  EXAMPLES
>  --------
> -git revert HEAD~3::
> +git revert HEAD+++~+++3::
>  
>  	Revert the changes specified by the fourth last commit in HEAD
>  	and create a new commit with the reverted changes.
>  
> -git revert -n master\~5..master~2::
> +git revert -n master+++~+++5..master+++~+++2::
>  
>  	Revert the changes done by commits from the fifth last commit
>  	in master (included) to the third last commit in master
> -- 
> 1.7.3.2
Previous: Sylvain Rabot
Message 7 of 7 in “documentation: escape '~' in git revert”
  1. documentation: escape '~' in git revertSylvain Rabot, Dec 2, 2010
  2. Jonathan NiederDec 2, 2010
  3. Junio C HamanoDec 2, 2010
  4. Jonathan NiederDec 2, 2010
  5. Junio C HamanoDec 2, 2010
  6. documentation: replace wrongly evalutated backslashed '~' charactersSylvain Rabot, Dec 2, 2010
  7. Junio C HamanoDec 2, 2010

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.