git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Stephen R. van den Berg" <srb@cuci.nl>
To: git@vger.kernel.org
Subject: [RFC] cherry-pick using multiple parents to implement -x
Date: Sun, 7 Sep 2008 12:34:15 +0200	[thread overview]
Message-ID: <20080907103415.GA3139@cuci.nl> (raw)

I've been converting some old CVS repositories to git, and as it turns
out, these repositories consist of a number of main branches of the same
project that were created at several points in time (the stable release
branches), and the branches contain numerous backports (and a few
forward ports) between each other.

I.e. the branches split off each other at various points in time, and
evolved independently ever since (except for the numerous backports).

Now, the backports can be implemented using a mere "git cherry-pick -x",
but that creates this silly text references to the original commits.
I'd rather use something that gitk can visualise.

So I tried to use the parents of the commit to reference the origin(s).
I.e. the first parent links to the linear history on a given branch, but
the second (and possibly more) parents point to the cherry-picked
back-ported commit from another branch.  This graft-constructed
repository is then fed to filter-branch to make it permanent.
To view it try: git://pike-git.lysator.liu.se/pikex

This works quite well and shows the following results:
- gitk shows proper grafts.
- gitk properly shows a zero-diff between the new commit and the
  commits we cherry-picked from.
- It even works perfectly when picking from multiple parents.
- gitk is confused in its display of tags preceding and following this
  commit (depending on the situation it mixes up the branches).

Obviously the reason it works rather well is because git can actually
distinguish between a merge and a backport because of the way the
contents of the trees change.

The questions now are:
- Would there be good reason not to record the backport/forwardport
  relationship in the additional parents of a commit?
- Since most of the git machinery (git diff, and gitk, most notably)
  seem to work just fine when using parents for that purpose, would it
  be acceptable to create a patch to cherry-pick to support an option to
  record the backport/forwardport relationship in the second (or more)
  parent field(s)?
- And depending on an affirmative on the previous question, would it be
  acceptable to teach the gitk preceding/following tag listing to deal
  with these backport/forwardports ?
-- 
Sincerely,
           Stephen R. van den Berg.

"The future is here, it's just not widely distributed yet." -- William Gibson

             reply	other threads:[~2008-09-07 10:35 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-07 10:34 Stephen R. van den Berg [this message]
2008-09-07 17:28 ` [RFC] cherry-pick using multiple parents to implement -x Jeff King
2008-09-07 19:56   ` Stephen R. van den Berg
2008-09-07 20:04     ` Jeff King
2008-09-07 20:22       ` Stephen R. van den Berg
2008-09-08  1:49         ` Jeff King
2008-09-08  6:57           ` Stephen R. van den Berg
2008-09-07 17:28 ` Junio C Hamano
2008-09-07 20:10   ` Stephen R. van den Berg
2008-09-07 21:16     ` Thomas Rast
2008-09-07 22:22       ` Junio C Hamano
2008-09-07 22:00     ` Junio C Hamano
2008-09-08  7:37   ` Paolo Bonzini
2008-09-08  7:55     ` Junio C Hamano
2008-09-07 23:53 ` Junio C Hamano
2008-09-08 11:51   ` Stephen R. van den Berg
2008-09-08 13:04     ` Paolo Bonzini
2008-09-08 13:42       ` Stephen R. van den Berg
2008-09-08 14:37         ` Jakub Narebski
2008-09-08 14:57           ` Paolo Bonzini
2008-09-08 14:38     ` Shawn O. Pearce
2008-09-08 14:58       ` Stephen R. van den Berg
2008-09-08 15:00         ` Shawn O. Pearce
2008-09-09  8:51           ` Stephen R. van den Berg
2008-09-08 15:04       ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080907103415.GA3139@cuci.nl \
    --to=srb@cuci.nl \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).