'next steps' should omit git init
if we are already in a git repo
when creating a svelte kit app ask to initialize a git repo if git
is installed and the target directory is not a git repo already
fixes #287
If you're creating a new app inside a git repo, 'next steps' includes this...
git init && git add -A && git commit -m "Initial commit" (optional)
...and it should probably just say nothing
i'd be in favor of turning the option around entirely
automatically call git init
unless --no-git-init was passed or we are in a git project already.
if one was initialized, add "we initialized git for you, if you don't need that, run `rm -rf .git" to next steps
(edit: only if git
is installed, we are in a tty and CI
is false)
I think we should just get rid of it. It's unnecessary clutter for people that already know git, and it's a line full of funny words and symbols for those that don't. It's not very helpful in either case
I think best option would be to ask to initialise a git repo if git is installed and the directory is already not a git repo.
example from create-remix
I think there's a bunch of different ways we could go with this. E.g. it could be:
Initialize a new source control repository?
- git
- svn
- mercurial
- none
We could also have a file like ~/.svelte/cli/config.json
that remembers your preferences. Rich had suggested he'd also like to see his preference for package manager to be remembered
Then I think the other big question might be something like:
What commits should we create?
- a single initial commit
- a commit for each integration
- none
We could also potentially do nothing by default and not have any questions, but have text at the bottom of the screen that says something like Ctrl + P to edit preferences
Are svn
and mercurial
still a thing? I was unable to find any usage statistics about that, but i would assume that nowadays 95% are using git
, especially if you are trying to create a new project.
What commits should we create? - a single initial commit - a commit for each integration - none
I think such a question would make sense.
I'm not a fan of the preferences though, at least at the current stage. I do think this might make more sense in the future, once we integrate the other tools more deeply.
i would assume that nowadays 95% are using git
I think that's about right
once we integrate the other tools more deeply
Which tools were you thinking of?
i would assume that nowadays 95% are using git
I think that's about right
So why bother about the other vcs? As we have done a number of times for other decision, we shouldn't bother about those minor minorities.
once we integrate the other tools more deeply
Which tools were you thinking of?
I was especially thinking about migrate
for whatever reason. Background is that currently i'm at max using sv
11 times (10 adders + 1 project creation) and I don't think it's worth the effort and trouble at this point.
But as soon as we implement #278 i.e. you might be using sv
an unlimited amount of time, where it might make sense to add such prefernces.
Yeah, fair enough to not ask about the other version control software. Maybe we can combine the two questions then into a single question:
Would you like a git repo to be created?
- yes, with a commit for each integration
- yes, with a single initial commit
- no
I'm still against adding a git option entirely, but if I had to choose, simply initializing the repo like this: #287 (comment) should be sufficient.
Would you like a git repo to be created?
- yes, with a commit for each integration
- yes, with a single initial commit
- no
I don't think a commit per add-on
option provides any real value
I think asking if you want to initialize a git repo isn't very valuable if that's all you do. git init
is so easy to do. Something like git init && git add -A && git commit -m "Initial commit"
where you're running three different commands for the user provides more value though.