hg-git: delete a git-branch with git, hg: pull or clone (again)

2 views
Skip to first unread message

Uwe Brauer

unread,
Jul 24, 2024, 3:29:23 AM (3 days ago) Jul 24
to via hg-git, Mercurial List

Hi

I CC this to the mercurial list since there are also hg-git users, that
might not read the hg-git mailing list that often.


I never tried this before.

1. I have a git repository

2. I cloned it with hg-git but using the standard setting that is,
git branches are imported as bookmarks

3. I deleted a git branch on remote: git push origin --delete mac_init

4. Then I either pulled or cloned again.

The graph is different:


Cloned
--8<---------------cut here---------------start------------->8---
◉ changeset: 455:3444801bb05e
│ Branch: default
│ Author: Eric Ludlam <er...@siege-engine.com>
│ Date: Fri, 27 Dec 2019 17:13:49 -0500
│ Phase: public
│ Summary: matlab-shell.el:

○ changeset: 454:1c3b3a2f9e37
│╲ Branch: default
│ │ Author: Uwe Brauer <o...@mat.ucm.es>
│ │ Date: Mon, 23 Dec 2019 21:12:23 +0100
│ │ Phase: public
│ │ Parent: 452:ee916a730867
│ │ Parent: 453:58941b964824
│ │ Summary: Merge the sourceforge master branch into the github master branch.
│ │
--8<---------------cut here---------------end--------------->8---

Pulled
--8<---------------cut here---------------start------------->8---
◉ changeset: 455:5771ddf2e50d
│ tag: delete-book
│ Branch: default
│ Author: Eric Ludlam <elu...@mathworks.com>
│ Date: Sun, 05 Jan 2020 10:44:25 -0500
│ Phase: public
│ Summary: Patch from John Ciolfi for MAC support for matlab-shell.

○ changeset: 454:1c3b3a2f9e37
│╲ Branch: default
│ │ Author: Uwe Brauer <o...@mat.ucm.es>
│ │ Date: Mon, 23 Dec 2019 21:12:23 +0100
│ │ Phase: public
│ │ Parent: 452:ee916a730867
│ │ Parent: 453:58941b964824
│ │ Summary: Merge the sourceforge master branch into the github master branch.
│ │
--8<---------------cut here---------------end--------------->8---

So what is the conclusion. Whenever a git branch is deleted the safest
thing is to clone again?

Regards

Uwe Brauer


--
I strongly condemn Hamas heinous despicable pogroms/atrocities on Israel
I strongly condemn Putin's war of aggression against Ukraine.
I support to deliver weapons to Ukraine's military.
I support the EU and NATO membership of Ukraine.

Uwe Brauer

unread,
Jul 24, 2024, 11:32:13 AM (3 days ago) Jul 24
to Mitchell Elutovich, Uwe Brauer, Mercurial List, via hg-git
>>> "ME" == Mitchell Elutovich <melut...@gmail.com> writes:

> I'm a bit confused by your shared graphs (you might have shared too little)
> the first changeset in each are different changesets, same person name wise
> but different emails, different dates

Right you are thanks!

I repeated the process.
If I just pull the bookmark gets deleted and the relevant part of the
graph looks like
--8<---------------cut here---------------start------------->8---

○───┤ changeset: 456:3444801bb05e
│ │ Branch: default
╱ ╱ Author: Eric Ludlam <er...@siege-engine.com>
│ │ Date: Fri, 27 Dec 2019 17:13:49 -0500
│ │ Phase: public
│ │ Parent: 454:1c3b3a2f9e37
│ │ Summary: matlab-shell.el:
│ │
◉ │ changeset: 455:5771ddf2e50d
│╱ tag: deleted-git-branch
│ Branch: default
│ Author: Eric Ludlam <elu...@mathworks.com>
│ Date: Sun, 05 Jan 2020 10:44:25 -0500
│ Phase: public
│ Summary: Patch from John Ciolfi for MAC support for matlab-shell.

○ changeset: 454:1c3b3a2f9e37
│╲ Branch: default
│ │ Author: Uwe Brauer <o...@mat.ucm.es>
│ │ Date: Mon, 23 Dec 2019 21:12:23 +0100
│ │ Phase: public
│ │ Parent: 452:ee916a730867
│ │ Parent: 453:58941b964824
│ │ Summary: Merge the sourceforge master branch into the github master branch.
│ │
│ ○ changeset: 453:58941b964824
│ │╲ Branch: default
│ │ │ Author: Uwe Brauer <o...@mat.ucm.es>
│ │ │ Date: Mon, 23 Dec 2019 21:07:10 +0100
│ │ │ Phase: public
--8<---------------cut here---------------end--------------->8---

Please note that I added a local tag called deleted-git-branch.

Now when I pull, that change set is also there but in a very different
place
--8<---------------cut here---------------start------------->8---

│ │ ○ │ changeset: 472:5771ddf2e50d
│ │ │ │ Branch: default
│ │ │ │ Author: Eric Ludlam <elu...@mathworks.com>
│ │ │ │ Date: Sun, 05 Jan 2020 10:44:25 -0500
│ │ │ │ Phase: public
│ │ │ │ Parent: 454:1c3b3a2f9e37
│ │ │ │ Summary: Patch from John Ciolfi for MAC support for matlab-shell.
│ │ │ │

--8<---------------cut here---------------end--------------->8---


Note the parent of change set 472!
I have to admit that I don't understand what deleting a branch in git
means.

1. It seems that the pointer/tag is deleted, and then most likely in
the next garbage collection that commits gets deleted since it
does not carry a name!? Is this correct?

2. so in hg the commits stay (since the are public) but in git they
disappear?
Reply all
Reply to author
Forward
0 new messages