Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to diff just the source files?

Tags:

c

diff

I have two almost similar source code trees, but do not have access to the source code repository so I am stuck with release packages that contain also test reports, documentation, binaries etc.

the diff command only support --exclude, but I would like to do something like diff -wbur --include='*.c,*.h' tree1 tree2

I know that this question is somewhat related, but does not really address my issue.

Bonus points for ignoring change blocks that are completely in C comments :)

like image 824
Kimvais Avatar asked Apr 20 '10 08:04

Kimvais


People also ask

How do I compare two folders?

If you double-click on a folder, it will expand to reveal its contents. If you double-click on a file it will open a side by side comparison and will highlight the differences, if any, between the two files. Double-clicking a file will open both copies in a side by side view and will highlight any differences.

How do I use a diff file?

Applying a DIFF File in the Command LineCopy the DIFF files to the root directory of your store. Open the terminal on the server or access the server remotely via SSH. Replace /path/to/cscart/root/directory with the actual path to the root directory of your store. Replace example.

Does diff work on directories?

Normally diff reports subdirectories common to both directories without comparing subdirectories' files, but if you use the -r or --recursive option, it compares every corresponding pair of files in the directory trees, as many levels deep as they go.

What is tools difffiles and how does it work?

Tools.DiffFiles will also help you auto-complete paths to the files you are looking for - making it easier for you to get them right. It can also diff files that are not part of your projects.

What is a source file?

Source files are the files you, the designer, have used to create your designs. The more well-known files include Adobe’s Photoshop, Illustrator and Indesign. These files should be provided to clients so they can print scalable versions of the design or edit them as they see fit. What happens on DesignCrowd?

How do I diff files in Visual Studio?

However I have recently discovered that you can actually do this from Visual Studio - with a bit of tinkering. Visual Studio can easily diff files that are under source control. However sometimes you have two files which you wish to see the differences of. There is no way to just select two files, right click and diff them.

What is git diff in Git?

So what git diff actually shows you all the changes done in the file after doing a commit for example:- a file say at.txt is modified here after doing a commit and here we can see that there is a difference in the file after a commit. Illustration: Changes between two Commits as shown below as follows:


1 Answers

Little modification to a result from google helped, in tree1 did find . -name '*.[ch]' -exec diff -wibu {} ../tree2/{} \;

like image 141
Kimvais Avatar answered Oct 12 '22 07:10

Kimvais