From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Peter Seibel Newsgroups: gmane.emacs.bugs Subject: bug#75336: [PATCH] Allow pcomplete of git add to include untracked files. Date: Sat, 4 Jan 2025 07:52:07 -0800 Message-ID: References: <86frlzf1zo.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="0000000000005bd1ff062ae361c5" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2054"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , Augusto Stoffel , 75336@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 04 16:53:34 2025 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 1tU6Sz-0000Re-3H for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 04 Jan 2025 16:53:33 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tU6SX-0000JB-2A; Sat, 04 Jan 2025 10:53: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 1tU6SU-0000Ig-Lz for bug-gnu-emacs@gnu.org; Sat, 04 Jan 2025 10:53:02 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tU6SU-0003Vy-E0 for bug-gnu-emacs@gnu.org; Sat, 04 Jan 2025 10:53:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:From:In-Reply-To:References:MIME-Version:To:Subject; bh=yDbgah8YiHUA4KdYcW+6xuClfJM/FdG+9rgjbFYAigc=; b=b2puwNJC6zp3LrBWTtc7f/nqC7Wy8wSsRkjDV8bMWZ2+i3Yt7Jr2VChYm0IvN/pJ2aB1AA9947gk4lHY3V99uRg3ptbFrp7XcF6eV/yFnb6hu18Y93faDAg4Um3hBY/6wWj/u6OhIrcnSXCpjRZXKTY6vuxluD9uwVUqdBrBAmMg8ifFQK+of/RTfId58auWyey2XJYOpHQf8qtEwSigQw7H6UkmWWoahf80D6GyxQnsgX2rKLO4h7BtRSMHWsKTQLL0amhcDAXnx+U8F/xzGHmzmAwhE12zigwbJgSwKF8EE2j2exBiH9aTlW31EE5TXn4ld4tlGQQEbdrVMM0Zuw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tU6SU-0007LZ-74 for bug-gnu-emacs@gnu.org; Sat, 04 Jan 2025 10:53:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Peter Seibel Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 04 Jan 2025 15:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 75336 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 75336-submit@debbugs.gnu.org id=B75336.173600594428194 (code B ref 75336); Sat, 04 Jan 2025 15:53:02 +0000 Original-Received: (at 75336) by debbugs.gnu.org; 4 Jan 2025 15:52:24 +0000 Original-Received: from localhost ([127.0.0.1]:56764 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tU6Rs-0007Kf-0d for submit@debbugs.gnu.org; Sat, 04 Jan 2025 10:52:24 -0500 Original-Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]:40291) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tU6Rp-0007KT-Hs for 75336@debbugs.gnu.org; Sat, 04 Jan 2025 10:52:22 -0500 Original-Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-aa6b7f3c6edso164503966b.1 for <75336@debbugs.gnu.org>; Sat, 04 Jan 2025 07:52:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail-com.20230601.gappssmtp.com; s=20230601; t=1736005940; x=1736610740; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=aDxfHIY9syXSyP6k5iGDM+Y8nAqY9Z9/qm1mKF0c7nw=; b=miiEOzkUJ4C+c5D+NXPX1rjZE0XSe1VQV/PNUENoQTUdLMmN+xvC6b43YrNNMQyfmz WVzSgSYfOKm+2jBDvjbPlvncK0NgzCFXb5fYrECPVRFxAYlot3BQ1l8BeuAU/giNegt4 en/SJvcY5XI9Mz1hAKrzDlc308NrxGyL3ClfEXEnHYfmN9+L6LVb7T/lBfwW3wetQnrl DKOA7Ml03NV06B2iCiTF3C4lRwrRGnlTRixhPLh9i/oX2WgPCdvhQ2m6sgTC1e5FEp2f 7RcW7PTMOo5yucDGIqygARBsGQyx2stiKccBFWo+XPtb/ciWDPq8D2UltXObHOnBxGyX KGHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736005940; x=1736610740; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=aDxfHIY9syXSyP6k5iGDM+Y8nAqY9Z9/qm1mKF0c7nw=; b=jwcsUZwrbP2QUWr3yNo6w2Jw5vm5V+6TGkCcg8gJXCyq0u68xNdJS5fLYsISjCnYpZ 8dZQTDmt/EMG6TJXHgFABOp3K0VcF7t5un/BBeo6wccGeSRF0agcEHnxGYBPCj7d/xXd 6CeTtPVqjGmnj8ikW0bDgyycpqdAIqdOKtwhQyZXZcUq3Abui+VR8ue/Z2XZctu1CSJ/ Ov64uXpCCHb2AVAPPBMo9YTFGkkGRji7NJxzMUunjOiBAM++UOMFesdpjb4D5JxX3f6z Vtw69TMdOCe54zdCMML/NnRrjyaYX41qd1ZXr0SwAtCJ5+N2WJaJsPgfv56l0Q4HT7UH 5SGQ== X-Forwarded-Encrypted: i=1; AJvYcCX9iOpHCkDwRFgH9hTmypa06NL+KaMCGR39kEXqltp1utBjd36n1pqk9wl7iUGGOpkCjzZ1Dg==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yx42zxwAW9MxCwlDswA8XvUpQV/KY9lugOPc+RNL49Ru3WwD2Qk NvDfi1nbpQHgz9T0/SbCcecMOQXmkCLCBlX+OcBr7woo2J19FaIFGRNKYxoVCAv8jAu0xlrgtuH b6yQd642Jrz6C7FXHmXYIhwovh7b0ATfw X-Gm-Gg: ASbGncuZ+JyliJsqQtgvGr32Gczslcp60UA4aoTe2FpJZsVBxfnN/ujVDZyhyTGEwOG hKUbPQv5vzBMP2C6WQZwn6xQljUFo024brhQ0 X-Google-Smtp-Source: AGHT+IHX1l/CNKIx+hHKJuIis4zR+P/Bypq9Lx/mK9SsGQS0RPSwUiGLTycuWTvSASzlKcVp/xJ2G9BR9F+nZMny6z0= X-Received: by 2002:a17:906:7951:b0:aa5:a36c:88f0 with SMTP id a640c23a62f3a-aac3378e312mr1526169766b.12.1736005939597; Sat, 04 Jan 2025 07:52:19 -0800 (PST) In-Reply-To: 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:298425 Archived-At: --0000000000005bd1ff062ae361c5 Content-Type: multipart/alternative; boundary="0000000000005bd1fd062ae361c3" --0000000000005bd1fd062ae361c3 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Okay, here's an updated patch to also complete ignored files when -f or --force is specified. If you want I can rebase and make a single patch. On Sat, Jan 4, 2025 at 7:04=E2=80=AFAM Stefan Monnier wrote: > >> > I was going a bit crazy trying to figure out why tab completion in > >> > *shell* wasn't working for git add when I was trying to add a new > >> > file to my repo. Turns out pcomplete was only completing modified > >> > tracked files. This patch changes it so after git add it also > >> > completes untracked non-ignored files. > >> Augusto and Stefan, any comments? > > The (new) patch looks good to me. > > FWIW, it also makes sense occasionally to `git add` ignored files > (e.g. we could want to track a `.elc` file in the test suite inside the > Emacs repository to check how we handle specific old-format `.elc` > files). > > > Stefan > > --=20 Peter Seibel http://www.gigamonkeys.com/ --0000000000005bd1fd062ae361c3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Okay, here's an updated patch to also complete ignored= files when -f or --force is specified.

If you want I ca= n rebase and make a single patch.

On Sat, Jan 4,= 2025 at 7:04=E2=80=AFAM Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>> > I was going a bit crazy = trying to figure out why tab completion in
>> > *shell* wasn't working for git add when I was trying to a= dd a new
>> > file to my repo.=C2=A0 Turns out pcomplete was only completin= g modified
>> > tracked files.=C2=A0 This patch changes it so after git add i= t also
>> > completes untracked non-ignored files.
>> Augusto and Stefan, any comments?

The (new) patch looks good to me.

FWIW, it also makes sense occasionally to `git add` ignored files
(e.g. we could want to track a `.elc` file in the test suite inside the
Emacs repository to check how we handle specific old-format `.elc`
files).


=C2=A0 =C2=A0 =C2=A0 =C2=A0 Stefan



--
--0000000000005bd1fd062ae361c3-- --0000000000005bd1ff062ae361c5 Content-Type: application/octet-stream; name="0003-Complete-ignored-files-when-force-specified-in-git-a.patch" Content-Disposition: attachment; filename="0003-Complete-ignored-files-when-force-specified-in-git-a.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_m5iczlm50 RnJvbSBlYzU1NTU2NTA1YTQ3ZmY2MWQzOGQ2YzhiYzVlNTg5YjAyZGVmODg0IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBQZXRlciBTZWliZWwgPHBldGVyQGdpZ2Ftb25rZXlzLmNvbT4K RGF0ZTogU2F0LCA0IEphbiAyMDI1IDA3OjQ4OjA5IC0wODAwClN1YmplY3Q6IFtQQVRDSCAzLzNd IENvbXBsZXRlIGlnbm9yZWQgZmlsZXMgd2hlbiBmb3JjZSBzcGVjaWZpZWQgaW4gZ2l0IGFkZC4K Ci0tLQogbGlzcC9wY21wbC1naXQuZWwgfCA5ICsrKysrKystLQogMSBmaWxlIGNoYW5nZWQsIDcg aW5zZXJ0aW9ucygrKSwgMiBkZWxldGlvbnMoLSkKCmRpZmYgLS1naXQgYS9saXNwL3BjbXBsLWdp dC5lbCBiL2xpc3AvcGNtcGwtZ2l0LmVsCmluZGV4IGFiNWUzMzA1ODY1Li5mMjMwMDJkZjI4YiAx MDA2NDQKLS0tIGEvbGlzcC9wY21wbC1naXQuZWwKKysrIGIvbGlzcC9wY21wbC1naXQuZWwKQEAg LTgyLDExICs4MiwxNiBAQCBGaWxlcyBsaXN0ZWQgYnkgYGdpdCBscy1maWxlcyBBUkdTJyBzYXRp c2Z5IHRoZSBwcmVkaWNhdGUuIgogICAgICAgICAgICAgICAgICAgKHBjb21wbGV0ZS1mcm9tLWhl bHAgYCgsdmMtZ2l0LXByb2dyYW0gImhlbHAiICxzdWJjbWQpCiAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6YXJndW1lbnQKICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICItK1xcKD86XFxbbm8tXFxdXFwpP1thLXotXSs9PyIpKSkpCi0gICAgICAg ICAgICAgICA7OyBDb21wbGV0ZSBtb2RpZmllZCB0cmFja2VkIGZpbGVzIGFuZCB1bnRyYWNrZWQg ZmlsZXMKKyAgICAgICAgICAgICAgIDs7IENvbXBsZXRlIG1vZGlmaWVkIHRyYWNrZWQgZmlsZXMg YW5kIHVudHJhY2tlZCBmaWxlcyBhbmQKKyAgICAgICAgICAgICAgIDs7IGlnbm9yZWQgZmlsZXMg aWYgLWYgb3IgLS1mb3JjZSBpcyBzcGVjaWZpZWQuCiAgICAgICAgICAgICAgICAoImFkZCIKICAg ICAgICAgICAgICAgICAocGNvbXBsZXRlLWhlcmUKICAgICAgICAgICAgICAgICAgKHBjb21wbGV0 ZS1lbnRyaWVzCi0gICAgICAgICAgICAgICAgICBuaWwgKHBjbXBsLWdpdC0tdHJhY2tlZC1maWxl LXByZWRpY2F0ZSAiLW8iICItLWV4Y2x1ZGUtc3RhbmRhcmQiICItbSIpKSkpCisgICAgICAgICAg ICAgICAgICBuaWwKKyAgICAgICAgICAgICAgICAgIChsZXQgKChmbGFncyAobGlzdCAiLW8iICIt bSIpKSkKKyAgICAgICAgICAgICAgICAgICAgKHVubGVzcyAob3IgKG1lbWJlciAiLWYiIHBjb21w bGV0ZS1hcmdzKSAobWVtYmVyICItLWZvcmNlIiBwY29tcGxldGUtYXJncykpCisgICAgICAgICAg ICAgICAgICAgICAgKHB1c2ggIi0tZXhjbHVkZS1zdGFuZGFyZCIgZmxhZ3MpKQorICAgICAgICAg ICAgICAgICAgICAoYXBwbHkgIydwY21wbC1naXQtLXRyYWNrZWQtZmlsZS1wcmVkaWNhdGUgZmxh Z3MpKSkpKQogICAgICAgICAgICAgICAgOzsgQ29tcGxldGUgbW9kaWZpZWQgdHJhY2tlZCBmaWxl cwogICAgICAgICAgICAgICAgKChvciAiY29tbWl0IiAicmVzdG9yZSIpCiAgICAgICAgICAgICAg ICAgKHBjb21wbGV0ZS1oZXJlCi0tIAoyLjQ3LjEKCg== --0000000000005bd1ff062ae361c5--