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

Formatting changes from feature/test-cleanup #432

Closed
wants to merge 4 commits into from

Conversation

vinhowe
Copy link
Member

@vinhowe vinhowe commented Oct 29, 2020

Various Black formatting changes. Black takes a philosophical stance against range formatting, so formatting just my section of code is harder.

The diff on feature/test-cleanup was cluttered with unrelated formatting changes that were mixed in with other commits. For reference, my painful, roundabout process for "moving" those changes out wholesale was:

  1. Start with a clean working directory
  2. git diff origin/develop HEAD > changes.patch to get a patch file of all changes made since
  3. git apply -R changes.patch, where -R applies the patch file as a "reset" (or "reverse"), to create a set of unstaged changes that would negate the diff of the PR if committed. This commit wouldn't actually "undo" the changes because history is preserved, but the result is the same. If we use the equality 1 + 2 + 3 + -6 = 0 as an analogy, these changes are the 6.
  4. git add --patch to selectively stage formatting removal changes
  5. git diff --staged -R > formatting.patch to get an inverted patch file that adds formatting changes. git diff --staged shows us all of the formatting changes we staged to remove, so git diff --staged -R reverses that.
  6. Commit the staged formatting removal changes
  7. git checkout HEAD . to get rid of remaining unstaged changes on feature/test-cleanup
  8. git checkout -b test-cleanup-formatting to create a new branch off of feature/test-cleanup
  9. git apply formatting.patch to apply formatting changes + stage + commit

If you see something that could have been done more simply (besides making more specific commits in the first place), let me know in a comment.

@vinhowe vinhowe changed the base branch from develop to feature/test-cleanup October 29, 2020 21:11
@vinhowe vinhowe requested a review from daniekpo October 30, 2020 21:23
@MaxRobinsonTheGreat MaxRobinsonTheGreat changed the base branch from feature/test-cleanup to develop November 2, 2020 22:18
@MaxRobinsonTheGreat MaxRobinsonTheGreat changed the base branch from develop to feature/test-cleanup November 2, 2020 22:22
@vinhowe vinhowe closed this Nov 2, 2020
@vinhowe vinhowe deleted the test-cleanup-formatting branch November 11, 2020 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant