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

[PATCH v2 2/2] if a file has been staged we don't want to list it

From
David Cantrell via GitGitGadget <gitgitgadget@gmail.com>
Date
Mar 15, 2022, 00:52 UTC
Message-ID
<16aa4d0b2e4fdf4d807723a9aeb64ca7efb43233.1647305547.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.1227.v2.git.git.1647305547.gitgitgadget@gmail.com>
From: David Cantrell <david@cantrell.org.uk>

The previous use of --committable would include files that had been `git add`ed, but for which a simple `git restore filename` doesn't work. --modifed only lists those whose modifications have not been staged.

Signed-off-by: David Cantrell <david@cantrell.org.uk>
---
 contrib/completion/git-completion.bash | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 7ccad8ff4b1..10773a9fecd 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -2896,7 +2896,7 @@ _git_restore ()
 	esac
 
 	if __git rev-parse --verify --quiet HEAD >/dev/null; then
-		__git_complete_index_file "--committable"
+		__git_complete_index_file "--modified"
 	fi
 }
 
-- 
gitgitgadget
Previous: David Cantrell via GitGitGadgetNext: Bagas Sanjaya
Message 6 of 13 in “tab completion of filenames for 'git restore'”
  1. tab completion of filenames for 'git restore'David Cantrell via GitGitGadget, Mar 11, 2022
  2. Junio C HamanoMar 13, 2022
  3. David CantrellMar 14, 2022
  4. Junio C HamanoMar 15, 2022
  5. 0/2 Improved bash tab completion for 'git restore' - adds support for auto-completing filenamesDavid Cantrell via GitGitGadget, Mar 15, 2022
  6. 2/2 if a file has been staged we don't want to list itDavid Cantrell via GitGitGadget, Mar 15, 2022
  7. Bagas SanjayaMar 16, 2022
  8. 1/2 tab completion of filenames for 'git restore'David Cantrell via GitGitGadget, Mar 15, 2022
  9. Junio C HamanoMar 15, 2022
  10. Junio C HamanoMar 15, 2022
  11. tab completion of filenames for 'git restore'David Cantrell via GitGitGadget, Mar 15, 2022
  12. Junio C HamanoMar 16, 2022
  13. David CantrellMar 17, 2022

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.