git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/1] add--interactive: skip index refresh in reset patch mode

From
Nika Layzell via GitGitGadget <gitgitgadget@gmail.com>
Date
Nov 23, 2019, 19:56 UTC
Message-ID
<68f3be6ca65b3904bd4664b743fccbe1ac4e7d22.1574539001.git.gitgitgadget@gmail.com>
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
Previous: Nika Layzell via GitGitGadgetNext: Junio C Hamano
Message 2 of 20 in “add--interactive: skip index refresh in reset patch mode”
  1. 0/1 add--interactive: skip index refresh in reset patch modeNika Layzell via GitGitGadget, Nov 23, 2019
  2. 1/1 add--interactive: skip index refresh in reset patch modeNika Layzell via GitGitGadget, Nov 23, 2019
  3. Junio C HamanoNov 24, 2019
  4. Johannes SchindelinNov 25, 2019
  5. Johannes SchindelinNov 25, 2019
  6. Junio C HamanoNov 26, 2019
  7. Cc'ing the Git maintainer on GitGitGadget contributions, was Re: [PATCH 0/1] add--interactive: skip index refresh in reset patch modeJohannes Schindelin, Jan 7, 2021
  8. Ævar Arnfjörð BjarmasonJan 7, 2021
  9. Johannes SchindelinJan 7, 2021
  10. Junio C HamanoJan 7, 2021
  11. Johannes SchindelinJan 8, 2021
  12. Junio C HamanoJan 8, 2021
  13. Johannes SchindelinJan 10, 2021
  14. Taylor BlauJan 8, 2021
  15. Johannes SchindelinJan 10, 2021
  16. Junio C HamanoJan 10, 2021
  17. Taylor BlauJan 11, 2021
  18. Junio C HamanoJan 12, 2021
  19. 胡哲宁Jan 14, 2021
  20. Junio C HamanoNov 26, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.