问题
I've recently started a new job where I have taken over developing an existing system. The system (PHP site if it matters) was setup with three instances.
- Live site (Used by staff and customers)
- Test site (Mainly used to demonstrate feature requests to staff)
- Dev site (Used by the previous developer)
This seemed like a reasonable thing to do (They didn't have a SVN server setup). But now that I'm a couple weeks in, I've noticed that the code (and database schemas) is different across all three sites. I expected there to be differences between dev and live, but live has features that dev doesn't.
I've run CLOC and I am looking at around 180 modified files and 110 new files between the different versions. Is there any software or easier method to compare the code across all the versions than just performing diffs file by file?
回答1:
meld is excellent for comparing entire folders (and files) recursively in a drill-down style.
回答2:
Blatant plug: If you're interested in diffing all three sites against each other (as opposed to diffing them two at a time), you might be interested in my difdef utility. It can produce a merge of N directories à la diff -r -D
but unlike traditional diff
it works for N>2 as well as N=2. (And unlike diff3
it does not assume any specific genealogical relationship among the versions.)
E.g. you could do
difdef -r -DSITE={LIVE,TEST,DEV} {live,test,dev} -o merged
grep -lr 'SITE==' merged | xargs $EDITOR
to open up an editor window on every file that differs between any two versions.
difdef
does not have a better UI than the traditional diff
utility, but it does have this nifty ability to diff more than 2 versions simultaneously. Open-source, C++, MIT license.
来源:https://stackoverflow.com/questions/11895570/diff-multiple-versions-of-a-project