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

[PATCH Illustration] branch --contains=<commit>

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 19, 2007, 08:04 UTC
Message-ID
<7vsl32oe48.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<7v4pfircka.fsf@gitster.siamese.dyndns.org>

This renames the --with=<commit> option to --contains=<commit>, but still supports the earlier --with=<commit> variant as a hidden synonym.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 * An example usage of the ".help = NULL" member in the options
   structure.
 builtin-branch.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/builtin-branch.c b/builtin-branch.c
index fd36e4f..5dc0c57 100644
--- a/builtin-branch.c
+++ b/builtin-branch.c
@@ -562,9 +562,12 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
 		OPT_BOOLEAN( 0 , "color",  &branch_use_color, "use colored output"),
 		OPT_SET_INT('r', NULL,     &kinds, "act on remote-tracking branches",
 			REF_REMOTE_BRANCH),
-		OPT_CALLBACK(0, "with",    &with_commit, "commit",
+		OPT_CALLBACK(0, "contains",&with_commit, "commit",
 			     "print only branches that contain the commit",
 			     opt_parse_with_commit),
+		OPT_CALLBACK(0, "with",    &with_commit, "commit",
+			     NULL,
+			     opt_parse_with_commit),
 		OPT__ABBREV(&abbrev),
 
 		OPT_GROUP("Specific git-branch actions:"),
-- 
1.5.3.6.1788.gcc5c4
Previous: Junio C HamanoNext: Pierre Habouzit
Message 2 of 3 in “parse-options: allow to define hidden synonym options”
  1. parse-options: allow to define hidden synonym optionsJunio C Hamano, Nov 19, 2007
  2. branch --contains=<commit>Junio C Hamano, Nov 19, 2007
  3. Pierre HabouzitNov 19, 2007

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.