-
-
Notifications
You must be signed in to change notification settings - Fork 107
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
add undo-commit command #115
base: master
Are you sure you want to change the base?
Conversation
Hi @chriswalz, can you review and tell me what i'm missing in this PR |
Hi @rustiever nice job I think you're pretty close although I haven't tested your code. Here is the key change. The api should be: In terms of changing the code anywhere you have Suggestion tree for
|
log.Debug().Err(err).Send() | ||
} | ||
} | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After this line you'll need Args: cobra.ExactArgs(1),
to force the user to pass in a subcommand for bit fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @chriswalz i added fix as command and undo-commit as sub command to fix command. Hence i added cobra.NoArgs
. Pls check and test the code. Tell me if something wrong. I'm happy to take your suggestions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chriswalz could you take look into this?
Short: "Undo your previous commit if it is not yet pushed to repository", | ||
Args: cobra.NoArgs, | ||
Run: func(cmd *cobra.Command, args []string) { | ||
if IsAheadOfCurrent() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From lines 13-17 should be wrapped in this code
arg := args[0]
if (arg == "undo-commit") {
// undo commit code
}
#64