Subject: Re: bug#36644: Git log search

From: Eli Zaretskii <[email-masked]>
Date: Wed, 24 Jul 2019 19:13:37 +0300

> Cc: "[email-masked]" <[email-masked]>,
>  Juri Linkov <[email-masked]>, Eli Zaretskii <[email-masked]>
> From: Dmitry Gutov <[email-masked]>
> Date: Wed, 24 Jul 2019 18:53:01 +0300
> 
> > Itʼs not a pattern. Itʼs a string that is passed as-is to the backend,
> > which is free to interpret it as it wishes. From my viewpoint, we can
> > just say
> > 
> > "Search for STRING, which is passed unsullied to the backend's log
> > search command.  Consult the documentation for your backend to
> > understand the matching method it uses to search for STRING."
> 
> IME this doesn't match the way we try to document commands in Emacs, but 
> I wouldn't want to spend much time arguing about this.
> 
> Eli, could you weigh in in this discussion? Would you say Robert's 
> proposal is acceptable?

Yes, I think on balance it's acceptable.

I also see your point: it would be nice to be able to document the
semantics of PATTERN in a backend-independent way.  But I think this
is next to impossible in this case, both because of significant
differences in the backend capabilities (e.g., bzr doesn't have the
equivalent of Git's --fixed-strings, AFAICT), and because some backend
allow great flexibility in interpreting PATTERN, under control of
optional switches passed to the backend.  the only way to make this
backend-independent is to do the search in Emacs Lisp, which I think
will slow down the command too much.

So I think we should treat this as we do in "M-x grep": leave the
semantics of PATTERN backend-dependent, and rely on the user to quote
some characters in it as needed.  Admittedly, 'grep' is lower-level
than 'vc-log-search', but at least we have a precedent.

Note that I still think we should use PATTERN, not STRING in the doc
string, because a literal string here is more an exception than a
rule.  But we should say that the exact semantics of PATTERN is
backend-dependent, and perhaps describe how a couple of the more
popular backends interpret it.