Git diff - external viewer - get all diff results

When external diff is configured, the results are displayed on each file, i.e. to see the differences for the next file, close the currently running diff manager.

Is there any way to make git run all diff view processes in parallel?

If I just start the process from an external diff script, apparently git deletes the temporary files that it uses for comparison.

So

#!/usr/bin/python import subprocess import sys p = subprocess.Popen(('/usr/bin/meld', sys.argv[2], sys.argv[5])) #p.wait() 

does not work, when displaying meld 'Could not read from' / tmp / .diff_VlLwKF '

However, if I uncomment

 #p.wait() 

everything works fine, but then again, it's serial spawning, not parallel.

thanks

+4
source share
2 answers

I asked a similar question about SO, wanting to open diff files in tabs in BeyondCompare. I came up with this:

 for name in $(git diff --name-only $1); do git difftool $1 $name & done 

Gets a list of modified files and calls an external comparison tool in the background job for each individual file.

Check out the information here and how I can simplify its use. Being new to bash, I'd love to hear about any improvements ...

Edit 1: optional parameter added (e.g. '--staged')
Edit 2: added git alias ( see Link ).

+6
source

Instead of calling diffftool for each file, you can let git do this for you, starting with ( git 1.7.11 , June 2012):
Now it can create diff directories (i.e. display all files that need to be compared before opening diffftool)

See. " git difftool , to compare the directory? "

So, perhaps now you can use one call using the diff directory.

0
source

All Articles