RefactoringTools / HaRe

The Haskell Refactoring Tool
http://www.cs.kent.ac.uk/projects/refactor-fp/
Other
139 stars 32 forks source link

Output a patch instead #65

Open sniperrifle2004 opened 6 years ago

sniperrifle2004 commented 6 years ago

I was wondering if it would be possible for ghc-hare to produce a patch or a diff instead of refactored files.

anka-213 commented 6 years ago

I don't know enough about this project to answer your question, but if you are using a VCS (e.g. git), which you should be, creating a patch from the new files is a trivial task:

  1. Make sure your repository is clean. Commit or stash any current changes. (Run git status to check)
  2. Run HaRe
  3. Run git diff > changes.patch to save the diff in changes.patch.
  4. (optional) Run git reset --hard to restore your repository and revert the changes.