From: Peter Wu <lekensteyn@gmail.com>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 2/2] branch: let branch filters imply --list
Date: Thu, 31 Jan 2013 17:13:15 +0100 [thread overview]
Message-ID: <1504250.y8BAS4sG2O@al> (raw)
In-Reply-To: <20130131064611.GB25315@sigill.intra.peff.net>
On Thursday 31 January 2013 01:46:11 Jeff King wrote:
> Currently, a branch filter like `--contains`, `--merged`, or
> `--no-merged` is ignored when we are not in listing mode.
> For example:
>
> git branch --contains=foo bar
>
> will create the branch "bar" from the current HEAD, ignoring
> the `--contains` argument entirely. This is not very
> helpful. There are two reasonable behaviors for git here:
>
> 1. Flag an error; the arguments do not make sense.
>
> 2. Implicitly go into `--list` mode
>
> This patch chooses the latter, as it is more convenient, and
> there should not be any ambiguity with attempting to create
> a branch; using `--contains` and not wanting to list is
> nonsensical.
>
> That leaves the case where an explicit modification option
> like `-d` is given. We already catch the case where
> `--list` is given alongside `-d` and flag an error. With
> this patch, we will also catch the use of `--contains` and
> other filter options alongside `-d`.
>
> Signed-off-by: Jeff King <peff@peff.net>
Tested-by: Peter Wu <lekensteyn@gmail.com>
I have tested this patch on top of 1.8.1.2 and it seems to work.
One note, the following command spits out master without complaining about the
non-existing branch name:
git branch --contains <id> master <non-existant branch name>
(the order of branches doesn't affect the result.)
Regards,
Peter
next prev parent reply other threads:[~2013-01-31 16:21 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-30 18:57 [BUG] `git branch --contains ID name` creates branch "name" Peter Wu
2013-01-31 6:43 ` [PATCH 0/2] improve "git branch --contains=<commit> <pattern>" Jeff King
2013-01-31 6:45 ` [PATCH 1/2] docs: clarify git-branch --list behavior Jeff King
2013-02-01 0:20 ` Eric Sunshine
2013-02-01 0:37 ` Junio C Hamano
2013-02-01 5:06 ` Jeff King
2013-02-01 5:42 ` Junio C Hamano
2013-01-31 6:46 ` [PATCH 2/2] branch: let branch filters imply --list Jeff King
2013-01-31 16:13 ` Peter Wu [this message]
2013-01-31 17:02 ` Junio C Hamano
2013-01-31 15:53 ` [PATCH 0/2] improve "git branch --contains=<commit> <pattern>" Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1504250.y8BAS4sG2O@al \
--to=lekensteyn@gmail.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).