4

when I do a git difftool, I get the message Hit return to launch 'araxis':. I found out that I can terminate the whole diffing by pressing CTRL-C, but how about skipping a single file?

Is this possible?


Edit: as of git 1.7.7.1 (and msysgit 1.7.7.1.msysgit.0), it is possible. For every file, I get asked

Launch 'araxis' [Y/n]:

Seems like peterjmag's commit mentioned in his answer was accepted by the git guys and has made it's way into the master branch!

Community
  • 1
  • 1
eckes
  • 64,417
  • 29
  • 168
  • 201
  • Unless you specify the list of desired files as arguments, this sounds like it's a usage question for your difftool (araxis), not for git. – Cascabel Dec 08 '10 at 15:44
  • Nope. The diff tool gets called by git with the two paths to be compared. And then it does it's work. How shall the diff tool know if it shall really compare the two files or -- for some reason -- not? If skipping is not possible from git, I think the global answer to the question is 'No. It's not possible.'. – eckes Dec 08 '10 at 19:21
  • 1
    While it doesn't "skip" files per se, try something like this: http://stackoverflow.com/questions/1220309/ (and its corresponding blog post at http://blog.codefarm.co.nz/2009/08/git-diff-and-difftool-open-all-files.html). That will open each file in windows/tabs in your diff tool, and then you can just ignore certain files from there. However, I agree that there should be an option to skip a certain file from the prompt, i.e. "Hit return to launch 'araxis' or type 's' to skip this file: " – peterjmag Dec 09 '10 at 17:58
  • @peterjmag: Thanks for pointing this out. Please enter your comment as answer so that I can accept it. – eckes Dec 09 '10 at 19:54

1 Answers1

4

As eckes requested in the comments above:

While it doesn't "skip" files per se, this git-diffall script (spawned by this SO answer) opens each file in windows/tabs in your diff tool, and then you can ignore certain files from there. However, I agree that there should be an option to skip a certain file from the prompt, i.e. "Hit return to launch 'araxis' or type 's' to skip this file: "

EDIT: Since this functionality would be helpful to me as well, I forked git.git on github and added it myself. Check out this (very simple) commit for a proof of concept. I'll be submitting a patch to the git mailing list as well, in hopes that someone can suggest a better approach--preferably someone who's better at shell scripting than me. :-)

I'm also open to feedback via GitHub's built-in notes system!

ANOTHER EDIT: It appears that this functionality is now in git core as of v1.7.7.1 or so (October 2011). Here's the relevant commit on GitHub.

Community
  • 1
  • 1
peterjmag
  • 6,041
  • 1
  • 30
  • 27