Re: Questions about the new
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:47:32
Sergio Callegari [off-list ref] writes:
If I want to replace some commit X by some commit X' I merely need to modify the parent information of all the commits that are child of X so that they pretend to be child of X', or am I missing something?
You need to find all the commits that are child of X in the first place. What should happen if your colleague has such a commit in his repository (which you haven't fetched from yet), you enumerated all children of X known to you in your graft file and then you fetch from him? You need to enumerate all children of X again to keep the graft file up to date.
Thanks for the explanation. Can this be made possible for grafts too? Wouldn't it be a matter of having history walkers never obey grafts but keep track of them (i.e. of the history of the parenthood they reference)?
In the past we discussed the possibility of that for quite a while but never saw a successful implementation. The replace mechanism seemed a cleaner way to do this, and it turned out to be the case. You are welcome to try doing that for the grafts, of course.