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

Re: "git branch --contains x y" creates a branch instead of checking containment

From
Jeff King <peff@peff.net>
Date
Feb 21, 2013, 15:58 UTC
Message-ID
<20130221155827.GA20640@sigill.intra.peff.net>
In-Reply-To
<51261A6B.5020909@opera.com>
On Thu, Feb 21, 2013 at 02:00:27PM +0100, Per Cederqvist wrote:
Show 10 quoted lines
> That command does something completely different,
> though. The "--contains x" part is silently ignored,
> so it creates a branch named "y" pointing at HEAD.
> 
> Tested in git 1.8.1.1 and 1.8.1.4.
> 
> In my opinion, there are two ways to fix this:
> 
>  - change the "git branch" implementation so
>    that --contains implies --list.
I think that is the best option, too. In fact, I even wrote a patch. :)

It's d040350 (branch: let branch filters imply --list, 2013-01-31), and it's already in v1.8.2-rc0.

-Peff
Previous: Per CederqvistNext: Per Cederqvist
Message 2 of 4 in “"git branch --contains x y" creates a branch instead of checking containment”
  1. Per CederqvistFeb 21, 2013
  2. Jeff KingFeb 21, 2013
  3. Per CederqvistFeb 21, 2013
  4. Junio C HamanoFeb 21, 2013

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.