nikolaj
nikolaj

Reputation: 340

git diff to ignore patterns in files

I have a problem with git diff. Let me first fill you in on the history.

I have just been given a rather unpopular project from a customer. The problem is that they have two branches in their SCM. These two branches have not been merged for ages, but now they have to merge them. Most of the changes are trivial, so merging via Git only takes about 30 minutes.

However, my customer do not trust that a merge process can be automated. Therefore they want to review the merge, by having a diff list with differences between all four versions of the code in play (base and version a, base and version b, a and b, etc.).

That is also quite trivial, but here comes the problem. Since there are many changes between these two branches, the diff lists are very long (about 50 MB each), and therefore the lists are useless. Now my customer wants to have the changes grouped.

There are four main groups in these 'grouped diffs'. I would like to make git diff able to ignore the individual groups on it the time.

g1: There are lot of slashes that has changed their direction. Therefore I would like Git to interpret / and \ alike. I have found out how to make Git ignore the entire line if it contains a slash, but that not what I want, since the path (where the slashes comes from) might have changed.

g2: This problem is structurally very much like the above, except from I have more symbols involved. There are lots of formatting in the logging that has been changed. Mostly related to Danish letters, that be 'æ' has been changed to '& aelig;', 'ø' has been changed to '& oslash;', etc.

g3: Lots of comments have been changed. The customers is worried that some '*/' might not has been merged. How can I verify this.?

g4: All that are not mentioned above. This is considered to be real changes.

Upvotes: 5

Views: 1613

Answers (1)

haydenmuhl
haydenmuhl

Reputation: 6146

You may be able to write something that will parse the diff and remove or excise some of those changes. Some regex magic might help you with that. I see this as most applicable to g1 and g2.

Not sure what to do about g3.

Upvotes: 1

Related Questions