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

[Feature] Create a "git init" sub-generator #6453

Closed
jdubois opened this Issue Oct 2, 2017 · 13 comments

Comments

Projects
None yet
4 participants
@jdubois
Member

jdubois commented Oct 2, 2017

This is the same idea as #6440

I would like to have a small sub-generator for Git:

  • jhipster git-init would initialize a Git repository, add all files to it, and commit with message "Initial application generation by JHipster" (like https://start.jhipster.tech does today)
  • This would run by default after each generation, but could be disabled with a flag

I'm also wondering if we could have the same after an entity is generated, but I'm less sure it's a good idea.

@sendilkumarn sendilkumarn self-assigned this Oct 2, 2017

@deepu105

This comment has been minimized.

Show comment
Hide comment
@deepu105

deepu105 Oct 2, 2017

Member

@jdubois should this be a sub-generator? do you foresee use beyond the initial generation? if not we could do it after initial generation using our builtIn gitExec command in 3 lines

Member

deepu105 commented Oct 2, 2017

@jdubois should this be a sub-generator? do you foresee use beyond the initial generation? if not we could do it after initial generation using our builtIn gitExec command in 3 lines

@jdubois

This comment has been minimized.

Show comment
Hide comment
@jdubois

jdubois Oct 2, 2017

Member

Indeed, it would be easier to maintain if that was inside the main generator

Member

jdubois commented Oct 2, 2017

Indeed, it would be easier to maintain if that was inside the main generator

@deepu105

This comment has been minimized.

Show comment
Hide comment
@deepu105

deepu105 Oct 2, 2017

Member

so you ok to do it directly in the app generator without a sub gen?

Member

deepu105 commented Oct 2, 2017

so you ok to do it directly in the app generator without a sub gen?

@jdubois

This comment has been minimized.

Show comment
Hide comment
@jdubois

jdubois Oct 2, 2017

Member

yes you are correct, it would be better inside the main generator, so no sub gen

Member

jdubois commented Oct 2, 2017

yes you are correct, it would be better inside the main generator, so no sub gen

@PierreBesson

This comment has been minimized.

Show comment
Hide comment
@PierreBesson

PierreBesson Oct 2, 2017

Contributor

@sendilkumarn that was fast !
But when regenerating the application, should we still have the "initial generation" message ?
Also it would be great to have the jhipster version in the commit message and I think we should add a log like this : "Automatically committing all generated files to git, to prevent this behavior use jhipster --skip-git".

Contributor

PierreBesson commented Oct 2, 2017

@sendilkumarn that was fast !
But when regenerating the application, should we still have the "initial generation" message ?
Also it would be great to have the jhipster version in the commit message and I think we should add a log like this : "Automatically committing all generated files to git, to prevent this behavior use jhipster --skip-git".

@jdubois

This comment has been minimized.

Show comment
Hide comment
@jdubois

jdubois Oct 2, 2017

Member

Yes @PierreBesson that's a nice message - but anyway if this doesn't suit the user, he just needs to do rm -rf .git, that's not very hard.
@sendilkumarn @deepu105 we also need to check if Git is installed, and I have some comments here:

  • If Git isn't installed, let's just do a nice log message saying "The generated application could not be added to Git, as Git is not installed on your system"
  • But we still require to install Git at http://www.jhipster.tech/installation/ -> I think this comes from the old times when we were using Bower, is it still required today? This would make the installation even easier
Member

jdubois commented Oct 2, 2017

Yes @PierreBesson that's a nice message - but anyway if this doesn't suit the user, he just needs to do rm -rf .git, that's not very hard.
@sendilkumarn @deepu105 we also need to check if Git is installed, and I have some comments here:

  • If Git isn't installed, let's just do a nice log message saying "The generated application could not be added to Git, as Git is not installed on your system"
  • But we still require to install Git at http://www.jhipster.tech/installation/ -> I think this comes from the old times when we were using Bower, is it still required today? This would make the installation even easier
@deepu105

This comment has been minimized.

Show comment
Hide comment
@deepu105

deepu105 Oct 2, 2017

Member

Git is still required due to our upgrade sub gen

Member

deepu105 commented Oct 2, 2017

Git is still required due to our upgrade sub gen

@sendilkumarn

This comment has been minimized.

Show comment
Hide comment
@sendilkumarn

sendilkumarn Oct 2, 2017

Contributor

@jdubois git is still required by sub gen. I have added this nice log message 😉

But when regenerating the application, should we still have the "initial generation" message ?

@PierreBesson that is indeed an awesome idea.

Contributor

sendilkumarn commented Oct 2, 2017

@jdubois git is still required by sub gen. I have added this nice log message 😉

But when regenerating the application, should we still have the "initial generation" message ?

@PierreBesson that is indeed an awesome idea.

@jdubois

This comment has been minimized.

Show comment
Hide comment
@jdubois

jdubois Oct 2, 2017

Member

Thanks @sendilkumarn - and yes we can still require Git, I'm not sure many people use the upgrade sub-generator, but as of today everybody uses Git, so it's not much an issue.
When we re-generate the application I wouldn't do any Git commit -> it's different from generating a new app, where initializing the repo is important (and that's 3 commands in total)

Member

jdubois commented Oct 2, 2017

Thanks @sendilkumarn - and yes we can still require Git, I'm not sure many people use the upgrade sub-generator, but as of today everybody uses Git, so it's not much an issue.
When we re-generate the application I wouldn't do any Git commit -> it's different from generating a new app, where initializing the repo is important (and that's 3 commands in total)

@sendilkumarn

This comment has been minimized.

Show comment
Hide comment
@sendilkumarn

sendilkumarn Oct 2, 2017

Contributor

Added a condition to check whether git init has already happened

Contributor

sendilkumarn commented Oct 2, 2017

Added a condition to check whether git init has already happened

@jdubois

This comment has been minimized.

Show comment
Hide comment
@jdubois

jdubois Oct 11, 2017

Member

I'm going to change this a little bit: this creates quite a lot of log messages at the end of a project generation, and this is confusing (it hides the more important messages above). So I'm going to remove most log messages - I'll link the commit here, please add comments if you disagree.

Member

jdubois commented Oct 11, 2017

I'm going to change this a little bit: this creates quite a lot of log messages at the end of a project generation, and this is confusing (it hides the more important messages above). So I'm going to remove most log messages - I'll link the commit here, please add comments if you disagree.

@jdubois

This comment has been minimized.

Show comment
Hide comment
@jdubois

jdubois Oct 11, 2017

Member

Sorry I did a wrong commit above!

Member

jdubois commented Oct 11, 2017

Sorry I did a wrong commit above!

@jdubois

This comment has been minimized.

Show comment
Hide comment
@jdubois

jdubois Oct 11, 2017

Member

So I removed the logs, but I'm not sure it's good for error handling.... Anyway, as long as Git is installed, all commands should work (if you can do a git init, I don't understand how a git add .would fail)

Member

jdubois commented Oct 11, 2017

So I removed the logs, but I'm not sure it's good for error handling.... Anyway, as long as Git is installed, all commands should work (if you can do a git init, I don't understand how a git add .would fail)

jdubois added a commit that referenced this issue Oct 11, 2017

jdubois added a commit to jhipster/jhipster.github.io that referenced this issue Oct 11, 2017

danielpetisme added a commit to danielpetisme/generator-jhipster that referenced this issue Oct 11, 2017

@jdubois jdubois added this to the 4.10.0 milestone Oct 17, 2017

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