kowainik / hit-on

:octocat: Kowainik Git Workflow Helper Tool
https://kowainik.github.io/projects/hit-on
Mozilla Public License 2.0
77 stars 13 forks source link

Add flag to `hit amend` not to perform push #107

Closed chshersh closed 5 years ago

chshersh commented 5 years ago

Sometimes I want to amend a commit but locally because later I may want to do hit fresh or hit sync or something else. It would be nice to have a flag for hit amend not to push. But I have no idea how to call it. Any suggestions? :slightly_smiling_face:

vrom911 commented 5 years ago

-n? We are using it for commit command to not add issue number.

chshersh commented 5 years ago

@vrom911 Good idea! I was also thinking about [-l|--local]

Nimor111 commented 5 years ago

I'd like to take this if possible. :) Anything I should look out for specifically? Also, will be my first haskell contribution, hope I can learn some good practices from it.

vrom911 commented 5 years ago

Thanks @Nimor111 :+1: Basically, the task is to patch this option:

https://github.com/kowainik/hit-on/blob/master/src/Hit/Cli.hs#L72

to have a boolean field which would turn-off the push for this command. (By default it still should be pushing). In optparse-applicative parser you should add the option -l | --local which would be responsible for that. And, finally, runAmend function should be patched accordingly:

https://github.com/kowainik/hit-on/blob/master/src/Hit/Git.hs#L139-L143

Good luck with the first Haskell contribution! Hope we can be helpful in the review :slightly_smiling_face:

Nimor111 commented 5 years ago

Thanks for the great pointers!