git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Nika Layzell via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Nika Layzell <nika@thelayzells.com>,
	Junio C Hamano <gitster@pobox.com>,
	Nika Layzell <nika@thelayzells.com>
Subject: [PATCH 1/1] add--interactive: skip index refresh in reset patch mode
Date: Sat, 23 Nov 2019 19:56:40 +0000	[thread overview]
Message-ID: <68f3be6ca65b3904bd4664b743fccbe1ac4e7d22.1574539001.git.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.475.git.1574539001.gitgitgadget@gmail.com>

From: Nika Layzell <nika@thelayzells.com>

Uses the FILTER flag on patch flavours in git-add--interactive to
determine if the initial index refresh call is required. It is not
required for the reset patch modes, which use the 'index-only' filter,
as they do not interact with the worktree, so do not need up-to-date
stat information.

The refresh call can be quite expensive, especially on larger
checkouts or with a freshly created index file.

Signed-off-by: Nika Layzell <nika@thelayzells.com>
---
 git-add--interactive.perl | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/git-add--interactive.perl b/git-add--interactive.perl
index c20ae9e210..cd435b197f 100755
--- a/git-add--interactive.perl
+++ b/git-add--interactive.perl
@@ -1861,7 +1861,9 @@ sub main_loop {
 }
 
 process_args();
-refresh();
+if ($patch_mode_flavour{FILTER} ne 'index-only') {
+	refresh();
+}
 if ($patch_mode_only) {
 	patch_update_cmd();
 }
-- 
gitgitgadget

  reply	other threads:[~2019-11-23 19:56 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-23 19:56 [PATCH 0/1] add--interactive: skip index refresh in reset patch mode Nika Layzell via GitGitGadget
2019-11-23 19:56 ` Nika Layzell via GitGitGadget [this message]
2019-11-24  6:01 ` Junio C Hamano
2019-11-25 14:24   ` Johannes Schindelin
2019-11-25 14:45     ` Johannes Schindelin
2019-11-26  1:13       ` Junio C Hamano
2021-01-07 14:18         ` Cc'ing the Git maintainer on GitGitGadget contributions, was " Johannes Schindelin
2021-01-07 14:57           ` Ævar Arnfjörð Bjarmason
2021-01-07 16:20             ` Johannes Schindelin
2021-01-07 21:25               ` Junio C Hamano
2021-01-08 14:56                 ` Johannes Schindelin
2021-01-08 19:48                   ` Junio C Hamano
2021-01-10 12:02                     ` Johannes Schindelin
2021-01-08 20:08                   ` Taylor Blau
2021-01-10 12:21                     ` Johannes Schindelin
2021-01-10 20:18                       ` Junio C Hamano
2021-01-11 19:18                         ` Taylor Blau
2021-01-12 23:22                           ` Junio C Hamano
2021-01-14  6:32                         ` 胡哲宁
2019-11-26  1:12     ` Junio C Hamano

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: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=68f3be6ca65b3904bd4664b743fccbe1ac4e7d22.1574539001.git.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=nika@thelayzells.com \
    /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://80x24.org/mirrors/git.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).