-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"git remote prune [remotename]" does not prune bookmarks #15
Comments
Is there any workaround to get rid of the bookmark from the list of remote branches without re-cloning the entire repository? |
I haven't been using git-remote-hg anymore; it looks like a dead project, and I've since sworn off working on anything that's based in Mercurial. ;-) |
My fork https://github.com/fingolfin/git-remote-hg is actually quite alive :) However, I also do not much more than fixing serious bugs and ensuring it stays compatible with new Mercurial releases for now. This is because I do not need it for major projects anymore, as I used to. Still, I feel that this project is quite useful for many people, so I try to fix at least the worst issues. Regarding this issue: I think the problem is that when a Mercurial bookmark is deleted on the server, this change is not reflected in clones. In particular, there seems to be no analog to So, to fix this, it will likely be necessary to implement the corresponding logic. I.e. fetch a list of remote bookmarks, then delete any local bookmarks that are not on the remote -- and only then begin exporting everything to git. |
@fingolfin I use your fork on OSX. It works great, so thank you for your work on that. If you ever get some extra time to fix it so that it clones and checks out correctly on Windows that would be awesome. Currently I am limited to OSX. The bookmarks issue for me is not a big deal at the moment since I don't normally use bookmarks. |
@fingolfin After a bookmark is deleted from the hg remote, what exactly is necessary to manually remove the bookmark and bookmark branch (so as to avoid having to re-clone)? I did the following:
...and the bookmark branch went away, so that seems to have worked. Is there anything else I should do, or is there anything wrong with the steps I took above? By the way, my main problem is that, when I create a branch in git, sometimes I forget to add the |
@nathanielcook THat sounds about right to me. The "problem" is to automate that. It actually shouldn't be that hard, but "somebody" has to do it (and ideally also write test cases for it ;-). I am not quite sure what you mean with "disallowing" branches without the |
@fingolfin Yes; I meant to say block pushing branches without the Appreciate all that you've done already! I wish I was a python guy; I have looked at potentially modifying the script myself. :-) |
@nathanielcook I am not really a python guy myself, but it's easy enough to pick up ;-). Anyway, I think the place you need to look at is |
This is a limitation of Git's core. You can manually delete all the refs:
And pass that to |
... rather than only adding remote ones locally and never deleting. In particular, makes fetch --prune work. Fixes felipec#15
I am not quite sure what git core is to blame for here. As mentioned in previous comments, what happens is that bookmarks are only fetched from remote repo and then added to the local proxy clone, but bookmarks are never deleted from the proxy clone when deleted on the remote. So, it is/was a matter of automating bookmark sync, and the above commit does just that after which |
Yes, and that patch is a hack. A remote helper in't supposed to be calling other git commands. There should be a way for the remote helper to tell |
When a bookmark has been deleted [1] from the Mercurial remote, running
git remote prune [remotename]
after a fetch does not prune the deleted bookmark branches from the remote.[1] Externally, since we can't delete them via
git-remote-hg
.The text was updated successfully, but these errors were encountered: