git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [RFC PATCH 0/3] Support for tail (branch point) experiment
@ 2023-03-10 21:45 Felipe Contreras
  2023-03-10 21:45 ` [RFC PATCH 1/3] branch: add new 'tail' concept Felipe Contreras
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Felipe Contreras @ 2023-03-10 21:45 UTC (permalink / raw)
  To: git; +Cc: Antoine Beaupré, Phillip Wood, Felipe Contreras

This is *not* meant a serious proposal, it's just an exploration of an
idea.

The topic of finding the actual point a branch started to fork has been
discussed for decades [1] and yet no clear solution is in sight. That's
why this idea I had in 2013 keeps coming back.

The idea is simple: add the concept of a branch tail (e.g.
`master@{tail}`.

The motivation is that Git's main competitor--Mercurial--does have the
ability to tell with 100% accuracy where a branch started, Git does not.

Many hacks have been proposed, such as parsing the commit messages for
"Merge branch", using the reflog, adding options like
--exclude-first-parent-only. All these clever solutions fail in one way
or another.

If we stopped trying to be clever we could go for the easy solution:
simply add a tail marker.

This has many advantages:

 * `git rebase` can simply use that
 * `git send-email` can use that
 * `git range-diff` can use that
 * `git name-rev` will now be accurate

I know most of my tools (`git send-seriels`, `git related`, and `git
smart-list`) would greatly benefit from this information.

Moreover, for one the most important commands of git, it makes much more
sense semantically:

    git rebase --onto branch@{upstream} branch@{tail} branch

Than the current:

    git rebase --onto something branch@{upstream} branch

I'm not expecting this to be seriously considered (given the track
record of my proposals), but now the idea is on the record, so it can be
referenced in future discussions (which are likely not going to just
stop).

Cheers.

[1] https://stackoverflow.com/questions/1527234/finding-a-branch-point-with-git/71193866#71193866

Felipe Contreras (3):
  branch: add new 'tail' concept
  sha1-name: add @{tail} helpers
  rebase: update branch tail after rebasing

 branch.c                  | 12 ++++++++++++
 branch.h                  |  1 +
 builtin/clone.c           |  1 +
 builtin/rebase.c          | 15 +++++++++++++++
 object-name.c             | 30 +++++++++++++++++++++++++++++-
 t/t1514-rev-parse-tail.sh | 39 +++++++++++++++++++++++++++++++++++++++
 6 files changed, 97 insertions(+), 1 deletion(-)
 create mode 100755 t/t1514-rev-parse-tail.sh

-- 
2.40.0.rc2.1.gf652911b76.dirty


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-03-11  3:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-10 21:45 [RFC PATCH 0/3] Support for tail (branch point) experiment Felipe Contreras
2023-03-10 21:45 ` [RFC PATCH 1/3] branch: add new 'tail' concept Felipe Contreras
2023-03-10 21:45 ` [RFC PATCH 2/3] sha1-name: add @{tail} helpers Felipe Contreras
2023-03-10 21:45 ` [RFC PATCH 3/3] rebase: update branch tail after rebasing Felipe Contreras
2023-03-11  0:04 ` [RFC PATCH 0/3] Support for tail (branch point) experiment Junio C Hamano
2023-03-11  3:26   ` Felipe Contreras

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).