问题
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 2 branches in their scm. These two branches have not been merged for ages, nut now they have to merge them. Most of the changes are trivial, so merging via git only takes about 30 minutes.
How ever, 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 4 version 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's many changes between these to branches, the diff lists are very long (about 50Mb each), and therefore the lists are useless. Now my customer wants to have the changes grouped.
There are 4 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 structuralvise very much like the above, except from I have more symbols involved. There's lots of formating 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 has been changed. The customers is worried that some '*/' might not has been merged. I can not see how to verify this. Any of you experts have an idea?
g4: All that are not mentioned above. This is considered to be real changes.
回答1:
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.
来源:https://stackoverflow.com/questions/4464181/git-diff-to-ignore-patterns-in-files