graft/rebase without changing the hash

Uwe Brauer oub at mat.ucm.es
Sat Nov 26 13:30:24 UTC 2022


>>> "AB" == Arne Babenhauserheide <arne_bab at web.de> writes:

Hi Arne
> Hi Uwe,
> Uwe Brauer <oub at mat.ucm.es> writes:

>> [[S/MIME Signed Part:Good signature from
>> D472940B79E53E815167CEC95E244FB27DD2E8DB /CN=BRAUER UWE RICHARD OTTO
>> - X2064123B/C=ES/SN=BRAUER/GN=UWE RICHARD
>> OTTO/SerialNumber=IDCES-X2064123B (trust undefined)]]
>> Is there any possibility to graft/rebase a change set from say the
>> default branch to another named branch, say main, *without* changing the
>> hash?

> No, because the branch name is part of the hash calculation.

Ok, that makes sense.

>> I can rebase them, (with or without evolve enabled) but the rebased changeset
>> gets a new hash which means that if I push it, it will confuse git
>> users.

> It sounds like what you want is to have the resulting git-hash equal,
> not to have the Mercurial-hash equal. This could in theory be possible
> (because the branch name is not part of the hash-generation in git), but
> I do not know whether it is possible in practice.

I just realised with *evolve enabled*, the rebase results in no githash at
all, a bug?

Hg log  -G --follow --template "\x1B[33mcommit {rev}:{gitnode}\nAuthor: {author}\nDate: {date|rfc822date}\n\n{desc}\n{nofiles}\n"

Before the rebase gave 

◍  commit 2:1b0c5dd30a1d0ab00b3f56b2b1202bc4cbc1cb00
│  Author: Uwe Brauer <oub at mat.ucm.es>
│  Date: Sat, 26 Nov 2022 14:19:58 +0100
│
│  Git test ode15t non linear blows up

But after the rebase
@  commit 3:
│  Author: Uwe Brauer <oub at mat.ucm.es>
│  Date: Sat, 26 Nov 2022 14:19:58 +0100
│
│  Git test ode15t non linear blows up

But without evolve 
@  commit 1:28f81e628e71ca993da2d5184a5c5c31fa1cef87
│  Author: Uwe Brauer <oub at mat.ucm.es>
│  Date: Sat, 26 Nov 2022 14:18:26 +0100
│
│  Add ode15s for the nonlinear equation
│
○  commit 0:3c82db0a937415e0ffc067c7a7d1891109db021f
   Author: Uwe Brauer <oub at mat.ucm.es>
   Date: Sat, 26 Nov 2022 14:17:54 +0100

   First commit to the main branch

In any case this is not good at all. 
I could force a push, but this would make things worse

Any comments from the hg-git team?

Regards

Uwe Brauer 


-- 
Warning: Content may be disturbing to some audiences
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine. 
https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5673 bytes
Desc: not available
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20221126/78751504/attachment-0001.p7s>


More information about the Mercurial mailing list