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

[PATCH] Document new "already-merged" rule for branch -d

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Apr 15, 2010, 07:25 UTC
Message-ID
<20100415072438.GA13394@progeny.tock>

v1.7.0-rc0~18^2 (branch -d: base the "already-merged" safety on the branch it merges with, 2009-12-29) taught ‘git branch’ a new heuristic for when it is safe to delete a branch without forcing the issue. It is safe to delete a branch "topic" without second thought if:

 - the branch "topic" is set up to pull from a (remote-tracking,
   usually) branch and is fully merged in that "upstream" branch, or
 - there is no branch.topic.merge configuration and branch "topic" is
   fully merged in the current HEAD.
Update the man page to acknowledge the new rules.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
I was looking in the documentation for a way to disable the new
behavior.  But that was the wrong idea --- better to see what it’s
like to get used to it first.
 Documentation/git-branch.txt |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt
index d78f4c7..1940256 100644
--- a/Documentation/git-branch.txt
+++ b/Documentation/git-branch.txt
@@ -63,7 +63,9 @@ way to clean up all obsolete remote-tracking branches.
 OPTIONS
 -------
 -d::
-	Delete a branch. The branch must be fully merged in HEAD.
+	Delete a branch. The branch must be fully merged in its
+	upstream branch, or in `HEAD` if no upstream was set with
+	`--track` or `--set-upstream`.
 
 -D::
 	Delete a branch irrespective of its merged status.
-- 
1.7.1.rc1
Message 1 of 1 in “Document new "already-merged" rule for branch -d”
  1. Document new "already-merged" rule for branch -dJonathan Nieder, Apr 15, 2010

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.