Last active
August 29, 2015 14:22
-
-
Save n0mimono/30d8d476e3adef69cd9c to your computer and use it in GitHub Desktop.
git diff HEAD\^ HEAD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
from subprocess import call | |
import sys | |
if __name__ == '__main__': | |
if len(sys.argv) == 1: | |
old_n = 1 | |
new_n = 0 | |
elif len(sys.argv) == 2: | |
old_n = int(sys.argv[1]) | |
new_n = 0 | |
else: | |
old_n = int(sys.argv[1]) | |
new_n = int(sys.argv[2]) | |
old_commit = "HEAD" + "^"*old_n | |
new_commit = "HEAD" + "^"*new_n | |
call(["git", "diff", old_commit, new_commit]) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment