modifying converted repos and github pull requests
Benito van der Zander
benito at benibela.de
Tue Oct 8 16:22:19 UTC 2019
Hi,
> Do you just need to replace the hash of the old tip with the hash of the new tip in shamap ?
> That sounds like it should work. It's easy to test on a throwaway
> clone of a small repo, isn't it?
>
yes, but I would also like to know how future proof this is. Perhaps
they are already working on replacing shamap with another kind of file
>> How can I merge pull requests from github to the big repository?
> This sounds harder, due to the problems you describe below. Convert
> is pretty much a one-way tool. I think that if there are changes that
> you want in both the big and small repo you are always going to have
> to commit them to the big repo first. That would mean making a patch
> from the github PR, applying that patch to the big repo, and then
> using covert to get it from the big repo to the small repo. I don't
> know, maybe others will have better ideas.
>
Now I took a look at the actual git commits.
One problem is that hg-git adds a "HG:rename-source hg" annotation to
the commit, which changes the hash.
The second problem is that github signs commits made on its webpage, so
the original git commit contains annotations:
committer GitHub <noreply at github.com> 1562417170 +0200
gpgsig -----BEGIN PGP SIGNATURE-----
wsBcBAABCAAQBQJdIJgSCRBK7hj4Ov3rIwAAdHIIAJva4pSJCpUapMsIugP6MvJ/
Meth+FfzLW2yCYjjNQ6zySocQmD9NqiH0Bc0eAULrXMU3iw1lGCDYISPwsBU0kpV
XiSNoYK46/0b3HRVnt/ySnD9cl+lbpZYv3B1UZPReub7TjO5Jx7zwpyxO6IwNpzY
DnCUQyEjVI1/XTdFHwYUbL9thEngoMhXpuuJwyeMVTcUSpPxCiT0fPglEde5o1Vq
Mok1n/yDsNoI9jcMqDqNiwmbPux7rBHWwUk3Itlm+VFlJXNzRt1GNmqoxDh+X+p1
nqayLFk52EaT786aijxSQcPGsuaur2WdW+gOib2a0I9EsAKYpqtJVPdw/GtLbh0=
=0SiM
-----END PGP SIGNATURE-----
Those are lost during conversion. Can Mercurial even store separate
author and committer?
Perhaps it is not a good idea to keep the small repos as hg. Perhaps I
should change them to git. Then I could merge the pr from github to the
small repo; convert it to hg to merge into the big repo; modify shamap,
so hg convert thinks the merge had already been converted and ignores
the commit in the big repo.
Cheers,
Benito
On 04.10.19 23:35, Bryan Murdock wrote:
> On Fri, Oct 4, 2019 at 6:01 AM Benito van der Zander<benito at benibela.de> wrote:
>> Hi,
>>
>> I keep all my projects in one big mercurial repo. It contains public and private projects, so to publish changes to the public projects, I split it with hg convert into smaller repos - one for each project - and then uploading them on github with hg-git. When I make changes in the big repo, I run hg convert and the git export again, which works well.
>>
>> Is it possible to make changes to the smaller repos directly without breaking later converts.
>> Like removing a file that was included in the wrong subproject?
>> Do you just need to replace the hash of the old tip with the hash of the new tip in shamap ?
> That sounds like it should work. It's easy to test on a throwaway
> clone of a small repo, isn't it?
>
>> How can I merge pull requests from github to the big repository?
> This sounds harder, due to the problems you describe below. Convert
> is pretty much a one-way tool. I think that if there are changes that
> you want in both the big and small repo you are always going to have
> to commit them to the big repo first. That would mean making a patch
> from the github PR, applying that patch to the big repo, and then
> using covert to get it from the big repo to the small repo. I don't
> know, maybe others will have better ideas.
>
>> When I just copy paste the changes in the big repo, the resulting commit after the conversions has a different hash and github shows it as unmerged.
>> If I merge it in the small repo, it might confuse hg convert, and is still not in the big repo.
> Bryan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20191008/7a2bb3e1/attachment-0002.html>
More information about the Mercurial
mailing list