public
Description: scripts that can help with using Changes.app and git
Clone URL: git://github.com/danimal/git-chdiff-scripts.git
Search Repo:
add a script to handle GIT_EXTERNAL_DIFF environment variable with git.
danimal (author)
Wed Feb 27 13:12:46 -0800 2008
commit  bb5f09fe3a619a7442c2eca1da46cc0bf877306f
tree    7c5b96895c1a06d6ec546c1592287cfb1efbd06f
parent  d9bff8995534f9b7faca06f78d2e13ff2fd908c3
...
106
107
108
109
 
110
111
112
...
106
107
108
 
109
110
111
112
0
@@ -106,7 +106,7 @@
0
             if option in ('-w', '--wait'):
0
                 wait = True
0
                 del(argv[argv.index(option)])
0
- if option in ('-v', '--version'):
0
+ if option in ('-v', '--verbose'):
0
                 verbose = True
0
                 del(argv[argv.index(option)])
0
     except Usage, err:
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
0
@@ -1 +1,54 @@
0
+#!/usr/bin/env python
0
+# encoding: utf-8
0
+"""
0
+git-external-chdiff
0
+
0
+Created by Dan Weeks (dan [AT] danimal [DOT] org) on 2008-02-27.
0
+Released to the Public Domain.
0
+"""
0
+
0
+import sys
0
+import subprocess
0
+import os
0
+
0
+help_message = '''
0
+git-external-chdiff [old-file] [new-file]
0
+
0
+display diffs of git files using the chdiff utility
0
+as a proxy for GIT_EXTERNAL_DIFF via git
0
+'''
0
+
0
+def main(argv=None):
0
+ """
0
+ the basic work location
0
+ """
0
+
0
+ # set up the defaults
0
+ wait = True
0
+ verbose = False
0
+
0
+ # pull the file names from the args passed in via git
0
+ oldFile = sys.argv[2]
0
+ newFile = sys.argv[5]
0
+ try:
0
+ waitFlag = ''
0
+ if wait:
0
+ waitFlag = '--wait'
0
+ if verbose:
0
+ print 'git-external-chdiff: comparing %s %s' % (oldFile, newFile)
0
+ p = subprocess.Popen('chdiff %s %s %s' % (waitFlag,
0
+ oldFile,
0
+ newFile),
0
+ env=os.environ,
0
+ shell=True,
0
+ stdout=subprocess.PIPE,
0
+ stderr=subprocess.STDOUT)
0
+ p.wait()
0
+ # ugh, this is sloppy, but we only know to clean up
0
+ # if a chdiff wait is specified, so tidy up now
0
+ except OSError, e:
0
+ print >>sys.stderr, 'Execution failed:', e
0
+
0
+if __name__ == '__main__':
0
+ sys.exit(main())

Comments

    No one has commented yet.