-
Notifications
You must be signed in to change notification settings - Fork 62
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: accept hunks and stage selected changes on git... #350
base: master
Are you sure you want to change the base?
feature: accept hunks and stage selected changes on git... #350
Conversation
606a942
to
9aa0ceb
Compare
using the -review we can interactively select which changes we will accept. a new option is added to allow users to accept the patch and also automatically stage the changes (currently only git is supported).
9aa0ceb
to
c8e9929
Compare
@diasbruno I gave this a try and looks good to me! If you're done making changes just let me know or request review, and I can go ahead with merge |
There are a few cases I still need to check. Depending on whether the file is already versioned or not, the patch fails, and, some cases depending on the status of the file in the working tree. If the file is not on the git tree, we may need to fallback to just do a normal patch, or, check it before presenting the option (remove the "g" option if the file isn't on git). |
>>= fun status -> | ||
match status with | ||
| Lwt_unix.WEXITED x -> Lwt_io.printf "[debug] %d\n" x |> ignore; return (x == 0) | ||
| _ -> return false |
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.
@rvantonder is it too much trouble to do this check?
It still not complete, need to check if the command is ok (if the git command fails because it doesn't exist or something...).
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.
This should be ok.
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.
seems reasonable! does this command work for all kinds of shells? bash
/ sh
/ zsh
?
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.
test
is from coreutils, so it must be everywhere, except windows, maybe...
4f29e70
to
9e5c1d4
Compare
when applying to the stage area, if the file is not already commited on the repository the patch will fail. we show the option only if the file is already commited.
9e5c1d4
to
28e0a69
Compare
using the -review we can interactively select
which changes we will accept.
a new option is added to allow users to accept
the patch and also automatically stage the changes (currently only git is supported).
closes #134