At Sun, 24 Mar 2002 18:11:30 +1100 (EST), Jessica Mayo wrote:
> I was looking at UML this morning. I wanted a Win32 port.
> I downloaded the patch to the latest stable 2.4 kernel.
> 
> [ done while looking over the LINE 0.5 code (think Lin4Win :) ]
> 
> But I'll never get started with distractions like these...
> 
> ... I wanted to look at said patch file in a non-linear fashion. :)
> 
> It contains diffs for a large number of files in the kernel tree, and I
> wanted an overall picture, not the line-by-line view I was getting.
> I wanted to extract those diffs into their proper tree, without patching.

> ... enter a monster...  :)

[...]

> ... apologies

tools that i've found useful for perusing large source trees/patches:

diffstat
 - limited use. basically your grep solution, except it shows the
   number of lines added/removed by the patch. useful for getting a
   real quick overview of the scope of the change. not useful for much
   else.

ediff
 - emacs diff/patch mode. the excessive colour highlighting makes it
   immediately clear whats happening, and its easy to skip
   forward/backward between differences. you can also selectively
   apply/backout/merge, etc individual pieces, but thats not something
   you're interested in yet.

   run (x)emacs. type "M-x epatch". press '?' in the little ediff
   "control buffer" that pops up for help - you probably only want "n"
   and "p" (next and previous) (type all ediff commands in the ediff
   control buffer). note that this will actually apply the patch
   before showing you the differences, so you should work on a copy if
   you wanted to keep the original.

   (note: M-x epatch-buffer won't modify the files, but only works on
   single-file patches)

etags/ctags (etags for emacs, ctags for vi)
 - *very* useful for browsing unfamiliar non-trivial source trees in
   general. you run (eg) "etags `find . -name '*.[ch]' -print`", which
   creates a TAGS file (ctags creates "tags" iirc) and then open up a
   source file in emacs and hit M-. (find-tag), type in a symbol name
   (you might have to give the location of the TAGS file) and the
   editor jumps to the point in the source code where that symbol was
   defined. its like having lxr or something built in to your editor.
   read editor docs for details (and vi usage).

   (note that automake-generated Makefiles have TAGS/tags targets that
   build the appropriate files - in a better way than the above
   etags/find too)


there's probably some other tools that can work with cvs (or maybe
rcs), rather than with a patch file directly. so it might be worth
your while to check in the unpatched and patched versions to some
revision tool and then look around again (certainly ediff can work
equally as well straight from cvs/rcs/sccs).

-- 
 - Gus
-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to