unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Mickey Petersen <mickey@masteringemacs.org>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: 61038@debbugs.gnu.org
Subject: bug#61038: 30.0.50; `project-query-replace-regexp' also attempts search and replace in auto-save files
Date: Wed, 25 Jan 2023 20:34:07 +0000	[thread overview]
Message-ID: <87bkmmbb05.fsf@masteringemacs.org> (raw)
In-Reply-To: <eacfc1f6-9a00-79bf-5ff5-c7fd37ea5a2e@yandex.ru>


Dmitry Gutov <dgutov@yandex.ru> writes:

> On 25/01/2023 09:30, Mickey Petersen wrote:
>> Dmitry Gutov<dgutov@yandex.ru>  writes:
>>
>>> On 24/01/2023 12:37, Mickey Petersen wrote:
>>>> I think it'd be more useful if auto-save files (or even backup files)
>>>> were excluded from all the various `project-' commands that operate on
>>>> project files.
>>> I think that depends on the project backend.
>>>
>>> The default implementation uses grep-find-ignored-files (which include
>>> auto-save files, I think?).
>>>
>>> But the vc-aware backend ignores generally what the repository
>>> configuration tells it to ignore. Which would generally include
>>> auto-save files as well, but that depends on factors external to
>>> Emacs.
>>>
>>> What kind of backend were you trying this command with?
>> Default git backend. However, I'd charge that Emacs should know about
>> its own backup files (and not necessarily those of other Emacs
>> instances that may be running.)
>
> It's hard for me to say what is TRT here. If we explicitly ignore
> backups, does that mean we should add compiled objects files, etc,
> that is, everything from grep-find-ignored-files?
>
> But I have configured my backups to be saved inside ~/.emacs.d/
> directory, like a lot of people recommend. Via backup-directory-alist.
>
> If you don't do that, and you have them saved side-by-side inside Git
> repository, don't you usually add .gitignore rules for them then?
>
> So that they don't get in the way of other operations, outside of Emacs.

(Actually this issue also afflicts auto-save files in my Emacs.)

And the files in question are not committed to the index, nor are they
part of the git tree. So they're just stray files that happen to be
important (backup, auto save) to Emacs.

It seems odd that you'd want to search and replace those by default,
particularly when Emacs is well aware of the fact that they are indeed
backups or auto saves of other files used by that instance of Emacs.

And yes indeed: why not make the project replace mechanism ignore dumb
things no one wants to edit.

And committing large, binary files to a tree is common in a wide range
of situations, though less so in Git, as it's terrible at it.

So, yes, `grep-find-ignored-files' (or a project.el equivalent) should
indeed exist.





  reply	other threads:[~2023-01-25 20:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-24 10:37 bug#61038: 30.0.50; `project-query-replace-regexp' also attempts search and replace in auto-save files Mickey Petersen
2023-01-24 23:20 ` Dmitry Gutov
2023-01-25  7:30   ` Mickey Petersen
2023-01-25 15:29     ` Dmitry Gutov
2023-01-25 20:34       ` Mickey Petersen [this message]
2023-01-25 23:43         ` Dmitry Gutov
2023-01-26  9:13           ` Mickey Petersen
2023-01-26 15:50             ` Dmitry Gutov

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=87bkmmbb05.fsf@masteringemacs.org \
    --to=mickey@masteringemacs.org \
    --cc=61038@debbugs.gnu.org \
    --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).