Skip to content
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

'next steps' should omit git init if we are already in a git repo #287

Open
Rich-Harris opened this issue Nov 9, 2024 · 10 comments · May be fixed by #325
Open

'next steps' should omit git init if we are already in a git repo #287

Rich-Harris opened this issue Nov 9, 2024 · 10 comments · May be fixed by #325
Labels
enhancement New feature or request pkg:create

Comments

@Rich-Harris
Copy link
Member

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

@dominikg
Copy link
Member

dominikg commented Nov 9, 2024

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)

@AdrianGonz97
Copy link
Member

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

@BlankParticle
Copy link
Contributor

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
image

@BlankParticle BlankParticle linked a pull request Nov 22, 2024 that will close this issue
@benmccann
Copy link
Member

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

@manuel3108
Copy link
Member

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.

@benmccann
Copy link
Member

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?

@manuel3108
Copy link
Member

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.

@benmccann
Copy link
Member

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

@AdrianGonz97
Copy link
Member

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

@benmccann
Copy link
Member

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.

@manuel3108 manuel3108 added enhancement New feature or request pkg:create labels Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pkg:create
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants