feature: accept hunks and stage selected changes on git...#350
feature: accept hunks and stage selected changes on git...#350diasbruno wants to merge 2 commits intocomby-tools:masterfrom
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.
@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.
seems reasonable! does this command work for all kinds of shells? bash / sh / zsh?
There was a problem hiding this comment.
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