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

Fwd: [RFC/FR] Should "git checkout (-B|-b) branch master...branch" work?

From
Martin von Zweigbergk <martinvonz@gmail.com>
Date
Dec 21, 2012, 16:55 UTC
Message-ID
<CANiSa6ibS7ORY=QMS3WQzXYJQQH4ZYvPO75qgLgv-oWGMSBBrw@mail.gmail.com>
In-Reply-To
<CANiSa6jP_JN+DpDgYpWA9Aky9REJvFq3aR3Yj0vF3+axWvtmsw@mail.gmail.com>
Oops, meant for all of you.
---------- Forwarded message ----------
From: Martin von Zweigbergk <martinvonz@gmail.com>
Date: Fri, Dec 21, 2012 at 8:45 AM
Subject: Re: [RFC/FR] Should "git checkout (-B|-b) branch master...branch" work?
To: Junio C Hamano <gitster@pobox.com>
On Fri, Dec 21, 2012 at 7:58 AM, Junio C Hamano <gitster@pobox.com> wrote:
>     $ git checkout -B branch <old fork point>
>
> Unfortunately, master...branch syntax does not seem to work for
> specifying the "old fork point" for this purpose

I have personally always found it confusing to use the same syntax for specifying ranges/sets and single revisions. I keep forgetting what "git diff A..B" does. I know it doesn't do what I expect (i.e. "git diff $(git merge-base A B) B"), but I don't know what it does (maybe same as "git diff A B" (?), but that's besides the point). Having worked a bit on rebase, I know that $onto can also take the "A...B" form. So there is clearly some precedence for the "..." syntax to refer to a revision in some contexts. I would have much preferred if it was possible to make the revision parser generally interpret e.g. "A.^.B" as "the merge base of A and B" (failing if not exactly one). It seems like something that must have come up before. Is there a particular reason this would not be a good idea?

Previous: Junio C HamanoNext: Junio C Hamano
Message 2 of 7 in “[RFC/FR] Should "git checkout (-B|-b) branch master...branch" work?”
  1. Junio C HamanoDec 21, 2012
  2. Fwd: [RFC/FR] Should "git checkout (-B|-b) branch master...branch" work?Martin von Zweigbergk, Dec 21, 2012
  3. Junio C HamanoDec 21, 2012
  4. Michael HaggertyDec 21, 2012
  5. Martin von ZweigbergkDec 21, 2012
  6. Junio C HamanoDec 21, 2012
  7. Michael HaggertyDec 21, 2012

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.