how to obtain git's information when pulling in mercurial.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

how to obtain git's information when pulling in mercurial.

Uwe Brauer


Hi

I just pulled from a git repository which had some recent pushes.
I saw:
pdating 0fbeaf1..ef4a45c
Fast-forward
 Hoja 1/materiales                                              |   1 -
 Hoja 2/materiales                                              |   1 -
 Hoja 3/materiales                                              |   1 -
 Hoja 3/mieuler.m                                               |   1 -
 Hoja 3/mieulermej.m                                            |   1 -
 Hoja 3/mieulermod.m                                            |   1 -
 Hoja 3/mirk4.m                                                 |   1 -
 Hoja 4/materiales                                              |   1 -
 Hoja 4/mieuler.m                                               |   1 -
 Hoja 5/materiales                                              |   1 -
 Hoja 5/readme.md                                               |   2 --
 {Hoja 1 => hoja1}/corazon.m                                    |   2 +-
 hoja1/material                                                 |   1 +
 {Hoja 2 => hoja2}/corazon.m                                    |   1 +
 hoja2/material                                                 |   1 +
 {Hoja 2 => hoja2}/mieuler.m                                    |   0
 {Hoja 2 => hoja2}/mieulermej.m                                 |   0
 {Hoja 2 => hoja2}/mieulermod.m                                 |   0
 {Hoja 2 => hoja2}/mirk4.m                                      |   0
 {Hoja 3 => hoja3}/.ipynb_checkpoints/Untitled-checkpoint.ipynb |   0
 {Hoja 3 => hoja3}/.ipynb_checkpoints/diagramas-checkpoint.m    |   0
 {Hoja 3 => hoja3}/diagramas.m                                  |   0
 {Hoja 3 => hoja3}/errors.m                                     |   0
 hoja3/material                                                 |   1 +

Etc etc

I also had cloned that directory via the hg-git plugin but when I pulled
(hg pull -u)
I just saw

importing git objects into hg
updating to active bookmark master
37 files updated, 0 files merged, 37 files removed, 0 files unresolved


That might be well a problem with the hg-git extension.

But even for pure mercurial repositories I have
[hooks]
changegroup.diffstat=hg diff --stat -r "p1($HG_NODE)" -r "max(descendants($HG_NODE))"
outgoing=hg diff --stat -r "p1($HG_NODE)" -r "max(descendants($HG_NODE))"

But still this seems not to provide the same amount of information, git
provides.

Any suggestions?

Ok I can always do

hg log --stat

But still, that git information seems easier to read.

Regards

Uwe Brauer

_______________________________________________
Mercurial mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial
Reply | Threaded
Open this post in threaded view
|

Re: how to obtain git's information when pulling in mercurial.

Manuel Jacob
Hi Uwe,

On 2020-05-19 10:48, Uwe Brauer wrote:

> [...]
>
> I also had cloned that directory via the hg-git plugin but when I
> pulled
> (hg pull -u)
> I just saw
>
> importing git objects into hg
> updating to active bookmark master
> 37 files updated, 0 files merged, 37 files removed, 0 files unresolved
>
>
> That might be well a problem with the hg-git extension.

You’re right that this is a hg-git bug:
https://foss.heptapod.net/mercurial/hg-git/issues/315

> But even for pure mercurial repositories I have
> [hooks]
> changegroup.diffstat=hg diff --stat -r "p1($HG_NODE)" -r
> "max(descendants($HG_NODE))"
> outgoing=hg diff --stat -r "p1($HG_NODE)" -r
> "max(descendants($HG_NODE))"
>
> But still this seems not to provide the same amount of information, git
> provides.
>
> Any suggestions?

Apart from the missing hook, what information do you miss? For questions
like this, it’s unlikely that you get a helpful answer.

-Manuel
_______________________________________________
Mercurial mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial
Reply | Threaded
Open this post in threaded view
|

Re: how to obtain git's information when pulling in mercurial.

Uwe Brauer
>>> "MJ" == Manuel Jacob <[hidden email]> writes:

Hi Manuel


   > Hi Uwe,
   > On 2020-05-19 10:48, Uwe Brauer wrote:

   > You’re right that this is a hg-git bug:
   > https://foss.heptapod.net/mercurial/hg-git/issues/315

Good to know, because I always found the lack of any information
annoying.

   >> But even for pure mercurial repositories I have
   >> [hooks]
   >> changegroup.diffstat=hg diff --stat -r "p1($HG_NODE)" -r
   >> "max(descendants($HG_NODE))"
   >> outgoing=hg diff --stat -r "p1($HG_NODE)" -r
   >> "max(descendants($HG_NODE))"
   >> But still this seems not to provide the same amount of information,
   >> git
   >> provides.
   >> Any suggestions?

   > Apart from the missing hook, what information do you miss? For

What hook is missing?


   > questions like this, it’s unlikely that you get a helpful answer.

Right, what I found helpful in the information git displayed are
basically two things.

    1. The renaming was clearly visible
       {Hoja 2 => hoja2}/mieuler.m                                    |   0
       {Hoja 2 => hoja2}/mieulermej.m                                 |   0

    2. In Mercurial this looks like (a testing I did locally)

 
pulling from /home/oub/HGTest/Clases/Server
searching for changes
 Test.org |  6 ++++++
 test.org |  6 ------
 2 files changed, 6 insertions(+), 6 deletions(-)
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
new changesets 5dade11f4e0f
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
 Test.org |  6 ++++++
 test.org |  6 ------
 2 files changed, 6 insertions(+), 6 deletions(-)

I guess it is a question of taste but I find the git representation a
but more intuitive.


_______________________________________________
Mercurial mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial

smime.p7s (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: how to obtain git's information when pulling in mercurial.

Malcolm Matalka
In reply to this post by Uwe Brauer

Uwe Brauer <[hidden email]> writes:

> Hi
>
> I just pulled from a git repository which had some recent pushes.
> I saw:
> pdating 0fbeaf1..ef4a45c
> Fast-forward
>  Hoja 1/materiales                                              |   1 -
>  Hoja 2/materiales                                              |   1 -
>  Hoja 3/materiales                                              |   1 -
>  Hoja 3/mieuler.m                                               |   1 -
>  Hoja 3/mieulermej.m                                            |   1 -
>  Hoja 3/mieulermod.m                                            |   1 -
>  Hoja 3/mirk4.m                                                 |   1 -
>  Hoja 4/materiales                                              |   1 -
>  Hoja 4/mieuler.m                                               |   1 -
>  Hoja 5/materiales                                              |   1 -
>  Hoja 5/readme.md                                               |   2 --
>  {Hoja 1 => hoja1}/corazon.m                                    |   2 +-
>  hoja1/material                                                 |   1 +
>  {Hoja 2 => hoja2}/corazon.m                                    |   1 +
>  hoja2/material                                                 |   1 +
>  {Hoja 2 => hoja2}/mieuler.m                                    |   0
>  {Hoja 2 => hoja2}/mieulermej.m                                 |   0
>  {Hoja 2 => hoja2}/mieulermod.m                                 |   0
>  {Hoja 2 => hoja2}/mirk4.m                                      |   0
>  {Hoja 3 => hoja3}/.ipynb_checkpoints/Untitled-checkpoint.ipynb |   0
>  {Hoja 3 => hoja3}/.ipynb_checkpoints/diagramas-checkpoint.m    |   0
>  {Hoja 3 => hoja3}/diagramas.m                                  |   0
>  {Hoja 3 => hoja3}/errors.m                                     |   0
>  hoja3/material                                                 |   1 +
>
> Etc etc
>
> I also had cloned that directory via the hg-git plugin but when I pulled
> (hg pull -u)
> I just saw
>
> importing git objects into hg
> updating to active bookmark master
> 37 files updated, 0 files merged, 37 files removed, 0 files unresolved
>
>
> That might be well a problem with the hg-git extension.
>
> But even for pure mercurial repositories I have
> [hooks]
> changegroup.diffstat=hg diff --stat -r "p1($HG_NODE)" -r "max(descendants($HG_NODE))"
> outgoing=hg diff --stat -r "p1($HG_NODE)" -r "max(descendants($HG_NODE))"
>
> But still this seems not to provide the same amount of information, git
> provides.
>
> Any suggestions?

Does adding this to your hg config help?  You'll need to re-pull the
changes (or re clone it).

[git]
similarity = 50

>
> Ok I can always do
>
> hg log --stat
>
> But still, that git information seems easier to read.
>
> Regards
>
> Uwe Brauer
>
> _______________________________________________
> Mercurial mailing list
> [hidden email]
> https://www.mercurial-scm.org/mailman/listinfo/mercurial

_______________________________________________
Mercurial mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial
Reply | Threaded
Open this post in threaded view
|

Re: how to obtain git's information when pulling in mercurial.

Uwe Brauer

   > Uwe Brauer <[hidden email]> writes:


   > Does adding this to your hg config help?  You'll need to re-pull the
   > changes (or re clone it).

   > [git]
   > similarity = 50

No, not really

_______________________________________________
Mercurial mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial

smime.p7s (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: how to obtain git's information when pulling in mercurial.

Manuel Jacob
In reply to this post by Uwe Brauer
On 2020-05-19 13:07, Uwe Brauer wrote:

>    >> But even for pure mercurial repositories I have
>    >> [hooks]
>    >> changegroup.diffstat=hg diff --stat -r "p1($HG_NODE)" -r
>    >> "max(descendants($HG_NODE))"
>    >> outgoing=hg diff --stat -r "p1($HG_NODE)" -r
>    >> "max(descendants($HG_NODE))"
>    >> But still this seems not to provide the same amount of
> information,
>    >> git
>    >> provides.
>    >> Any suggestions?
>
>    > Apart from the missing hook, what information do you miss? For
>
> What hook is missing?

Sorry, my wording was imprecise. I meant "Apart from that the configured
hook was not executed, …".

>    > questions like this, it’s unlikely that you get a helpful answer.
>
> Right, what I found helpful in the information git displayed are
> basically two things.
>
>     1. The renaming was clearly visible
>        {Hoja 2 => hoja2}/mieuler.m                                    |
>   0
>        {Hoja 2 => hoja2}/mieulermej.m                                 |
>   0
>
>     2. In Mercurial this looks like (a testing I did locally)
>
>
> pulling from /home/oub/HGTest/Clases/Server
> searching for changes
>  Test.org |  6 ++++++
>  test.org |  6 ------
>  2 files changed, 6 insertions(+), 6 deletions(-)
> adding changesets
> adding manifests
> adding file changes
> added 1 changesets with 1 changes to 1 files
> new changesets 5dade11f4e0f
> 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
>  Test.org |  6 ++++++
>  test.org |  6 ------
>  2 files changed, 6 insertions(+), 6 deletions(-)
>
> I guess it is a question of taste but I find the git representation a
> but more intuitive.

A diff or diffstat more similarly to Git can be enabled by either

1) setting

[diff]
git = True

or

2) passing "--git" to the "hg diff …" command.

When using hg-git, the similarity config (as described in the other
answer by Malcolm) must be enabled in addition. The reason is that Git
doesn’t store copy / rename information (it’s computed on the fly) while
Mercurial stores it explicitly (when the similarity config is set,
Mercurial infers and stores the copy / rename information when
converting from Git to Mercurial).
_______________________________________________
Mercurial mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial
Reply | Threaded
Open this post in threaded view
|

Re: how to obtain git's information when pulling in mercurial.

Uwe Brauer

   > On 2020-05-19 13:07, Uwe Brauer wrote:

   > Sorry, my wording was imprecise. I meant "Apart from that the
   > configured hook was not executed, …".


   > A diff or diffstat more similarly to Git can be enabled by either

   > 1) setting

   > [diff]
   > git = True

   > or

   > 2) passing "--git" to the "hg diff …" command.

Ok but still if a file gets renamed

Git presents it like

 file1.tex ------> file2.tex

While Mercurial does

 file1.tex ---------
 file2.tex +++++++++

I think the git display gives more information, because it was a renaming
process. But I presume to have gits behavior core mercurial has to be
changed. ...

_______________________________________________
Mercurial mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial

smime.p7s (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: how to obtain git's information when pulling in mercurial.

Malcolm Matalka

Uwe Brauer <[hidden email]> writes:

>
> I think the git display gives more information, because it was a renaming
> process. But I presume to have gits behavior core mercurial has to be
> changed. ...

I could be wrong but I believe git does not have a renaming process, it
uses a heuristic of similarity to determine if a copy or rename has
happened.
_______________________________________________
Mercurial mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial
Reply | Threaded
Open this post in threaded view
|

Re: how to obtain git's information when pulling in mercurial.

Uwe Brauer
>>> "MM" == Malcolm Matalka <[hidden email]> writes:

> Uwe Brauer <[hidden email]> writes:

>>
>> I think the git display gives more information, because it was a renaming
>> process. But I presume to have gits behavior core mercurial has to be
>> changed. ...

> I could be wrong but I believe git does not have a renaming process, it
> uses a heuristic of similarity to determine if a copy or rename has
> happened.

Could be, all I am saying is that the visual display of renaming in
mercurial is not that clear.

_______________________________________________
Mercurial mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial

smime.p7s (7K) Download Attachment