Skip to content

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

Open
@Rich-Harris

Description

@Rich-Harris
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

Activity

dominikg

dominikg commented on Nov 9, 2024

@dominikg
Member

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

AdrianGonz97 commented on Nov 10, 2024

@AdrianGonz97
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

BlankParticle commented on Nov 22, 2024

@BlankParticle
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

benmccann

benmccann commented on Nov 25, 2024

@benmccann
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

manuel3108 commented on Nov 27, 2024

@manuel3108
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

benmccann commented on Nov 27, 2024

@benmccann
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

manuel3108 commented on Nov 27, 2024

@manuel3108
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

benmccann commented on Nov 27, 2024

@benmccann
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

AdrianGonz97 commented on Nov 27, 2024

@AdrianGonz97
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

benmccann commented on Nov 27, 2024

@benmccann
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @benmccann@dominikg@Rich-Harris@manuel3108@AdrianGonz97

      Issue actions

        'next steps' should omit `git init` if we are already in a git repo · Issue #287 · sveltejs/cli