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

Re: [PATCH v2] git-rebase: Teach rebase "-" shorthand.

From
John Keeping <john@keeping.me.uk>
Date
Mar 19, 2014, 19:12 UTC
Message-ID
<20140319191217.GC11018@serenity.lan>
In-Reply-To
<xmqqsiqe2es6.fsf@gitster.dls.corp.google.com>
On Wed, Mar 19, 2014 at 12:02:01PM -0700, Junio C Hamano wrote:
Show 24 quoted lines
> John Keeping <john@keeping.me.uk> writes:
> 
> > On Wed, Mar 19, 2014 at 10:53:01AM -0700, Junio C Hamano wrote:
> >>    "rebase -" with your change still says something like this:
> >> 
> >>         First, rewinding head to replay your work on top of it...
> >>         Fast-forwarded HEAD to @{-1}.
> >> 
> >>    instead of "Fast-forwarded HEAD to -".  Somebody may later want
> >>    to "fix" this, making these two eye-candy output to be different
> >>    from each other, and what your test expects will no longer hold
> >>    (not that I think it is better to say "-" instead of @{-1}
> >>    there).
> >
> > I don't think either of these is correct.  When using "-" with the
> > commands that already support it, I have occasionally found that "-"
> > isn't what I thought it was.
> >
> > Can we use `git name-rev` to put the actual name here, so that people
> > who have not done what they intended can hopefully notice sooner?
> 
> That sounds like a right thing to do.  It however is totally
> orthogonal to the change we are discussing, and should be done as a
> separate patch.
Is it not part of adding support for "-"?

I'm not arguing for a change to any existing functionality, just to the behaviour introduced by this patch, which is basically a change from "@{-1}" to "$(git name-rev --name-only @{-1})" in the patch. (The error handling of name-rev appears not to be very useful here when the previous branch has been deleted, so I don't think it's quite that simple, but that's the principle.)

Previous: Junio C HamanoNext: Junio C Hamano
Message 9 of 12 in “git-rebase: Teach rebase "-" shorthand.”
  1. git-rebase: Teach rebase "-" shorthand.Brian Gesiak, Mar 18, 2014
  2. Torsten BögershausenMar 18, 2014
  3. Junio C HamanoMar 18, 2014
  4. git-rebase: Teach rebase "-" shorthand.Brian Gesiak, Mar 19, 2014
  5. Junio C HamanoMar 19, 2014
  6. John KeepingMar 19, 2014
  7. Brian GesiakMar 19, 2014
  8. Junio C HamanoMar 19, 2014
  9. John KeepingMar 19, 2014
  10. Junio C HamanoMar 19, 2014
  11. John KeepingMar 19, 2014
  12. Junio C HamanoMar 19, 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.