comby
comby copied to clipboard
"git add -p" upon acceptance of a change with -review
Hi, long time codemod user here.
One thing that has always annoyed me in the workflow of hunk-by-hunk interactively accepting changes, is that afterwards, I still have to add all the changes to the index using git add -p
which is also interactive. (I could do git add .
but i often have changes i don't want to commit)
consider this a low-priority request, but it would be nice that whenever i interactively accept a change, it (and only that particular change i just agreed to apply) could also be added to the git index.
Thanks for sharing your experience and workflow. I wasn't aware of this one and its valuable to know about! Should be straightforward so I'll see if I can add it in the next release :-)
I'd like to contribute. Can I give it a try on this one? @rvantonder
hi @diasbruno go for it! I haven't too deeply about it but I think the easiest is to add a new apply_patch_with_git
analogous to the existing apply_patch
function in interactive.ml
. Then just add another option in the review menu that says something like "accept as git patch" (I think somewhere around this code in the same file)
Great. I'll see what I can do. When the functionality is ready we can decide for the cli command.
shouldn't need to do anything for CLI options, can just make it part of the review menu when -review
is set (and can detect whether the directory is a git
repository, all in interactive.ml
)
hmmm...-review
looks great. I was think if it would conflict with -in-place
.
Totally misunderstood the -review
flag...I thought it was a new feature. :joy:
Finally, I got sometime to implement this. sorry for taking so long.