hraban / tomono

Multi- To Mono-repository merge
https://tomono.0brg.net
GNU Affero General Public License v3.0
842 stars 138 forks source link

Make the tool more flexible #42

Closed woopla closed 2 years ago

woopla commented 2 years ago

I've added a few features to make tomono.sh more flexible:

  1. Ability to select the default branch name
  2. Support for commented-out lines in the input file
  3. Ability to use one of the repositories as the top-level (so it's path will not change once imported)

While I was editing the files I fixed a few whitespace and Shellcheck issues. It's still reporting a couple but I did not want to make more invasive changes :)

hraban commented 2 years ago

This PR got closed automatically as I pushed a rewrite to master with unrelated history.

I've added a few features to make tomono.sh more flexible:

1. Ability to select the default branch name

This is obsolete in the rewrite

2. Support for commented-out lines in the input file

Interesting, not sure if I'm super fussed about this since running a to-monorepo migration is not something I envisage people doing on the reg. The script is already quite hairy, I'm very keen to keep it as simple as possible. I'm inclined to think removing comments from stdin is something people can do themselves, if they really need it.

3. Ability to use one of the repositories as the top-level (so it's path will not change once imported)

This is really nice, but unfortunately not compatible with the new rewrite. And I don't know how I'd make that work with read-tree :/ I struggled for a bit but I'm not good enough with git to tackle this. I'll definitely keep it in mind though, if I ever come up with a solution I'll make sure to revisit!

While I was editing the files I fixed a few whitespace and Shellcheck issues. It's still reporting a couple but I did not want to make more invasive changes :)

Thanks, good instincts ;) it would've been obsolete.

For posterity's sake, the old PR diff is here: https://github.com/hraban/tomono/compare/v1...woopla:more-flexibility

hraban commented 2 years ago
3. Ability to use one of the repositories as the top-level (so it's path will not change once imported)

This is really nice, but unfortunately not compatible with the new rewrite. And I don't know how I'd make that work with read-tree :/ I struggled for a bit but I'm not good enough with git to tackle this. I'll definitely keep it in mind though, if I ever come up with a solution I'll make sure to revisit!

I found a way to do this! Ironically, that made me wonder: why not use that existing repo as the monorepo, and use --continue on that? Since it is, by default, already the top level repo then. Wouldn't that be a more elegant solution?

woopla commented 2 years ago

Yes that would be more elegant indeed! I went for "the shortest path to getting this working" rather than the "best long-term idea" on this one I'm afraid :p

hraban commented 2 years ago

I can relate :) Thanks again for your contributions, I'll leave it at that then. All the best!