-
Notifications
You must be signed in to change notification settings - Fork 16
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
migrate: switch to git-filter-repo, make temp dir creation more robust, enable changing default branch name #95
base: master
Are you sure you want to change the base?
Conversation
Sorry hadn't seen this before now - usually have an average of 500 notifications lol I added this migrate command originally - and it worked for my purpose Is this draft working at least? |
Hey, yeah I successfully migrated a couple of projects with the code in here. The two things that were a problem for me with the existing command were
|
Think you said this backwards? 7564b76#diff-b45341acb11c77181833b113debfc339b0893c889afb46121cb1d12c0c0e36d8R5 Anyway, this looks good to me. Performance improvements are always welcome. I'll try it locally. Thanks! |
Yep, sorry, got confused! |
Hi @rikkit sorry took me a few weeks to get to this... so, I didn't realize that git filter-repo isn't a standard git command Using this with filter-repo would require users to install additional tools vs the built in filter-branch Or am I missing something? (using git 2.36) |
oh I think the tmp directory was from the first run where I didn't have filter-repo installed yet, so nevermind on that one |
defaultBranch in .meta config works fine though - used I guess the only issue is the separate install - hm - I suppose just checking for it and logging an error telling the user to install it would be ok? |
Hey @patrickleet, thanks for the review and glad it all worked. I think there are two approaches to take depending on how strongly you feel about it. One checking for it and logging some info on how to install. Two, supporting both versions and falling back to I feel like approach one is reasonable given that Git have deprecated the command. Plus it's less to maintain in this project. How should we take this forward? |
@rikkit haven't merged it yet, but also added a couple lines yesterday in |
@rikkit also it's bothered me ever since I made it that I put the folder name before the repo url. I think the other way around would have been better. Kinda thinking maybe we go with both for now - just change the name of the old command, and add the new one as well using the "migrate" command name (what to put for deprecated one? I think the logs should link to instructions of how to install filter-repo for using this version though, regardless, and if you want to use a slower version without installing anything, use |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Hey @patrickleet , sorry for the gigantic delay in replying. Is it possible to specify versions for plugins of meta? Would it work if someone for example just use an older version of |
I tried this and it worked, the only real hangup I had was the requirement to install an extra tool and I wasn't really sure about the best thing to do there |
Hey there, I'm currently using
meta
to restructure a monorepo I work on, and I've made these changes tometa-project-migrate
:git filter-repo
instead ofgit filter-branch
because it's been deprecated https://git-scm.com/docs/git-filter-branch#_warning (requires separate install)mkdtempSync
function to get a temp folder in/usr/tmp
instead of making one inside the repo -filter-repo
won't work otherwisesplitSubtree
so that we can usemain
instead ofmaster
Allow use ofmain
as primary branch in edge cases like migrate meta#281defaultBranch
if available so thatmain
can be set on a project levelI'm not finished migrating the repo yet - I need to make some more changes to make other meta commands read the
defaultBranch
option. I've opened this PR now for early feedback since I'm not sure how you would like to review these changes, or if you'd like to accept them all, so let me know and I can split up this PR if needed.