Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Thank You for your continued support and contributions!

+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Starting Development and Compiling
| | |-+  Using diff to generate a patch on multiple files
« previous next »
  • Print
Pages: [1]

Author Topic: Using diff to generate a patch on multiple files  (Read 14844 times)

Offline GodEater

  • Member
  • *
  • Posts: 2829
Using diff to generate a patch on multiple files
« on: September 27, 2006, 09:11:26 AM »
Guys,

quick question here :

I've changed a number of source files, and want to generate diffs for all of them.

Do I have to do diff for each one (and risk missing one I don't remember modifying), or can I do some sort of diff and get all the patches in one file.

I've had a look at the diff man page, and can't seem to quite work out what I need to do. When I tried it with just the directory names, it just told me *which* files were different, it didn't give me the usual "this line changed from this to this" format I expect from a patch.

Sorry for being a numbskull....
Logged

Read The Manual Please

Offline bluebrother

  • Developer
  • Member
  • *
  • Posts: 3421
  • creature
Re: Using diff to generate a patch on multiple files
« Reply #1 on: September 27, 2006, 10:22:49 AM »
If you have your source checked out of cvs you can use cvs to do this. This has the advantage that the generated diff is against the newest cvs version.

cvs diff -u your_file_1 your_file_2 etc.
you can also give cvs directories as arguments, even .
cvs diff -u . > your_patchfile.diff

(when running diff without cvs you need to make it recursively -- diff -urb folder)
Logged
Rockbox Utility development binaries (updated infrequently) · How to ask questions the smart way · We do not estimate timeframes.

Offline GodEater

  • Member
  • *
  • Posts: 2829
Re: Using diff to generate a patch on multiple files
« Reply #2 on: September 27, 2006, 10:49:46 AM »
Sadly it isn't from CVS - the work firewall / proxy doesn't permit CVS access.
Logged

Read The Manual Please

Offline lowlight

  • Developer
  • Member
  • *
  • Posts: 194
Re: Using diff to generate a patch on multiple files
« Reply #3 on: September 27, 2006, 11:34:48 AM »
Make two directory trees containing the original and modified sources respectively: rockbox-devel (unchanged) and rockbox-local (modified).

Code: [Select]
cd rockbox-local
diff -ru ../rockbox-devel ./ > mypatch.diff

Look in the diff for lines like "Only in " these are files that are not present in one of the trees. You can remove those lines.
Logged

Offline arcman

  • Member
  • *
  • Posts: 1
  • Linux Developer
Re: Using diff to generate a patch on multiple files
« Reply #4 on: October 02, 2006, 06:07:21 AM »
GodEater
Usually I use this format:
Code: [Select]
diff -Naurp /original_dir /changed_dir > changes.patch

Hint:
MC (Midnight Commander) can browse "patch"("diff") files ;)
« Last Edit: October 02, 2006, 06:19:41 AM by arcman »
Logged

Offline Rincewind

  • Member
  • *
  • Posts: 266
Re: Using diff to generate a patch on multiple files
« Reply #5 on: October 02, 2006, 11:00:02 AM »
If you want to learn something huge, you can try emacs, it has a very good diff module (and tons of other useful features).

But emacs has a very steep learning curve...
Logged
Iriver H120, Sansa e280

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Starting Development and Compiling
| | |-+  Using diff to generate a patch on multiple files
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.092 seconds with 15 queries.