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

Re: tracking branch for a rebase

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 10, 2009, 06:42 UTC
Message-ID
<7vzl93cncn.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20090909104550.GA20108@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
> I wonder if it is worth adding @{upstream} now, which is fairly safe,
> letting it cook for a while, and then adding a "%" alias later after the
> concept has proved itself (and people say "I like this feature, but it
> really is too much to type").

That's a sane suggestion, I think. We can always have a descriptive longhand (e.g. "branch@{upstream}") and later add a shorthand for often used ones (e.g. "branch^up", "branch/.up" --- the former is possible because it cannot be upth parent of the commit at the tip of the branch, and the latter is possible because component of hierarchical refname cannot begin with a dot).

I find a prefix % not descriptive enough (besides being ugly); if it were "^branch", as some people said, it would probably have matched its meaning "up", but that notation is already taken for "uninteresting". If we are going to use funny symbol as a notation to invoke magic, I think it is easier for new people if we limit the number of symbols used. We already have ^n, ^{type} and ~n magic, all of which operate on objects and peel them in three different ways.

Then there currently is only one kind of magic that works on refs and it is spelled as ref@{magic}. Let's try not to introduce more notation before it is absolutely necessary.

When I say there is only one kind of magic notation for refs, I am primarily talking about the end-user perception. @{time}, @{number} and @{-number} all do their magic using the reflog, but that is about _how_ they do what they do. End-user perception begins with _what_ they do, and at that level, the magic consistently works on refs and different genie is summoned depending on what is inside {}.

The @{upstream} thing won't be using reflog to do its job, but that is about _how_ it is implemented, and the end users don't care.

What is more important is _what_ it does. Given a ref, the @{} magic notation finds something that is related to the ref. @{time} and @{number} finds what the ref itself used to point at. @{-number} (applicable only to HEAD ref) finds the ref it used to point at. And @{upstream} will find another ref that it merges from (or rebases onto).

Previous: Jeff KingNext: Johannes Schindelin
Message 18 of 39 in “tracking branch for a rebase”
  1. Pete WyckoffSep 4, 2009
  2. Michael J GruberSep 4, 2009
  3. Jeff KingSep 4, 2009
  4. Björn SteinbrinkSep 4, 2009
  5. Jeff KingSep 5, 2009
  6. Björn SteinbrinkSep 5, 2009
  7. Jeff KingSep 5, 2009
  8. Junio C HamanoSep 7, 2009
  9. Michael J GruberSep 7, 2009
  10. Junio C HamanoSep 7, 2009
  11. Jeff KingSep 7, 2009
  12. Michael J GruberSep 7, 2009
  13. Jeff KingSep 7, 2009
  14. Johannes SchindelinSep 7, 2009
  15. Michael J GruberSep 7, 2009
  16. Julian PhillipsSep 8, 2009
  17. Jeff KingSep 9, 2009
  18. Junio C HamanoSep 10, 2009
  19. Johannes SchindelinSep 10, 2009
  20. Introduce <branch>@{tracked} as shortcut to the tracked branchJohannes Schindelin, Sep 10, 2009
  21. Michael J GruberSep 10, 2009
  22. Johannes SchindelinSep 10, 2009
  23. Johan HerlandSep 10, 2009
  24. Michael J GruberSep 10, 2009
  25. Johan HerlandSep 10, 2009
  26. Johannes SchindelinSep 10, 2009
  27. Michael J GruberSep 10, 2009
  28. Jeff KingSep 10, 2009
  29. Junio C HamanoSep 10, 2009
  30. Björn SteinbrinkOct 2, 2009
  31. Jeff KingSep 10, 2009
  32. Jeff KingSep 10, 2009
  33. Johannes SchindelinSep 10, 2009
  34. Introduce <branch>@{upstream} as shortcut to the tracked branchJohannes Schindelin, Sep 10, 2009
  35. Jeff KingSep 10, 2009
  36. Johannes SchindelinSep 10, 2009
  37. Johannes SchindelinSep 10, 2009
  38. Junio C HamanoSep 11, 2009
  39. Junio C HamanoSep 5, 2009

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.