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

Re: Using "-" for "previous branch" failing with rebase

From
TCTim Chase <git@tim.thechases.com>
Date
Mar 18, 2014, 01:47 UTC
Message-ID
<20140317204744.6ac795a0@bigbox.christie.dr>
In-Reply-To
<7vppll2uvp.fsf@alter.siamese.dyndns.org>
On 2014-03-16 23:37, Junio C Hamano wrote:
Show 19 quoted lines
> Tim Chase <git@tim.thechases.com> writes:
> 
> > 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)?
> 
> It is merely that nobody thought "rebase" would benefit from such a
> short-hand, I think.
> 
>     Teach more commands that operate on branch names about "-"
>     shorthand for "the branch we were previously on", like we did
>     for "git merge -" sometime after we introduced "git checkout -"
> 
> has been sitting in my "leftover bits" list at
> 
>     http://git-blame.blogspot.com/p/leftover-bits.html
> 
> for quite some time.  Hint, hint...

Not sure if the "Hint, hint" was intended for me, as I'm not exactly a git hacker. I did find another place where I reached for it instinctively (now that I use it regularly with checkout/merge): git-diff.

  git checkout some_branch
  #hack
  git commit -m "..."
  git checkout other_branch
  # hmm...what's different between these branches?
  git diff -
which I would have expected to act something like
  git diff some_branch..other_branch
Just for the archives.
-tkc
(or possibly the reverse)
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 4 in “Using "-" for "previous branch" failing with rebase”
  1. Tim ChaseMar 15, 2014
  2. Junio C HamanoMar 17, 2014
  3. Tim ChaseMar 18, 2014
  4. Junio C HamanoMar 18, 2014

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.