[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Re: Future-proofing "svn st" output

From: Gareth McCaughan <Gareth.McCaughan_at_pobox.com>
Date: 2002-08-31 03:06:01 CEST

On Saturday 31 August 2002 12:49 am, Greg Stein wrote
(in reply to me):

> Note that your mailer wrapped the patch, which broke it. Please fix
> the mailer :-), or attach it.

Aieee! That's quite astonishingly broken. Sorry about that.
I'm attaching the patch instead this time.

> You should be using apr_size_t throughout, rather than plain
> size_t.

Oh. Am I allowed to say "Ick"? :-) Anyway, the attached patch
"fixes" this.

> > +static size_t
> > +traverse_fields (char *buffer,
> > + char variant,
> > + const svn_wc_status_t *status)
> > +{
> > + size_t offset = 0;
> > + const status_item_t *item;
> > +
> > + for (item=all_fields; item->variants; ++item)
>
> Some of the style is off. For example, we keep spaces around "="
> and "+" symbols.

Care to be more specific?

I've added spaces around all operators that were missing it,
apart from three instances of "field[width-1]" which I think would
be much worse with spaces. (There's some precedent in the
extant Subversion source for leaving this sort of construct
unspaced.)

Violations of the standard Subversion coding style are not
deliberate. It's different enough from my own usual style that
I'm not surprised errors have snuck past my defences...

> > +++ ./main.c Fri Aug 30 22:50:33 2002
> > @@ -75,6 +75,7 @@
> > {"strict", svn_cl__strict_opt, 0, "use strict
> > semantics"}, {"no-ignore", svn_cl__no_ignore_opt, 0,
> > "disregard default and svn:ignore property
> > ignores"},
> > + {"describe-only", 'd', 0, "describe columns; don't really do
> > status"},
>
> This will be a *very* rarely used feature. We shouldn't burn the
> single-letter option on it. Just --describe-only is sufficient.

Good call. -d flushed.

Here's the revised log message. The reference to "-d" has
been excised, and I've added a pointer to this thread.

-------------------- log message begins --------------------
Reimplementation of "svn status", with the goal of making it
possible for a program invoking "svn status" to tell what the
output means, even if new information is added to that output
in the future. The layout is now under the control of a data
structure which is used (1) when displaying status information
and (2) in response to "svn status" with the new --describe-only
command-line argument.

As a side-effect of this reimplementation, some magic numbers
and code duplication have gone away.

For some background to this patch, see the thread on dev@subversion
beginning with message <200208050222.07464@gjm>, entitled
``Future-proofing "svn st" output''.

* cl.h (describe_only): New variable, used only by "svn status",
  true iff we should describe the fields in "svn status" output
  instead of generating a real status report.

* status.c: Rewritten.

* main.c (main): add handling for --describe-only option.

* status-cmd.c (svn_cl__status): handle the case where describe_only
  is true.
--------------------- log message ends ---------------------

-- 
g


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

  • text/x-diff attachment: DIFFS
Received on Sat Aug 31 06:23:14 2002

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.