mcc,
@mcc@mastodon.social avatar

There are many things about git submodules that are more unpleasant than they should be but one of the most frustrating is that you have to decide early whether to add the submodules as git+ssh URLs or https urls. If you pick ssh URLs, your Windows users using GUIs will not be able to check out the submodules. Whereas if you pick https URLs, your Mac and Linux users using the command line will not be able to check out the submodules. Once you have picked one of these choices, you can't change it

shironeko,
@shironeko@fedi.tesaguri.club avatar

@mcc fast-forward to a user trying to use git worktrees.

mcc,
@mcc@mastodon.social avatar

@shironeko I sincerely hope I never have to use git worktrees

oblomov,
@oblomov@sociale.network avatar

@shironeko @mcc hard disagree. Submodules are absolutely the worst designed feature of git, no context. Worktrees are actually very nice, IME.

shironeko,
@shironeko@fedi.tesaguri.club avatar

@oblomov @mcc yeah, the problem is submodules make worktree crap it's pants

oblomov,
@oblomov@sociale.network avatar

@shironeko @mcc oh in that sense. I never had the “opportunity” to use them together and am I glad for that!

ShadSterling,

@oblomov @shironeko @mcc I don’t understand why one would use worktrees rather than cloning an independent local copy

oblomov,
@oblomov@sociale.network avatar

@ShadSterling @shironeko @mcc
I can tell you why I use it: it allows me to work on multiple different branches concurrently while having access to the other ones without having to switch every time, and without any useless duplication. It's particularly useful when some of the branches need to be developed in parallel or with frequent exchange/syncs because you can do it without any intermediate fetch step since the repo is the same.

mcc,
@mcc@mastodon.social avatar

I've gotten some responses expressing surprise at my comment about https submodules not working on Mac/Linux. A better way of putting it would be "Whereas if you pick on https URLs, it will appear at first to work, but then subtly and sometimes catastrophically break in special cases or when you try to perform certain actions, such as setting a github repo as 'private' or attempting to push back to a checked-out submodule, possibly weeks or months after you set the submodule up." Hope this helps

mcc,
@mcc@mastodon.social avatar

Also holy crap I didn't know about this and this fixes the problem really elegantly https://tech.lgbt/@meowbotage/112447397038288106

Unfortunately, in the process of fixing the problem it introduces new and vaguely horrific potential breakages, for example if you migrate a repository from bitbucket to github

alexhammy,
@alexhammy@hachyderm.io avatar

@mcc submodules get a bad rep. A heartily deserved bad rep.

mcc,
@mcc@mastodon.social avatar

@alexhammy They work really well in Mercurial bursts into tears

alexhammy,
@alexhammy@hachyderm.io avatar

@mcc as a former employee of Bitbucket all I can say is oof

mcc,
@mcc@mastodon.social avatar

@alexhammy I am never trusting Atlassian for anything ever again :( :( :(

doomsdayrs,
@doomsdayrs@cyberpunk.lol avatar

@mcc "Whereas if you pick https URLs, your Mac and Linux users using the command line will not be able to check out the submodules. Once you have picked one of these choices, you can't change it" What?

mcc,
@mcc@mastodon.social avatar

@doomsdayrs What?

doomsdayrs,
@doomsdayrs@cyberpunk.lol avatar

@mcc I, don't think I have ever experienced being unable to checkout an https git submodule?

mcc,
@mcc@mastodon.social avatar

@doomsdayrs Have you ever checked out a git submodule with privacy controls (for example, on github)?

doomsdayrs,
@doomsdayrs@cyberpunk.lol avatar

@mcc ah, now it makes sense.

ssh authentication for account verification on UNIX.

HTTPs auth otherwise.

I believe tokens can be setup?

mcc,
@mcc@mastodon.social avatar

@doomsdayrs They can! However they are much easier to set up in GUI versions of git than in the command line one.

mcc,
@mcc@mastodon.social avatar

@doomsdayrs The HTTP versions will also be a lot more awkward even in the public case if at some point you need to push a commit back to the server

glyph,
@glyph@mastodon.social avatar

@mcc @doomsdayrs I bit the bullet and set up tokens and have been using https urls exclusively for like 5 years now and it’s so totally worth it

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • DreamBathrooms
  • everett
  • osvaldo12
  • magazineikmin
  • thenastyranch
  • rosin
  • normalnudes
  • Youngstown
  • Durango
  • slotface
  • ngwrru68w68
  • kavyap
  • mdbf
  • InstantRegret
  • JUstTest
  • ethstaker
  • GTA5RPClips
  • tacticalgear
  • Leos
  • anitta
  • modclub
  • khanakhh
  • cubers
  • cisconetworking
  • megavids
  • provamag3
  • tester
  • lostlight
  • All magazines