git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Taylor Blau <me@ttaylorr.com>
To: Ivan Tham <pickfire@riseup.net>
Cc: Taylor Blau <me@ttaylorr.com>,
	git@vger.kernel.org,
	"brian m . carlson" <sandals@crustytoothpaste.net>
Subject: Re: [PATCH] branch: add '-' to delete previous branch
Date: Thu, 30 Apr 2020 09:59:04 -0600	[thread overview]
Message-ID: <20200430155904.GA30682@syl.local> (raw)
In-Reply-To: <20200430145221.z3lpgjstybqztfqb@arch>

Hi Ivan,

On Thu, Apr 30, 2020 at 10:52:21PM +0800, Ivan Tham wrote:
> On Wed, Apr 29, 2020 at 12:58:51PM -0600, Taylor Blau wrote:
> > On Wed, Apr 29, 2020 at 09:01:33PM +0800, Ivan Tham wrote:
> > > Add support to delete previous branch from git checkout/switch to have
> > > feature parity with git switch -.
> > >
> > > Signed-off-by: Ivan Tham <pickfire@riseup.net>
> > > ---
> > >  Documentation/git-branch.txt | 10 ++++++++++
> > >  builtin/branch.c             |  6 +++++-
> > >  t/t3200-branch.sh            |  7 +++++++
> > >  3 files changed, 22 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt
> > > index 135206ff4a..37e7cbbc52 100644
> > > --- a/Documentation/git-branch.txt
> > > +++ b/Documentation/git-branch.txt
> > > @@ -265,6 +265,10 @@ start-point is either a local or remote-tracking branch.
> > >  	The new branch name must pass all checks defined by
> > >  	linkgit:git-check-ref-format[1].  Some of these checks
> > >  	may restrict the characters allowed in a branch name.
> > > ++
> > > +You can use the `@{-N}` syntax to refer to the N-th last branch checked out
> > > +using "git checkout" operation. You may also specify `-` which is synonymous to
> > > +`@{-1}`.
> >
> > Interesting; we're already using strbuf_branchname, so the first part of
> > this documentation was true even before this commit. Would you consider
> > splitting this into two patches?
> >
> > The first should include the first sentence of this documentation, an
> > additional test in t3200 exercising an explicit 'git branch -D @{-N}'
> > for some 'N', but no changes in builtin/branch.c. The second patch would
> > then make '-' a synonym for '@{-1}'.
>
> Is not this already true? Why do we need to split it? Currently using
> '@{-N}' to delete branch already works.

It is the case that 'git branch -D @{-N}' already works, which was
surprising to me. I am suggesting that you make documenting the existent
behavior a new first patch.

Of course, that might be the only patch that you end up sending in v2,
since it seems that consensus has formed around not supposing '-' as a
shorthand for '@{-1}' with 'git branch -D'.

Thanks,
Taylor

  reply	other threads:[~2020-04-30 15:59 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-29 13:01 [PATCH] branch: add '-' to delete previous branch Ivan Tham
2020-04-29 13:37 ` Sergey Organov
2020-04-29 19:00   ` Taylor Blau
2020-04-29 19:06     ` Eric Sunshine
2020-04-29 19:50     ` Sergey Organov
2020-04-29 19:57       ` Taylor Blau
2020-04-29 20:22         ` Junio C Hamano
2020-04-29 20:35           ` Taylor Blau
2020-04-29 20:39             ` Junio C Hamano
2020-04-29 20:37           ` Junio C Hamano
2020-04-29 20:26         ` Sergey Organov
2020-04-30 16:27           ` Konstantin Khomoutov
2020-04-30 19:52             ` Junio C Hamano
2020-05-01  9:18               ` Sergey Organov
2020-05-01  9:44                 ` Konstantin Khomoutov
2020-05-01 10:22                   ` Sergey Organov
2020-05-01 22:22                     ` Taylor Blau
2020-04-30  3:43       ` Ivan Tham
2020-04-29 19:27   ` Junio C Hamano
2020-04-29 19:31     ` Randall S. Becker
2020-04-29 19:55     ` Sergey Organov
2020-04-29 18:58 ` Taylor Blau
2020-04-30 14:52   ` Ivan Tham
2020-04-30 15:59     ` Taylor Blau [this message]
2020-04-30 19:51       ` 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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200430155904.GA30682@syl.local \
    --to=me@ttaylorr.com \
    --cc=git@vger.kernel.org \
    --cc=pickfire@riseup.net \
    --cc=sandals@crustytoothpaste.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).