facebookincubator / fastmod

A fast partial replacement for the codemod tool
Apache License 2.0
1.66k stars 41 forks source link

Feature request: Git integration #20

Closed tsoernes closed 4 years ago

tsoernes commented 4 years ago

It would be nice with an option to automatically stage changed lines (only) to git.

Thanks for a great tool!

swolchok commented 4 years ago

What's the use case for having modified files in your checkout before running fastmod? That seems dangerous -- an error in your fastmod invocation could clobber your unstaged changes. Why not commit first?

tsoernes commented 4 years ago

I often have lots of unstaged changes laying around for a long time; only a affecting files which are not applicable to my fastmod use case. Then, when fastmodding lots of files it is time consuming to pick out the files affected by the fastmod invocation.

On Wed, Mar 25, 2020 at 4:20 AM Scott Wolchok notifications@github.com wrote:

What's the use case for having modified files in your checkout before running fastmod? That seems dangerous -- an error in your fastmod invocation could clobber your unstaged changes. Why not commit first?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/facebookincubator/fastmod/issues/20#issuecomment-603602776, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTX3RCTXQG2YSEJUJ5Q3SDRJFS6JANCNFSM4LNNVULA .

swolchok commented 4 years ago

Would running with fastmod foo bar --accept-all --print-changed-files | xargs git add solve this?

tsoernes commented 4 years ago

That's a pretty good start at least. Thanks!

On Wed, Mar 25, 2020, 23:46 Scott Wolchok notifications@github.com wrote:

Would running with fastmod foo bar --accept-all --print-changed-files | xargs git add solve this?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/facebookincubator/fastmod/issues/20#issuecomment-604104788, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTX3RGIN7F6DK555X6DCQ3RJJ3TRANCNFSM4LNNVULA .

swolchok commented 4 years ago

Sounds like you're happy, so closing. Thanks for asking!