From: Scott Schmit <i.grok@comcast.net>
To: Michael J Gruber <git@drmicha.warpmail.net>
Cc: Alexander Kuleshov <kuleshovmail@gmail.com>,
Junio C Hamano <gitster@pobox.com>,
git@vger.kernel.org
Subject: Re: [PATCH] branch: add support for --dry-run option
Date: Wed, 21 Jan 2015 20:37:23 -0500 [thread overview]
Message-ID: <20150122013723.GA3795@odin.ulthar.us> (raw)
In-Reply-To: <54BD12C3.5050802@drmicha.warpmail.net>
[-- Attachment #1: Type: text/plain, Size: 1466 bytes --]
On Mon, Jan 19, 2015 at 03:20:51PM +0100, Michael J Gruber wrote:
> Alexander Kuleshov schrieb am 17.01.2015 um 08:35:
> > This patch adds support -d/--dry-run option for branch(es) deletion.
> > If -d/--dry-run option passed to git branch -d branch..., branch(es)
> > will not be removed, instead just print list of branches that are
> > to be removed.
> >
> > For example:
> >
> > $ git branch
> > a
> > b
> > c
> > * master
> >
> > $ git branch -d -n a b c
> > delete branch 'a' (261c0d1)
> > delete branch 'b' (261c0d1)
> > delete branch 'c' (261c0d1)
>
> Is there a case where deleting "a b c" would not delete "a b c"?
Sure:
$ cd /tmp/
$ git init foo
Initialized empty Git repository in /tmp/foo/.git/
$ cd foo/
$ touch .gitignore
$ git add .gitignore
$ git commit -m init
[master (root-commit) fde5138] init
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 .gitignore
$ git checkout -b a
Switched to a new branch 'a'
$ git branch -d a
error: Cannot delete the branch 'a' which you are currently on.
$ touch file
$ git add file
$ git commit -m 'add file'
[a e2c2ece] add file
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 file
$ git checkout -b b master
Switched to a new branch 'b'
$ git branch -d a
error: The branch 'a' is not fully merged.
If you are sure you want to delete it, run 'git branch -D a'.
--
Scott Schmit
[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 3891 bytes --]
next prev parent reply other threads:[~2015-01-22 1:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-17 7:35 [PATCH] branch: add support for --dry-run option Alexander Kuleshov
2015-01-17 12:18 ` Philip Oakley
2015-01-19 14:20 ` Michael J Gruber
2015-01-22 1:37 ` Scott Schmit [this message]
2015-01-22 10:17 ` Michael J Gruber
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=20150122013723.GA3795@odin.ulthar.us \
--to=i.grok@comcast.net \
--cc=git@drmicha.warpmail.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=kuleshovmail@gmail.com \
/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).