git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCHSET] git-reverse-trailer-xrefs: Reverse map cherry-picks and other cross-references

From
THTejun Heo <tj@kernel.org>
Date
Dec 12, 2018, 14:54 UTC
Message-ID
<20181212145456.GQ2509588@devbig004.ftw2.facebook.com>
In-Reply-To
<xmqqo99rjjcu.fsf@gitster-ct.c.googlers.com>
Hello, Junio.
On Wed, Dec 12, 2018 at 04:26:57PM +0900, Junio C Hamano wrote:
> It also is not immediately obvious to me what your general strategy
> to maintain this reverse mapping is, when new ways and codepaths to
> cause new commits with "cherry-picked-from" trailer appear.  Do we
> keep piling on new hooks?  Or is the reverse mapping information

So, what I actually wanted was "this repo now has these new commits" hook, but that didn't seem to be in line with other hooks as most were bound to specific directly user-visible commands and actions.

Show 8 quoted lines
> allowed to be a bit stale and be completed immediately before it
> gets used?  A totally different approach could be to record list of
> commits, all commits behind which have been scanned for reverse
> mapping, in the tip of the notes history, perhaps in the commit log
> message (which is machine generated anyway).  Then, before you need
> the up-to-date-to-the-last-second reverse mapping, you could run
> 
> 	git rev-list --all --not $these_tips_recorded

Wouldn't it be more useful to have repo-updated-with-these-commits hook instead rather than putting more logic on note handling?

Show 12 quoted lines
> and scan the commits, just like you scan what you fetched.  And when
> you update the reverse mapping notes tree, the commit to record that
> notes update can record the tip of the above traverseal.
> 
> I also wonder how this topic and the topic Stefan Xenos has been
> working on (cf. <20181201005240.113210-1-sxenos@google.com>) can
> benefit from each other by cross pollination.  Stefan's topic also
> needs to answer, given a commit, what other commits were created out
> of it by cherry-picking and then further amending the results, so
> that when the original commit itself gets amended, the cherry-picked
> ones that were created from the original can be easily identified
> and get updated in the same way as necessary.  
Ah, I see, forward-propagating amends to cherry-picks.
Show 5 quoted lines
> The motivating workflow your topic's cover letter gives us is to
> maintain the release branch that goes only forward, so in that
> context, how a commit on the release branch that was created by
> cherry-picking an original gets updated when the original commit
> gets amended would be different (I am assuming that you cannot

At least we don't do this with our trees and most trees that I've worked with don't either as that would make it really confusing for people to work together.

Show 6 quoted lines
> affored to rebase the release branch to update a deeply buried
> commit that was an earlier cherry-pick), but I would imagine that
> both topics share the need for a good data structure to keep track
> of (1) the relationship between the original and copy of the
> cherry-pick and (2) the fact that the original of such a cherry-pick
> is now stale and the copy might want to get updated.

As long as we can keep the reverse rference notes consistent, wouldn't amend propagation just consume them?

Thanks.
-- 
tejun
Previous: Junio C HamanoNext: Junio C Hamano
Message 8 of 17 in “[PATCHSET] git-reverse-trailer-xrefs: Reverse map cherry-picks and other cross-references”
  1. Tejun HeoDec 11, 2018
  2. 1/5 trailer: Implement a helper to reverse-map trailer xrefsTejun Heo, Dec 11, 2018
  3. 2/5 notes: Implement special handlings for refs/notes/xref-Tejun Heo, Dec 11, 2018
  4. 3/5 notes: Implement git-reverse-trailer-xrefsTejun Heo, Dec 11, 2018
  5. 4/5 githooks: Add post-cherry-pick and post-fetch hooksTejun Heo, Dec 11, 2018
  6. 5/5 notes: Implement xref-cherry-picks hooks and testsTejun Heo, Dec 11, 2018
  7. Junio C HamanoDec 12, 2018
  8. Tejun HeoDec 12, 2018
  9. Junio C HamanoDec 13, 2018
  10. Junio C HamanoDec 13, 2018
  11. Tejun HeoDec 13, 2018
  12. Stefan XenosDec 18, 2018
  13. Stefan XenosDec 18, 2018
  14. Tejun HeoDec 18, 2018
  15. Tejun HeoDec 13, 2018
  16. Junio C HamanoDec 13, 2018
  17. Tejun HeoDec 13, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.