unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
Cc: 37189@debbugs.gnu.org, dgutov@yandex.ru
Subject: bug#37189: 25.4.1: vc-hg-ignore implementation is missing
Date: Wed, 12 Feb 2020 20:34:55 +0200	[thread overview]
Message-ID: <83o8u3r6wg.fsf@gnu.org> (raw)
In-Reply-To: <2c8419ae-723d-c7ae-a60e-59d1b1cbc2c1@gmx.de> (message from Wolfgang Scherer on Tue, 11 Feb 2020 23:28:10 +0100)

> Cc: dgutov@yandex.ru, 37189@debbugs.gnu.org
> From: Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
> Date: Tue, 11 Feb 2020 23:28:10 +0100
> 
> I do not actually give up:-). I just think it is easier to
> convince you that the "file path" use case is already supposed to
> be supported by Emacs.

What is the "file path use case"?  To what commands does it pertain?

> >> A command that locates an ignore file, but can only do so, if the
> >> default-directory is already the one containing the ignore
> >> file (always true for SRC, CVS, SVN)
> > Is locating the ignore file a separate issue?  AFAICT, we currently
> > always look for the ignore file in the repository root, is that right?
> > If so, are you proposing a new feature here, where we would support
> > ignore files in subdirectories?
> 
> I am not (yet) talking about a new feature, but about the "file path"
> use case in *vc-dir-mode* for per-directory VCSs (CVS, SVN, SRC).

Do we support per-directory ignore files in the current codebase?  I
think we don't: I see that every backend simply looks in the root of
the repository.  If I'm right, then supporting per-directory ignore
files is an enhancement, which should then be considered separately
from fixing bugs in the current code.

> E.g., in this *vc-dir-mode* buffer it is not possible to use *vc-ignore*
> in "pattern" mode:for adding an ignore pattern for SVN to `sub/`
> or for SVN or CVS in `sub/sub2/`:
> 
> ``` {.sourceCode .text}
> VC backend : SVN
> Working dir: /the/top
> 
>                   .svn
>                   sub/CVS
>    edited         sub/.cvsignore
>                   sub/sub2/CVS
>                   sub/sub2/RCS
>    edited         sub/sub2/.cvsignore
> ```
> 
> In case of nested repositories with different VC backends (e.g. in
> directories `sub` and `sub/sub2` above), it may even become necessary to
> invoke *vc-dir* with a prefix argument to specify the appropriate VC
> manually.

I don't think we support such nesting at this time, do we?

> > Since vc-dir-ignore computes the file name(s) to add to the ignore
> > file, it indeed will need to escape all the special characters in file
> > names it will add, before it invokes vc-ignore.  You are right here.
> In order to know, what part of the filename must be used, it is
> necessary to know the location of the ignore file, which is only known
> by the backend.

If I'm right in saying that we currently support only ignore files in
the root of the repository, then this is not an issue.  And even if it
is an issue, we already have a backend method to find the ignore file,
so we could use it (or modify it if needed).

> >> They also expect a visual feedback, that the operation had the
> >> desired effect, as they have come to expect from all the other
> >> commands in `vc-dir-mode`.
> > AFAICT, the command does provide feedback.  Or maybe I misunderstand
> > what feedback you had in mind.
> 
> vc-dir-ignore currently does not provide the normal feedback, I only just now put it in:
> 
>       (vc-dir-resynch-file file)

OK, so you _did_ mean a different kind of feedback.  What I meant is
the "/foo/bar/.ignore written" feedback.

> > The old behavior of vc-ignore was not broken for interactive
> > invocations.  It was broken (in rare cases) for invocations from
> > vc-dir-ignore, and that can IMO be fixed without affecting user-facing
> > behavior.  So I see no backward-incompatible changes here.
> Sorry, not *rare* but **all** cases! The invocation from vc-dir-ignore
> placed an **absolute file path** into the ignore file.

That's not what I see, at least not with Git as the backend.  I see
only the basename of the file being added to the ignore file.  Can you
show a use case where an absolute file name is written into the ignore
file by vc-dir-ignore?

> > My point is that Grep patterns can include characters special for the
> > shell, but we never escape them ourselves, we rely on the user to
> > escape them as needed.
> 
> The pattern is not prompted for separately!

True, but I don't think this detail matters for the purposes of the
analogy.

> There is no way, that the pattern argument for the *grep* command
> could be reliably parsed and quoted.

Of course it's possible.  It's just very complex and tedious, and more
importantly, requires the user to play by certain rules: e.g., the
user must agree never to quote/escape the patterns he/she types.
Instead, we give the user the freedom to decide when to quote and
when not to quote.  The same should be done with vc-ignore (but not
with vc-dir-ignore).





  reply	other threads:[~2020-02-12 18:34 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-26  0:21 bug#37189: 25.4.1: vc-hg-ignore implementation is missing Wolfgang Scherer
     [not found] ` <handler.37189.B.15667808855126.ack@debbugs.gnu.org>
2019-08-26 23:25   ` bug#37189: Acknowledgement (25.4.1: vc-hg-ignore implementation is missing) Wolfgang Scherer
2019-08-27  7:45     ` Eli Zaretskii
2019-08-28  1:46       ` bug#37189: *** GMX Spamverdacht *** " Wolfgang Scherer
2019-08-28  6:16         ` Eli Zaretskii
2019-08-29  1:23           ` bug#37189: 25.4.1: vc-hg-ignore implementation is missing Wolfgang Scherer
2019-08-29  0:38         ` Wolfgang Scherer
2019-08-29 15:52           ` Wolfgang Scherer
2019-12-25  0:16             ` Dmitry Gutov
2020-01-05  3:46               ` Wolfgang Scherer
2020-01-05  8:58                 ` Andreas Schwab
2020-01-05 17:25                   ` Wolfgang Scherer
2020-01-14  1:14                 ` Dmitry Gutov
2020-02-01  1:20                   ` Wolfgang Scherer
2020-02-01  8:27                     ` Eli Zaretskii
2020-02-03  1:16                       ` Wolfgang Scherer
2020-02-04 18:55                         ` Eli Zaretskii
2020-02-05  5:18                           ` Wolfgang Scherer
2020-02-05 19:06                           ` Wolfgang Scherer
2020-02-07  9:57                             ` Eli Zaretskii
2020-02-08  9:57                               ` Dmitry Gutov
2020-02-08 19:45                                 ` Wolfgang Scherer
2020-02-08 20:05                                   ` Eli Zaretskii
2020-02-08 23:12                                     ` Wolfgang Scherer
2020-02-09 13:57                                       ` Wolfgang Scherer
2020-02-09 14:07                                         ` Wolfgang Scherer
2020-02-09 13:57                                       ` Wolfgang Scherer
2020-02-09 13:57                                       ` Wolfgang Scherer
2020-02-10 16:02                                         ` Eli Zaretskii
2020-02-11  1:45                                           ` Wolfgang Scherer
2020-02-11 17:32                                             ` Eli Zaretskii
2020-02-11 22:28                                               ` Wolfgang Scherer
2020-02-12 18:34                                                 ` Eli Zaretskii [this message]
     [not found]                                                   ` <6f3ba261-e1f9-cf19-cc22-ec8c24cf3298@gmx.de>
2020-02-12 23:20                                                     ` Wolfgang Scherer
2020-02-13  1:18                                                       ` Wolfgang Scherer
2020-02-13 15:09                                                         ` Eli Zaretskii
2020-02-13 16:30                                                           ` Wolfgang Scherer
2020-02-13 23:43                                                           ` Richard Stallman
2020-02-14  1:49                                                             ` Wolfgang Scherer
2020-02-16  2:29                                                               ` Richard Stallman
2020-02-13 15:21                                                         ` Eli Zaretskii
2020-02-13 23:40                                                           ` Dmitry Gutov
2020-02-14  9:23                                                             ` Eli Zaretskii
2020-02-21  0:05                                                               ` Dmitry Gutov
2020-02-21  8:10                                                                 ` Eli Zaretskii
2020-02-21 22:22                                                                 ` Wolfgang Scherer
2020-02-22  7:44                                                                   ` Eli Zaretskii
2020-02-22 13:46                                                                     ` Wolfgang Scherer
2020-02-22 14:30                                                                       ` Eli Zaretskii
2020-02-22 19:14                                                                         ` Dmitry Gutov
2020-02-22 22:04                                                                           ` Wolfgang Scherer
2020-02-22 23:32                                                                         ` Wolfgang Scherer
2020-02-23 15:20                                                                           ` Eli Zaretskii
2020-02-23 19:16                                                                             ` Wolfgang Scherer
2020-02-22 19:30                                                                   ` Dmitry Gutov
2020-02-22 22:00                                                                     ` Wolfgang Scherer
2020-02-22 23:58                                                                       ` Dmitry Gutov
2020-02-23  0:29                                                                         ` Wolfgang Scherer
2020-02-24 23:07                                                                           ` Dmitry Gutov
2020-02-25  2:22                                                                             ` Wolfgang Scherer
2020-03-19 23:42                                                                               ` Dmitry Gutov
2020-07-03 20:53                                                                                 ` Wolfgang Scherer
2020-07-03 21:49                                                                                   ` Dmitry Gutov
2020-02-12 17:23                                               ` Wolfgang Scherer
2020-02-08 23:59                                     ` Wolfgang Scherer
2020-02-09 21:06                               ` Wolfgang Scherer

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: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=83o8u3r6wg.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=37189@debbugs.gnu.org \
    --cc=Wolfgang.Scherer@gmx.de \
    --cc=dgutov@yandex.ru \
    /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://git.savannah.gnu.org/cgit/emacs.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).