#!/usr/bin/env python
'''This lets you run "git webdiff" instead of "git difftool".'''

import os
import subprocess
import sys


def any_nonflag_args(args):
    """Do any args not start with '-'? If so, this isn't a HEAD diff."""
    return len([x for x in args if not x.startswith('-')]) > 0


def run():
    if not any_nonflag_args(sys.argv[1:]):
        # This tells webdiff that it was invoked as a simple "git webdiff", not
        # "git webdiff <sha>". This allows special treatment (e.g. for
        # staging diffhunks).
        os.environ['WEBDIFF_FROM_HEAD'] = 'yes'
    
    sys.exit(subprocess.call(
        'git difftool -d -x webdiff'.split(' ') + sys.argv[1:]))


if __name__ == '__main__':
    run()

@@ -575,26 +575,26 @@
 es'%0A
+%0A
     
+try:
 %0A    
-sys.exit(
+    
 subp
@@ -605,25 +605,16 @@
 ss.call(
-%0A        
 'git dif
@@ -660,17 +660,130 @@
 rgv%5B1:%5D)
-)
+%0A    except KeyboardInterrupt:%0A        # Don't raise an exception to the user when sigint is received%0A        pass
 %0A%0A%0Aif __

Exit cleanly from 'git webdiff'