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

[PATCH] git-branch.txt: compare --contains, --merged and --no-merged

From
LHLars Hjemli <hjemli@gmail.com>
Date
Apr 17, 2008, 22:27 UTC
Message-ID
<1208471228-26232-1-git-send-email-hjemli@gmail.com>
In-Reply-To
<7vzlrsmbqw.fsf@gitster.siamese.dyndns.org>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
---
Junio C Hamano wrote:
> You did not answer my question as to how --contains and --merged relate to
> each other.
Sorry, I deemed it to be rhetorical.
> I'll answer it myself (please add a documentation updates, as
> this would be confusing).
Something like this, maybe?
 Documentation/git-branch.txt |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt
index 95e9d0d..7e37497 100644
--- a/Documentation/git-branch.txt
+++ b/Documentation/git-branch.txt
@@ -120,6 +120,15 @@ OPTIONS
 --no-track::
 	Ignore the branch.autosetupmerge configuration variable.
 
+--contains <commit>::
+	Only list branches which contain the specified commit.
+
+--merged::
+	Only list branches which are fully contained by HEAD.
+
+--no-merged::
+	Do not list branches which are fully contained by HEAD.
+
 <branchname>::
 	The name of the branch to create or delete.
 	The new branch name must pass all checks defined by
@@ -177,6 +186,15 @@ If you are creating a branch that you want to immediately checkout, it's
 easier to use the git checkout command with its `-b` option to create
 a branch and check it out with a single command.
 
+The options `--contains`, `--merged` and `--no-merged` serves three related
+but different purposes:
+<1> `--contains <commit>` is used to find all branches which will need
+special attention if <commit> were to be rebased or amended, since those
+branches contain the specified <commit>.
+<2> `--merged` is used to find all branches which can be safely deleted,
+since those branches are fully contained by HEAD.
+<3> `--no-merged` is used to find branches which are candidates for merging
+into HEAD, since those branches are not fully contained by HEAD.
 
 Author
 ------
-- 
1.5.5.64.gb1a99
Previous: Junio C HamanoNext: Lars Hjemli
Message 7 of 8 in “git-branch: add support for --merged and --unmerged”
  1. git-branch: add support for --merged and --unmergedLars Hjemli, Apr 17, 2008
  2. bash: support branch's new '--merged' and '--unmerged' optionsSZEDER Gábor, Apr 17, 2008
  3. git-branch: add support for --merged and --no-mergedLars Hjemli, Apr 17, 2008
  4. Junio C HamanoApr 17, 2008
  5. git-branch: add support for --merged and --no-mergedLars Hjemli, Apr 17, 2008
  6. Junio C HamanoApr 17, 2008
  7. git-branch.txt: compare --contains, --merged and --no-mergedLars Hjemli, Apr 17, 2008
  8. Lars HjemliApr 17, 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.