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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux