views:

101

answers:

1

Is it possible to get the git difftool command to open a directory compare between the changed files and the staging/checked files?

So ideally, if 2 files have changed, they would be the only 2 shown, but within a directory compare.

I've read posts about getting git to give all file diffs in parallel, so tools like BeyondCompare has all the diffs in tabs, but im not happy with that!

One could pull a copy of the changed files from staging/checked in files into a temp folder, and then open that up. Is that the only option?

+1  A: 

One could pull a copy of the changed files from staging/checked in files into a temp folder, and then open that up. Is that the only option?

Basically yes:

You difftool script would:

  • create 2 temp directories
  • defines itself as a diff tool
  • call git diff
    • which then call itself for file to diff
    • in that mode, the same script, for each files, only copy the two version to diff in the two temp directories
  • then go on and call diff tools (like beyondCompare or WinMerge) on the two temp directories

You have one first example in this question.

VonC
Why 2 temp directories? Be best to compare the changed files with the git sandbox against the checked in source? Therefore its only the checked in files that have changed that need to be copied/got out into a temp dir?Also this is best as one might want to merge changes from the checkedin files back into the working sandbox.Does anyone have any indention to make this sort of support standard in git?
IanVaughan