Skip to content
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

"git add -p" upon acceptance of a change with -review #134

Open
Dieterbe opened this issue Nov 18, 2019 · 7 comments · May be fixed by #350
Open

"git add -p" upon acceptance of a change with -review #134

Dieterbe opened this issue Nov 18, 2019 · 7 comments · May be fixed by #350
Labels
enhancement New feature or request

Comments

@Dieterbe
Copy link

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.

@rvantonder
Copy link
Member

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 :-)

@rvantonder rvantonder added the enhancement New feature or request label Nov 19, 2019
@diasbruno
Copy link

I'd like to contribute. Can I give it a try on this one? @rvantonder

@rvantonder
Copy link
Member

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)

@diasbruno
Copy link

Great. I'll see what I can do. When the functionality is ready we can decide for the cli command.

@rvantonder
Copy link
Member

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)

@diasbruno
Copy link

hmmm...-review looks great. I was think if it would conflict with -in-place.

@diasbruno
Copy link

Totally misunderstood the -review flag...I thought it was a new feature. 😂

Finally, I got sometime to implement this. sorry for taking so long.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants