-
-
Notifications
You must be signed in to change notification settings - Fork 138
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
Switch to ls-remote (branches, tags), copying tags, minor additional updates #39
Conversation
git read-tree
Set to master and checkout working dir after run
* Support branch names that contain slashes * Fix 'allow unrelated histories'
…n converting many projects into a mono repo takes a long time)
README: Explain parallel development and merging
Echoing out project name
Directly list branches from .git meta dir instead of using porcelain commands. I would have preferred a plumbing command for this but I can't find any. Fixes hraban#11
Set monorepo name through envvar (default: "core")
Robust handling of remote names
This time I've really dunnit. This should really be it, finally. Finally finally finally. No more madness with the branches. Honestly though this was a regression and it might be time to add a proper test suite :( But that's for another time! #yolomerge.
Does what it says on the tin. Remote `foo` with tags `v1` and `v2` get imported as tags `foo/v1` and `foo/v2`.
Add git version to requirements
Fix bug in branch names with /
Namespace tags
Custom folder name
Tags and branches are now read from the corresponding remote, as not all were found utilizing the ls-files approach. Furthermore, the tags are now properly copied step by step using for-each-refs. Co-authored-by: gustafj <gustaf@pinon.se>
To be aligned with widely-used tools such as GitLab und GitHub.
Hi Jonas & Gustaf, This looks lovely, thanks for your patch. My biggest question is probably around ls-remote: love the idea, looks great, but before I merge this in: what problem exactly does it solve? Which bug does this address? |
Hi @hraban! When we migrated our ~80 repos with their 4000+ branches and 1400+ tags in the first place, we noticed that a lot of branches and tags where missing and we could not find them. That's when we first really looked at your script. We noticed that you were doing some operations on the It is more or less what is pointed out in #32. That one is fixed by this PR. |
It is also worth noting that usage of the plumbing commands is to be considered as utilizing a stable API suitable for scripting. |
Sounds good. Let me get back to you on this soon. |
Have still problems with some tags:
|
Hi @sirop, how does the merge behave when you use the script from //Jonas |
Hello @TacoVox , your patch is a definite improvement, as the master version "loses" some branches and files whereas your version does not. I did not investigate in particular how the master deals with tags, but at least I did not have any (explicit) error messages because of tags. |
Check. Upon good old-fashioned google, I wonder if you repo is somewhat corrupt. |
Hi @TacoVox , this PR got closed by GH as I force pushed an entirely unrelated tree to master. A cleanroom rewrite to get around the licensing issue. I looked at your changes, and most of them have been taken care of in the rewrite. The one open issue is tags: I'll need to take a look at this, + annotated tags, later. There is an open issue tracking it. Thanks again for your work 👍 |
For the record, this was handled in the rewrite when I learned about a way to solve this:
This automatically namespaces tags. More info at https://github.com/hraban/tomono#per-repository |
Hi guys,
we were using this script to migrate quite a lot of repos into a monorepo. Unfortunately, we noticed some hickups here and there. That's were we decided to use e.g.
git ls-remote
and other commands to list tags and branches, as well as copying the prior, instead of manipulating/utilizing the git-underlying directory-/file-structure.Hope these updates are to your liking, otherwise we are more happy to amend!
Cheers,
Jonas & Gustaf