Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Oct 2007 08:44:47 -0400
From:      John Baldwin <jhb@freebsd.org>
To:        Hans Petter Selasky <hselasky@freebsd.org>
Cc:        Alfred Perlstein <alfred@freebsd.org>, Perforce Change Reviews <perforce@freebsd.org>, "Constantine A. Murenin" <cnst@freebsd.org>
Subject:   Re: PERFORCE change 126745 for review
Message-ID:  <200710170844.47761.jhb@freebsd.org>
In-Reply-To: <200710161823.59940.hselasky@freebsd.org>
References:  <200709231625.l8NGPhaR097038@repoman.freebsd.org> <20071016043133.GW31826@elvis.mu.org> <200710161823.59940.hselasky@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday 16 October 2007 12:23:59 pm Hans Petter Selasky wrote:
> On Tuesday 16 October 2007, Alfred Perlstein wrote:
> > * Hans Petter Selasky <hselasky@freebsd.org> [070923 13:13] wrote:
> > > Hi Constantine,
> > >
> > > Thanks for your input and I _know_ that my code is not 100% style
> > > compliant. Most of the style misbehaves are probably there due to the way
> > > my "xemacs" autoformatting behaves. And I love curly brackets and
> > > parenthesis, by the way :-)
> > >
> > > My plan is to clean up all the style stuff by a small C-program in the
> > > end, because doing it by hand is waste of my time. Probably it will take
> > > less time to write that program than the actual manual edit when we are
> > > talking about doing alot of edits. It wonders me if such a tool already
> > > exists, because the code is technically OK.
> > >
> > > Anyone that wants to be a little more constructive and point towards
> > > where the FreeBSD style transformer program is? I assume it would be
> > > extremely useful to everyone that is forced to use multiple different
> > > styles depending on what project they are contributing to, like me. Then
> > > before commit I will run that script and verify the differences. And
> > > that's it.
> > >
> > > --HPS
> >
> > Hans, one of the issues with doing such changes at the end is that it
> > effectively obliterates the ability to "cvs annotate" your code.  I'm
> > sure perforce has an 'annotate' command as well.
> >
> > I would suggest that you find/fix the style now and apply it now rather
> > than later as the longer you wait, the more history you obliterate.
> 
> Hi Alfred,
> 
> I never heard about the annotate command. Can you explain a little bit how it 
> works?
> 
> I will do as you want and write that "style converter" first, before any other 
> changes. I expect it might take a little bit time, something like a week.

FWIW, p4 does have an annotate via the p4web interface.  Also, there are .emacs
snippets that (mostly) do style(9).  The only thing I know of that they don't
quite get right is continuation of nested conditions in a control statement such
as the following:

	if (foo && bar(baz,
	    qux))

Emacs will render this as

	if (foo && bar(baz,
		       qux))

by default, so I end up manually fixing those up.

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200710170844.47761.jhb>