git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Andreas Heiduk <asheiduk@gmail.com>
Cc: ryenus <ryenus@gmail.com>, Git mailing list <git@vger.kernel.org>
Subject: Re: [PATCH] fix revisions doc about quoting for ':/' notation
Date: Wed, 16 Aug 2017 14:57:21 -0700	[thread overview]
Message-ID: <xmqqo9rfi3b2.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <956ccc83-c291-4217-795c-fcef33fac35b@gmail.com> (Andreas Heiduk's message of "Wed, 16 Aug 2017 23:15:47 +0200")

Andreas Heiduk <asheiduk@gmail.com> writes:

> Am 16.08.2017 um 05:21 schrieb ryenus:
>> To make sure the `<text>` in `:/<text>` is seen as one search string,
>> one should quote/escape `<text>` properly.
>> 
>> Especially, the example given in the manual `:/fix nasty bug` does not
>> work because of missing quotes. The examples are now corrected, and a
>> note about quoting/escaping is added as well.
>
> Right now the documentation describes the syntax as git sees the
> parameters. This is agnostic of the shell or other UI with their
> different quoting rules.  For example users of fish must quote
> `rev@{2}`. A GUI might require no quoting at all. In that case `:/"fix
> nasty bugs"` would be given to git verbatim and hence not find the revision.

These are all good points that I didn't consider when responding.

> Also: Other examples like `HEAD@{5 minutes ago}` need the same quoting.
>
> So my suggestion is to not use quoting in the examples and provide only
> a hint in the text. Example:
>
>  <rev>{caret}{/<text>}', e.g. 'HEAD^{/fix nasty bug}'::
>     A suffix '{caret}' to a revision parameter, followed by a brace
>     pair that contains a text led by a slash,
>     is the same as the ':/fix nasty bug' syntax below except that
>     it returns the youngest matching commit which is reachable from
>     the '<rev>' before '{caret}'.
> +   Depending on the given text the shell's word splitting rules
> +   might require additional quoting.

That sounds like a very safe change to adopt, regardless of what we
decide to do to the other part of the proposed change.

Thanks.

  reply	other threads:[~2017-08-16 21:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-16  3:21 [PATCH] fix revisions doc about quoting for ':/' notation ryenus
2017-08-16 18:49 ` Junio C Hamano
2017-08-16 21:15 ` Andreas Heiduk
2017-08-16 21:57   ` Junio C Hamano [this message]
2017-08-17  7:01     ` ryenus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqo9rfi3b2.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=asheiduk@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=ryenus@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).