Skip to content

RFC Support for tail (branch point) experiment

Felipe Contreras git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest3 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3branch: add new 'tail' conceptbranch.c branch.h builtin/clone.c +1 more+37 -00 replies
2/3sha1-name: add @{tail} helpersobject-name.c t/t1514-rev-parse-tail.sh+35 -10 replies
3/3rebase: update branch tail after rebasingbuiltin/rebase.c t/t1514-rev-parse-tail.sh+25 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/3] Support for tail (branch point) experiment

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
Signature · 1 line
2.40.0.rc2.1.gf652911b76.dirty