git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tim Chase <git@tim.thechases.com>
To: Git <git@vger.kernel.org>
Subject: Using "-" for "previous branch" failing with rebase
Date: Sat, 15 Mar 2014 15:29:24 -0500	[thread overview]
Message-ID: <20140315152924.26c3294e@bigbox.christie.dr> (raw)

I recently learned that there are several places where git allows use
of "-" to refer to the previous branch, e.g.

  git checkout -b dev
  # hack, hack
  git checkout master
  git merge -
  git checkout -

However, it doesn't seem to understand "-" in the context of a rebase:

  git checkout branch_a
  # hack
  git commit -a
  git checkout branch_b
  # hack
  git commit -a
  git rebase -         # I'd expect to rebase onto branch_a

but I get

  fatal: Needed a single revision
  invalid upstream -

Issuing

  git rebase branch_a

does exactly what I'd expect (as "git checkout -" puts me on
"branch_a").

Is this just an interface inconsistency or is there a some technical
reason this doesn't work (or, has it been addressed/fixed, and just
not pulled into Debian Stable's 1.7.10.4 version of git)?

Thanks,

-tkc

             reply	other threads:[~2014-03-15 21:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-15 20:29 Tim Chase [this message]
2014-03-17  6:37 ` Using "-" for "previous branch" failing with rebase Junio C Hamano
2014-03-18  1:47   ` Tim Chase
2014-03-18 18:59     ` 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=20140315152924.26c3294e@bigbox.christie.dr \
    --to=git@tim.thechases.com \
    --cc=git@vger.kernel.org \
    /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).