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

[PATCH 2/2] git-gui: don't warn for detached head when rebasing

From
Bert Wesarg <bert.wesarg@googlemail.com>
Date
Oct 22, 2011, 19:39 UTC
Message-ID
<a9a6eb9e70a8d4a75f2061a51bf401469d1b0b7f.1319312280.git.bert.wesarg@googlemail.com>
In-Reply-To
<0f4995b5df707782c73ec83171fb2f512ae887ef.1319312280.git.bert.wesarg@googlemail.com>
Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
---
 lib/commit.tcl |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/lib/commit.tcl b/lib/commit.tcl
index e27e148..d679db4 100644
--- a/lib/commit.tcl
+++ b/lib/commit.tcl
@@ -263,7 +263,9 @@ proc commit_commitmsg {curHEAD msg_p} {
 	global is_detached repo_config
 	global pch_error
 
-	if {$is_detached && [is_config_true gui.warndetachedcommit]} {
+	if {$is_detached
+	    && ![file exists [gitdir [file join rebase-merge head-name]]]
+	    && 	[is_config_true gui.warndetachedcommit]} {
 		set msg [mc "You are about to commit on a detached head.\
 This is a potentially dangerous thing to do because if you switch\
 to another branch you will loose your changes and it can be difficult\
-- 
1.7.7.908.g383b5
Previous: Bert WesargNext: Bert Wesarg
Message 2 of 4 in “git-gui: make config gui.warndetachedcommit a boolean”
  1. 1/2 git-gui: make config gui.warndetachedcommit a booleanBert Wesarg, Oct 22, 2011
  2. 2/2 git-gui: don't warn for detached head when rebasingBert Wesarg, Oct 22, 2011
  3. Bert WesargNov 3, 2011
  4. Pat ThoytsNov 5, 2011

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.