Skip to content

Instantly share code, notes, and snippets.


Peter Johnston peterwj

  • Pilot
  • San Francisco
Block or report user

Report or block peterwj

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
peterwj / pre-commit
Created May 12, 2017
git pre-commit gist for catching merge conflict markers
View pre-commit
#!/usr/bin/env python3
import subprocess
import sys
def get_diff():
base_commit =['git', 'rev-parse', '--verify', 'HEAD'], stdout=subprocess.PIPE).stdout.decode('utf-8').strip()
return['git', 'diff', '--cached', base_commit], stdout=subprocess.PIPE).stdout.decode('utf-8').strip()
def check_for_merge_markers(diff):

Keybase proof

I hereby claim:

  • I am peterwj on github.
  • I am peterwj ( on keybase.
  • I have a public key whose fingerprint is C342 CA4C 5B21 18A8 436D 88D8 A2D9 2D85 8EF2 0FEC

To claim this, I am signing this object:

You can’t perform that action at this time.