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

[PATCH] bash: use __gitdir when completing 'git rebase' options

From
SZEDER Gábor <szeder@ira.uka.de>
Date
Mar 6, 2008, 21:37 UTC
Message-ID
<1204839456-23566-1-git-send-email-szeder@ira.uka.de>

When doing completion of rebase options in a subdirectory of the work tree during an ongoing rebase, wrong options were offered because of the hardcoded .git/.dotest-merge path.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
---
 contrib/completion/git-completion.bash |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 49e6df0..aee9125 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -828,8 +828,8 @@ _git_push ()
 
 _git_rebase ()
 {
-	local cur="${COMP_WORDS[COMP_CWORD]}"
-	if [ -d .dotest ] || [ -d .git/.dotest-merge ]; then
+	local cur="${COMP_WORDS[COMP_CWORD]}" dir="$(__gitdir)"
+	if [ -d .dotest ] || [ -d "$dir"/.dotest-merge ]; then
 		__gitcomp "--continue --skip --abort"
 		return
 	fi
-- 
1.5.4.3
Message 1 of 1 in “bash: use __gitdir when completing 'git rebase' options”
  1. bash: use __gitdir when completing 'git rebase' optionsSZEDER Gábor, Mar 6, 2008

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.