Best tool to compare two linux source codes

Hi

I want to know the best software tool for comparing the differences in the linux kernel.

Actually I have STM32 microcontroller based development board for which I got the BSP in which the Linux Kernel is present.

The version of the BSP of the linux kernel is 2.6.32

I downloaded the original kernel with same version from kernel.org

Now I am trying to extract the differences between the two source codes by comparing.

I tried with each individual files in the Beyond Compare but it is a very big and tiredsome process comparing this way.

So I want to know is there any way to compare the two source codes in just a single command in the Linux kernel.

I have seen that people patch the whole kernel and as far I have understood patch contains all the differences that have to be inserted inside the kernel.

But this is puting inside the kernel. I want to get out the differences between the two kernel sources.

I have read that CVS or other version control softwares are used to get out the differences between two kernel source codes but that is for the comparing between the two source codes from the same tree.

I want to compare between the two kernel sources from different sources.

Please help me guys.

Thanks

--------------------------------------- Posted through

formatting link

Reply to
piyushpandey
Loading thread data ...

Use the normal *nix diff command. man diff will give you the options. diff -r dir1 dir2 is a starting point

Chisolm Republic of Texas

Reply to
Joe Chisolm

I tried diff commnad also , infact this was the first thing I did after googling over internet.

But what I got is that it is comparing the directories upto one layer .

I mean I gave the following command:

diff ~/linux-2.6.32 ~/linux-ST-source

What I got is the parent folder compare upto first level and not compare all subdirectories inside it.

I want to compare the difference in one single shot of all the directories and subdirectories inside it.

--------------------------------------- Posted through

formatting link

Reply to
piyushpandey

Like Joe said - use the "-r" option on diff.

Reply to
Robert Wessel

And while you are at it, look at the unified diff option "-u". I find it produces more readable output.

You may also wish to review the documentation for the "-N" option in case there are files present in one directory tree but not the other tree.

Typing "man diff" into your shell will give you a very detailed list of options you can play with to refine your search for differences.

Simon.

--
Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP 
Microsoft: Bringing you 1980s technology to a 21st century world
Reply to
Simon Clubley

meld is a very nice visual "diff" utility. Using it on something as large as linux kernel source trees may be a little combersome, but if you're patient it'll work.

--
Grant
Reply to
Grant Edwards

"meld" was my first thought here. Diff is great for some purposes, but if there are a lot of changes it quickly becomes hard to follow. Just remember on meld to turn off viewing the matching files, so that it is easier to spot the differences.

Reply to
David Brown

Another vote for meld, it's the best visual diff I've used under Linux.

--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com 
Email address domain is currently out of order.  See above to fix.
Reply to
Rob Gaddi

There is probably a better way, but what I usually do is:

diff -rq dir1 dir2 >/tmp/somefile

Then I edit somefile and get rid of things I dont really care about and change the other lines to "meld path1 path2"

and then "sh /tmp/somefile"

--
Chisolm 
Republic of Texas
Reply to
Joe Chisolm
[...]

Which tools did you investigate?

Was Beyond Compare among them?

I'm not sure whether I shall buy another Beyond Compare license or switch to another tool. It should support also Windows, multi-platform would be good.

Oliver

--
Oliver Betz, Munich 
despammed.com is broken, use Reply-To:
Reply to
Oliver Betz

There's a good directory compare in BeyondCompare.

BeyondCompare is now available for Windows, Mac OS X and Linux.

Whatever diff/merge tool you use, you will always find a few situations in which a different tool has the edge. However, BeyondCompare is the tool I'm prepared to spend money for.

Stephen

--
Stephen Pelc, stephenXXX@mpeforth.com 
MicroProcessor Engineering Ltd - More Real, Less Time 
 Click to see the full signature
Reply to
Stephen Pelc

In my opinion the Beyond Compare does not stnad upto that mark which I neeeded.

Yeah I tried the beyond compare but unfortunately it sucks....

Instead of that another open source comparing software which I found useful and with which I compared the linu source of 2.6.32 original and a customized one, and the result was awesome after few minutes of wait.

--------------------------------------- Posted through

formatting link

Reply to
piyushpandey

Can you tell us what open source comparing software that was?

--
Grant Edwards               grant.b.edwards        Yow! ... I have read the 
                                  at               INSTRUCTIONS ... 
 Click to see the full signature
Reply to
Grant Edwards

WinMerge

Actually it works on Windows only , but it is open source.

and I found it very useful.

--------------------------------------- Posted through

formatting link

Reply to
piyushpandey

would you mind explaining the pros over Beyond Compare and where BC "sucks"? As I wrote, I'm in the situation to decide whether to buy a BC license.

TIA,

Oliver

--
Oliver Betz, Munich http://oliverbetz.de/
Reply to
Oliver Betz

Google is your friend...

I have never used Beyond Compare, but it looks like it has lots more features - some of which look useful, and some of which are definitely off-topic for a comparison tool. So my guess is that the benefit of WinMerge (or Meld), other than the price and the convenience of not having to track licenses (such tracking can easily cost a company more than the license cost itself), is that these tools are clear and simple

- they do one useful job easily and efficiently. Without having tried BC, I can't say if it is slow or hard to navigate, but that is definitely the risk.

Reply to
David Brown

Thanks David, I'm aware of these pages.

I wanted to get a reply from piyushpandey, who wrote that "Beyound Compare sucks" and why _he_ likes WinMerge more.

piyushpandey obviously tried both BC and WinMerge, and he seems to have an opinion. I want to get him to confirm his statement with details, facts.

Oliver

--
Oliver Betz, Munich 
despammed.com is broken, use Reply-To:
Reply to
Oliver Betz

I hope I didn't come across as too sarcastic in my post - I was trying to be helpful, and had been looking at these pages myself, as this thread had inspired me to look at alternative tools. I know you wanted a personal opinion from piyushpandey, and perhaps others who have tried both tools, but I can't help there.

David

Reply to
David Brown

no, and no offense meant to you.

If piyushpandey doesn't reply: I consider "fire and forget" criticism rather bad habit.

Rob Gaddi's post would also be much more useful if he told us which tools he compared and _what_ he liked/disliked.

I will look for my notices when I compared comparison tools and post them here. It may take a day or two.

Oliver

--
Oliver Betz, Munich http://oliverbetz.de/
Reply to
Oliver Betz

Oliver, I'd have loved to, but somehow eternal-september was lunched and I couldn't get my post out before leaving for a wedding.

At this point, I don't recall. vimdiff, a couple others, free stuff only though. Back when I ran Windows I tended to use WinMerge, and gave a shot when I switched over to using WinMerge through Wine, but it was flaky. Mostly, what I liked about meld is that the interface is clean; the learning curve is about 10 seconds.

I haven't tried Beyond Compare, which looks interesting. The ability to do binary diffs alone might be worth the price.

--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com 
Email address domain is currently out of order.  See above to fix.
Reply to
Rob Gaddi

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.