From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#61038: 30.0.50; `project-query-replace-regexp' also attempts search and replace in auto-save files Date: Thu, 26 Jan 2023 17:50:29 +0200 Message-ID: <40efee33-4142-90ac-b7b4-7ea19dd688ee@yandex.ru> References: <87y1psw747.fsf@masteringemacs.org> <878rhrvzof.fsf@masteringemacs.org> <87bkmmbb05.fsf@masteringemacs.org> <877cx9bqd8.fsf@masteringemacs.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13295"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Cc: 61038@debbugs.gnu.org To: Mickey Petersen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 26 16:51:20 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pL4X1-0003IT-MJ for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 26 Jan 2023 16:51:19 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pL4Wn-0000IE-6B; Thu, 26 Jan 2023 10:51:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pL4Wl-0000Hg-Cd for bug-gnu-emacs@gnu.org; Thu, 26 Jan 2023 10:51:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pL4Wl-0003zG-1v for bug-gnu-emacs@gnu.org; Thu, 26 Jan 2023 10:51:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pL4Wk-0001CB-Iy for bug-gnu-emacs@gnu.org; Thu, 26 Jan 2023 10:51:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 26 Jan 2023 15:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61038 X-GNU-PR-Package: emacs Original-Received: via spool by 61038-submit@debbugs.gnu.org id=B61038.16747482404565 (code B ref 61038); Thu, 26 Jan 2023 15:51:02 +0000 Original-Received: (at 61038) by debbugs.gnu.org; 26 Jan 2023 15:50:40 +0000 Original-Received: from localhost ([127.0.0.1]:35935 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pL4WN-0001BZ-Ve for submit@debbugs.gnu.org; Thu, 26 Jan 2023 10:50:40 -0500 Original-Received: from mail-ej1-f49.google.com ([209.85.218.49]:44991) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pL4WL-0001BM-OD for 61038@debbugs.gnu.org; Thu, 26 Jan 2023 10:50:38 -0500 Original-Received: by mail-ej1-f49.google.com with SMTP id ss4so6136206ejb.11 for <61038@debbugs.gnu.org>; Thu, 26 Jan 2023 07:50:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=4DiFfFwmkSKigDegkvx9rtHegADBXxMvdoAYjLGgS54=; b=AWi4evk8APgHC41XzkUgxCnk6mRYNm7e4nx+gnZFumbfWcsPwRKPd4BkHdl3hcgUou zE5dbIYps1cTUm36JRfFitfoyGE3VsoB6fsdHZNGq7tibDoeUfuy6q0nAAAC1MNc/c5q SrO0z3LltKd6jA8096moFhn41SljSDVy34CVoQDpI0mjAhCIN7HsihoFNdXFjpW+QJAo btV6cHv4loEoR734y9uZWgq0x2e4U0Ui6cPS8S/0BH4ZqgCbRg45SMUPceS72T03IIV1 g7An4EozIzIy6010WuorJrXtBEwDl8D87onneymCBg0WargEKRaUS3fhSr3kUou13a3P GnoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=4DiFfFwmkSKigDegkvx9rtHegADBXxMvdoAYjLGgS54=; b=uLE+DdXVS/PYnZPBJ/dSloMW198A8SOwP2+w+yWLxTkSLUECq723rGl4QYGUZzEjvV IlCUwKFo1lYADDBobVcu708XLhZRZM5sXhBtoJFqbuFJmXUBQpG5mZ9x6KB2ODdVi3T5 Df+z4X8wOV5EzuZ+mPRY0eN/TEUFXQJ00VnKo1pshtB03jcGPf37WL5mvqNB4vePTPsc XO6Vvd3LxfAm/o+1dbas2TTqkXMS43lkFCW+IFj78rtROnFFCC4Rcy5oUCNCkUKLOtx5 PeuMkoDL+tJ/9xuZR+1e+0dDscDqKTcopm7nSVsdbGzbz/S8X+YdXLTeOKhlDqKlXAmL T8hA== X-Gm-Message-State: AFqh2kr/TdPcZZ4JoXvYFZqGRWU4eMwvG0zm++5TSt4mWPORg6x0DuwB DHveofP6hcDzpmuR0IEE4ulEsM4fpCA= X-Google-Smtp-Source: AMrXdXuM4fPlGs/nZuqQ9QbqbExmEbDkGwDzlpyem74cY3dlfhDiy0WmxofE5A5rEMhL6hXFQz8ItA== X-Received: by 2002:a17:906:ce23:b0:85a:4230:6743 with SMTP id sd3-20020a170906ce2300b0085a42306743mr36857055ejb.23.1674748231505; Thu, 26 Jan 2023 07:50:31 -0800 (PST) Original-Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id sb25-20020a1709076d9900b0086faa5b06d4sm747912ejc.181.2023.01.26.07.50.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 26 Jan 2023 07:50:30 -0800 (PST) Content-Language: en-US In-Reply-To: <877cx9bqd8.fsf@masteringemacs.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:254212 Archived-At: On 26/01/2023 11:13, Mickey Petersen wrote: > > Dmitry Gutov writes: > >> On 25/01/2023 22:34, Mickey Petersen wrote: >> >>> (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. >> >> I'm asking why they are not in your .gitignore already. They must get >> in the way of operations such as 'git status', or 'git add *', or 'git >> commit -a', or just in the way of shell completion for 'git add ...'. >> > > Let's assume I'm simplifying a more complex workflow to aid with the > bug report. Okay. > There are many legitimate reasons for having binary files -- large > ones too -- in a repository. Though it's uncommon with git, as it does > a poor job handling them. > > There are also legitimate reasons for not having expansive ignore > files, particularly with version control systems that lack the > granularity of Git and its ilk. > > Nevertheless, knowing that untracked are also considered part of the > project, I can now set `project-vc-include-untracked' to nil to at > least resolve this. It would seem I was not the only one who chafed at > this edge case. You can also customize project-vc-ignores to fine-tune which additional file to skip specifically (whether tracked or not). But if "skip untracked" suits your mental model well, even better (it also increases file listing's performance). As a default behavior, though, I think it's problematic because one might work for a significant amount of time on a bunch of new files before committing them. Depends on a workflow. >>> So, yes, `grep-find-ignored-files' (or a project.el equivalent) should >>> indeed exist. >> >> grep-find-ignored-files is a real user option already. You can also >> use project-vc-ignores, but it's nil by default. >> >> A couple of reasons not to use grep-find-ignored-files patterns by default: >> >> - Some users might be actually looking for one of those files, and >> would get surprised that while the Git repository lists them fine >> (perhaps they even checked in such file; maybe they're using unusual >> file naming schemes), but our project backend does not. >> >> - Every addition to the ignored patterns is a minor but steady >> performance hit. grep-find-ignored-files has 61 element by >> default. Dropping all of those into project--vc-list-files can >> create a performance hit of an order of a magnitude. E.g. in my >> testing the time to list the files in gecko-dev went up from 1s to >> about 5s. > > Sure. But `git-grep(1)' will ignore binary files by default, for example. Hmm, I think in our case the step which will ignore the binary files is the search program. So (project-files) will include them in the listing, but both Grep and Ripgrep will skip them during the search.