Subject: Re: [RFC] origin link for cherry-pick and revert

From: Paolo Bonzini <[email-masked]>
Date: Tue, 09 Sep 2008 15:38:15 +0200

> - At the time of creation, the origin field contains a hash B which refers
>   to a reachable commit pair (B, B~1).  If B has multiple parents and the pair
>   being referred to needs to be e.g. (B, B~2), then the hash is followed by
>   a space and followed by an integer (base10, two in this case),
>   which designates the proper parentnr of B (see: mainline in git
>   cherry-pick/revert).

What about just storing *two* hashes?  This way cherry-pick can store
B~1..B and revert can store B..B~1.  The two cases can be distinguished
by checking which commit is an ancestor of which.

> - git cherry-pick/revert allow for the creation of origin links only if
>   the object they are referring to is presently reachable.

Will cherry-pick -x create origin links?  Also, does the origin link
propagate through multiple cherry picks?  If not, how can the origin
object not be reachable?

> [snip good stuff]

git cherry will use origin links to mark a commit as present, and will
only use patch-ids for commits that have no origin links.  Bonus points
for an extra command-line/configuration option to only use origin links:

  --source=default	  << default: get setting from core.cherrysource
  --source=patch-id
  --source=origin
  --source=origin,patch-id

  core.cherrysource = patch-id
  core.cherrysource = origin
  core.cherrysource = origin,patch-id

Thanks!

Paolo