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

Added a directory for checks from Fowler's. Added a check for 'waxed … #391

Merged
merged 3 commits into from
Mar 18, 2016
Merged

Conversation

tkmharris
Copy link
Contributor

…lyrically' &c.

@suchow
Copy link
Member

suchow commented Mar 15, 2016

Thanks. Is the quote in the docstring taken directly from a book? (I see an incorrect form of "Its" in the first line, which would be funny if real.)

@tkmharris
Copy link
Contributor Author

Ah no, that's probably my typo in copying. Shall I correct it before merging?

@suchow
Copy link
Member

suchow commented Mar 15, 2016

Yes please — maybe we should have proselint run on its own source!

@tkmharris
Copy link
Contributor Author

Do I need to squash these together. If so, how?

@suchow
Copy link
Member

suchow commented Mar 15, 2016

Here's a walkthrough of the process I would use:

A. Run git log to see the history, which we'll use to figure out what to do next:

commit db7e6d4c94925ed96804b444f85099feae2df470
Merge: 1a9fe7f 5849981
Author: tkmharris <tkmharris@gmail.com>
Date:   Tue Mar 15 10:56:59 2016 +0000

    Merge branch 'wax' of https://github.com/tkmharris/proselint into wax

commit 1a9fe7fb127cdcba128ef3aa6367b4906907dca8
Author: tkmharris <tkmharris@gmail.com>
Date:   Tue Mar 15 10:56:04 2016 +0000

    Fixed typo.

commit 5849981d7845fa20ef24cda0bc5b944d0f9e9d35
Merge: e4166fa 33a96fe
Author: Tom Harris <tkmharris@gmail.com>
Date:   Tue Mar 15 10:11:14 2016 +0000

    Merge branch 'master' into wax

commit 33a96febefa0ae490550c7f7cacc751c56b194c4
Merge: c4cfa31 9fa9e50
Author: Jordan Suchow <suchow@post.harvard.edu>
Date:   Mon Mar 14 23:46:20 2016 -0700

    Merge pull request #392 from tkmharris/superior

    Added check for inferior/superior to/than.

commit c4cfa315e6e9d1b96f555cfcf8911a0cefc5b8d6
Merge: c6f3141 9d19f63
Author: Jordan Suchow <suchow@post.harvard.edu>
Date:   Mon Mar 14 17:20:00 2016 -0700

    Merge pull request #398 from lcd047/syntastic

    Fix the Vim plugin to work with older versions of syntastic

commit 9d19f631513eb2affbe7d201f210cc89613f8817
Author: LCD 47 <lcd047@gmail.com>
Date:   Mon Mar 14 21:28:00 2016 +0200

    Fix the Vim plugin to work with older versions of syntastic.

commit 9fa9e506707957820a08918de5d41c1b4dbdf76b
Author: tkmharris <tkmharris@gmail.com>
Date:   Mon Mar 14 11:21:04 2016 +0000

    Added check for inferior/superior to/than.

commit e4166fac9797f327007bd9f62365eec8278cd468
Author: tkmharris <tkmharris@gmail.com>
Date:   Mon Mar 14 11:00:43 2016 +0000

    Added a directory for checks from Fowler's. Added a check for 'waxed lyrically' &c.

commit c6f3141adf4e404c83cfb2af20599652213c3ff6
Merge: a4f604f ac95f26
Author: Jordan Suchow <suchow@post.harvard.edu>
Date:   Sun Mar 13 23:40:36 2016 -0700

    Merge pull request #388 from amperser/run-over-directory

    Make it possible to run `proselint .` over a directory

B. We see commit e4166fa, which is your original addition of the Fowler check; a merge commit 5849981; the typo fix 1a9fe7f; and another merge commit db7e6d4. From this, the plan is to squash the original & typo fix into one commit, remove the merge commits, and rebase over master.

C. To do this, we will first rebase in interactive mode: git rebase --interactive c6f3141adf4e404c83cfb2af20599652213c3ff6. Note that the commit hash is earlier than the earliest commit we want to manipulate. This will produce the following:

pick e4166fa Added a directory for checks from Fowler's. Added a check for 'waxed lyrically' &c.
pick 1a9fe7f Fixed typo.
pick 9d19f63 Fix the Vim plugin to work with older versions of syntastic.
pick 9fa9e50 Added check for inferior/superior to/than.

# Rebase c6f3141..db7e6d4 onto c6f3141 (4 command(s))
#
# Commands:
# p, pick = use commit
# r, reword = use commit, but edit the commit message
# e, edit = use commit, but stop for amending
# s, squash = use commit, but meld into previous commit
# f, fixup = like "squash", but discard this commit's log message
# x, exec = run command (the rest of the line) using shell
#
# These lines can be re-ordered; they are executed from top to bottom.
#
# If you remove a line here THAT COMMIT WILL BE LOST.
#
# However, if you remove everything, the rebase will be aborted.
#
# Note that empty commits are commented out

D. Resort the four pick lines so that the commits we want to squash are adjacent:

pick e4166fa Added a directory for checks from Fowler's. Added a check for 'waxed lyrically' &c.
pick 9d19f63 Fix the Vim plugin to work with older versions of syntastic.
pick 1a9fe7f Fixed typo.
pick 9fa9e50 Added check for inferior/superior to/than.

E. Change pick to squash for any commit we want to combine with a later commit:

pick e4166fa Added a directory for checks from Fowler's. Added a check for 'waxed lyrically' &c.
pick 9d19f63 Fix the Vim plugin to work with older versions of syntastic.
pick 1a9fe7f Fixed typo.
squash 9fa9e50 Added check for inferior/superior to/than.

F. Save. This will bring up a screen where you can edit the commit message:

# This is a combination of 2 commits.
# The first commit's message is:

Fixed typo.

# This is the 2nd commit message:

Added check for inferior/superior to/than.

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# Author:    tkmharris <tkmharris@gmail.com>
# Date:      Tue Mar 15 10:56:04 2016 +0000
#
# rebase in progress; onto c6f3141
# You are currently editing a commit while rebasing branch 'pr/391' on 'c6f3141'.
#
# Changes to be committed:
#   new file:   proselint/checks/fowlers/inferior_superior.py
#   modified:   proselint/checks/fowlers/waxed.py
#

G. Edit it so that the only uncommented line is your commit message:

Added check for inferior/superior to/than.

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# Author:    tkmharris <tkmharris@gmail.com>
# Date:      Tue Mar 15 10:56:04 2016 +0000
#
# rebase in progress; onto c6f3141
# You are currently editing a commit while rebasing branch 'pr/391' on 'c6f3141'.
#
# Changes to be committed:
#   new file:   proselint/checks/fowlers/inferior_superior.py
#   modified:   proselint/checks/fowlers/waxed.py
#

H. Save. Now your history is cleaner.

I. Rebase over master, git rebase master:

❯ git rebase master
First, rewinding head to replay your work on top of it...
Applying: Added a directory for checks from Fowler's. Added a check for 'waxed lyrically' &c.
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
Applying: Added check for inferior/superior to/than.
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...

J. Push your branch — you'll need to use the --force flag because your history and the one on GitHub are incompatible because we edited the history: git push --force.

K. Fin.

@tkmharris
Copy link
Contributor Author

Okay, done. Thanks for helping me out.

suchow added a commit that referenced this pull request Mar 18, 2016
Added a directory for checks from Fowler's. Added a check for 'waxed …
@suchow suchow merged commit c7007de into amperser:master Mar 18, 2016
@tkmharris tkmharris deleted the wax branch March 28, 2016 20:43
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.

3 participants