Question

Is there a url parameter I can pass into gitweb (or anything else I can do) to tell it not to show me whitespace changes?

Backstory: I have a file-generating process that creates hundreds of files that it then programatically checks into git. Recently I made some minor changes to this process, which resulted in a bunch of whitespace being removed from every file that it generates, and some non-whitespace changes being made to just a few files that it generates. I am trying to use gitweb to verify that my non-whitespace changes are in these files, but it's really hard to do because of all the whitespace changes I have to sift through before I see any of the real changes. I know if I were doing a git diff from the command line I could just pass it the -w parameter, but I am really just trying to use gitweb for this.

Was it helpful?

Solution

I don't think this is supported after taking quick glance at the source on github mirror.

our @diff_opts = ('-M'); # taken from git_commit

You could post a feature request to the git mailing list to perhaps make this configurable via gitweb.conf, some UI element, or url parameter. If you are feeling keen, fork it ;)

Github uses a url parameter if your looking for ideas:

Add ?w=1 to the URL to see the diff with whitespace ignored.

OTHER TIPS

Old question, I know, but for those arriving here from a Google search: the @diff_opts config parameter in /etc/gitweb.conf can be used for this. The text in the config file implies that @diff_opts is only there to support git-diff-tree's file copy and rename detection, but actually you can put in any supported git diff option you like. So to suppress whitespace differences, you could use

@diff_opts = ('-b');

which works well for me. I realise it's not a URL parameter, so not directly answering this question, but maybe useful to others.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top