9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Ethan Grammatikidis <eekee57@fastmail.fm>
To: 9fans@9fans.net
Subject: Re: [9fans] c code differencing
Date: Thu,  1 Sep 2011 14:16:30 +0100	[thread overview]
Message-ID: <20110901141630.68b38b36@kolari.ethans.dre.am> (raw)
In-Reply-To: <3ad045e675c92ccadaa4dcb0e5f36a38@quintile.net>

On Wed, 31 Aug 2011 14:01:34 +0100
"Steve Simon" <steve@quintile.net> wrote:

> What I think I need is a program which parses C and will
> do diffs at the level of functions, globals , #defines and enums.

This won't work at the level of functions but I've found diff -c output
to be nice to use with acme. It assumes no spaces in filenames, :)
I don't suppose everyone has Erik's rc patch yet.

!#/bin/rc

fn cd

flist = `{@{cd B && du -a | awk '{print $2}'}}

for(f in $flist) {
	if(test -e A/$f) {
		diff -c A/$f B/$f
	}
	if not {
		echo B/$f':	new file'
	}
	echo
}



  parent reply	other threads:[~2011-09-01 13:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-31 13:01 Steve Simon
2011-08-31 14:01 ` Rodolfo kix Garcia
2011-09-01 13:16 ` Ethan Grammatikidis [this message]
2011-09-01 14:33 ` FENG Yu Ning
2011-09-01 14:51 ` Anthony Sorace
2011-09-01 14:59   ` Anthony Sorace
2011-09-03 12:17 ` Comeau At9Fans

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110901141630.68b38b36@kolari.ethans.dre.am \
    --to=eekee57@fastmail.fm \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).