operator-sdk new should not git commit

Created on 12 Mar 2019  路  5Comments  路  Source: operator-framework/operator-sdk

Feature Request

Is your feature request related to a problem? Please describe.
Current behavior of the operator-sdk new command tries to initialize the repo and even write an initial commit.
This may seem cool and convenient at first glance but actually it does not work in scenarios where git commit is not intended to be run unattended. For example:

error: gpg failed to sign the data
fatal: failed to write commit object
Error: failed to exec []string{"git", "commit", "-q", "-m", "INITIAL COMMIT"}: exit status 128

Describe the solution you'd like
make git init stage an opt-in option instead of the current default opt-out. Or at least do not try to perform the git commit action on behalf of the user.

needs discussion

All 5 comments

@nrvnrvn The scenario you mentioned seems to be the exception, rather than the norm, and we _think_ most users find it helpful having a clean untouched project from which to begin working and to which they can revert, if necessary.

As you alluded to, you can use operator-sdk new --skip-git-init if an initial git commit is undesirable.

There was some discussion in the original PR, so I'll leave this open for more discussion and community input.

/cc @hasbro17 @estroz

read through the initial PR. Git init is actually helpful.
committing everything is questionable though.

I gotta side with @nrvnrvn here - git init should be opt-in, not opt-out. This doesn't seem like expected behavior of a scaffold.

Whether to git init by default or not is a personal preference IMO, so we should leave this functionality as-is.

Personally, I found it confusing that git init was already run. Then even more confusing that git commit has been performed.

Was this page helpful?
0 / 5 - 0 ratings