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

Fix/cli/525/git setup remote already exists #527

Merged
merged 5 commits into from Mar 12, 2020

Conversation

cyrille-sg
Copy link

@cyrille-sg cyrille-sg commented Mar 11, 2020

Offer a option --force to the command git-setup to allow the user to override the current remote handle with a new remote url

Fix #525

User

  • New flag "--force" on "git-seup"
  • Suggestion message to use force when already remote handle already exist
    Tech
  • Propose change in errors management (using utils.Wrap instead of in place errgo.Notef)

@cyrille-sg cyrille-sg requested a review from Soulou Mar 11, 2020
cmd/git.go Outdated
@@ -29,7 +32,8 @@ var (
}

err := git.Setup(appdetect.CurrentApp(c), git.SetupParams{
RemoteName: c.String("r"),
RemoteName: c.String("r"),
Copy link
Member

@Soulou Soulou Mar 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the long flag name for a better readability

git/setup.go Outdated
errWrapped := utils.WrapError(err, "fail to create the Git remote")
if err == git.ErrRemoteExists {
errWrapped = utils.WrapError(err, "fail to create the Git remote"+
" (maybe you want use the force option to override the remote url)")
Copy link
Member

@Soulou Soulou Mar 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fail to configure git repository, "%v" remote already exists. (Use --force option to override)

@cyrille-sg cyrille-sg requested a review from Soulou Mar 11, 2020
Copy link
Member

@Soulou Soulou left a comment

Actually something is still missing here, usually when we modify the CLI behavior, we add in the PR a console output showing the new feature/fix. Could you please add that?

@cyrille-sg
Copy link
Author

@cyrille-sg cyrille-sg commented Mar 11, 2020

Screenshot from 2020-03-11 11-39-07

@cyrille-sg cyrille-sg requested a review from Soulou Mar 11, 2020
@Soulou
Copy link
Member

@Soulou Soulou commented Mar 11, 2020

As spoken orally, the error displayed to the user is not right (repetition), to make it cleaner, it requires some changes in way we're handling error and probably to modify https://github.com/Scalingo/go-scalingo/errors

Copy link
Member

@Soulou Soulou left a comment

See previous comment

@cyrille-sg cyrille-sg requested a review from Soulou Mar 12, 2020
@Soulou
Copy link
Member

@Soulou Soulou commented Mar 12, 2020

After disucssion, we accept this version, better error management will be handled later

@Soulou Soulou merged commit c18b51d into master Mar 12, 2020
1 check passed
@Soulou Soulou deleted the fix/cli/525/git-setup-remote-already-exists branch Mar 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants