You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by "Eric Gillespie, Jr." <ep...@pretzelnet.org> on 2001/12/12 06:25:46 UTC

Customizable Keywords

Tonight i saw Ben Collins-Sussman's commit to the
line-endings-and-keywords.txt file where he lists some keywords.
It isn't clear if those are only examples or if those are the
only ones he plans to implement.

In any case, i have two comments about this.  First, some
analogue of CVS's Id will be necessary (containing the filename,
last revision in which it changed, who changed it, and when).
Second, most projects want a custom keyword ($NetBSD$,
$XConsortium$, etc.), usually made equivalent to Id.

CVS has no support for this; each project accomplishes it in a
different way.  Both FreeBSD and NetBSD do it via
CVSROOT/options, though in an incompatible way.  I maintain
Debian's CVS package, and i incorporated FreeBSD's version of the
hack.  Subversion should have *proper* support for creating any
number of custom keywords, making them equivalent to whatever
keyword you want.  Bonus points for some kind of format string
for inventing your own cool keyword :).

Of course i'm just some whiner who has no time to contribute, so
i understand if some things have to be post-1.0.  That said,
these seem like easy features to implement.

-- 
Eric Gillespie, Jr. <*> epg@pretzelnet.org

"When everyone has to reinvent the wheel, many people invent
 square wheels."


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

Re: Customizable Keywords

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Garrett Rooney <ro...@electricjellyfish.net> writes:
> so if you are in FreeBSD, and import code from NetBSD, you can tell
> what revision from NetBSD was imported, generally.  if both used $Id$,
> you would just overwrite it.

Thank you!

-K

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

Re: Customizable Keywords

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On Wed, Dec 12, 2001 at 01:12:47AM -0600, Karl Fogel wrote:
> "Eric Gillespie, Jr." <ep...@pretzelnet.org> writes:
> > In any case, i have two comments about this.  First, some
> > analogue of CVS's Id will be necessary (containing the filename,
> > last revision in which it changed, who changed it, and when).
> 
> Can you give some reasons why an equivalent of $Id$ is necessary?
> I.e., Why it's worthwhile to have keywords that are just combinations
> of other keywords?
> 
> Not being sarcastic, just want to know.
> 
> > Second, most projects want a custom keyword ($NetBSD$,
> > $XConsortium$, etc.), usually made equivalent to Id.
> 
> What do these keywords do?  Why are they preferable to $Id$ or to the
> equivalent combination of more primitive keywords?

so if you are in FreeBSD, and import code from NetBSD, you can tell
what revision from NetBSD was imported, generally.  if both used $Id$,
you would just overwrite it.

-garrett

-- 
garrett rooney                     Unix was not designed to stop you from 
rooneg@electricjellyfish.net       doing stupid things, because that would  
http://electricjellyfish.net/      stop you from doing clever things.

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

Re: Customizable Keywords

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
"Eric Gillespie, Jr." <ep...@pretzelnet.org> writes:
> custom keywords based on format strings.  Those who want Id could
> build that, but most would just build a project keyword
> resembling Id.  Once the keywords code goes in i should be able
> to provide a patch for this.

I think that's the way to go.  I understand the usefulness of $Id$
now, but let's keep it simple for the initial cut of keywords.

-K

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

Re: Customizable Keywords

Posted by "Eric Gillespie, Jr." <ep...@pretzelnet.org>.
Karl Fogel <kf...@newton.ch.collab.net> writes:

    > Can you give some reasons why an equivalent of $Id$ is
    > necessary?  I.e., Why it's worthwhile to have keywords that
    > are just combinations of other keywords?

It's about conciseness.  Compare:

# $Id: .zshrc,v 1.23 2001/12/11 00:25:35 epg Exp $
# $LastChangedRevision: 600$ $LastChangedDate: 2001-12-11 00:25:35$ $LastChangedBy: epg$

The second is a lot more typing and does not fit onto an
80-column display, even without the filename.  There's no
filename because no $FileName$ or whatever is listed in the
keyword notes. HeadURL is going to be way too long (not to say it
isn't useful, but FileName and Id are needed too).

Id is a nice, concise way of expressing just about everything you
want to know about a file.  Looks very nice with ident(1).

As for it just being a combination of keywords, you could provide
only the core keywords and then allow users to build their own
custom keywords based on format strings.  Those who want Id could
build that, but most would just build a project keyword
resembling Id.  Once the keywords code goes in i should be able
to provide a patch for this.

    > What do these keywords do?  Why are they preferable to $Id$
    > or to the equivalent combination of more primitive
    > keywords?

See <http://cvsweb.netbsd.org/bsdweb.cgi/basesrc/libexec/atrun/atrun.8?rev=1.10&content-type=text/x-cvsweb-markup>:

.\" $NetBSD: atrun.8,v 1.10 2000/11/07 06:43:25 lukem Exp $
.\" $OpenBSD: atrun.8,v 1.4 1998/05/22 22:16:29 deraadt Exp $
.\" $FreeBSD: atrun.man,v 1.3 1997/02/22 14:20:55 peter Exp $

CVS's -ko is an either/or thing; but that's not what you want.
You want your project keyword to expand but not the others.

-- 
Eric Gillespie, Jr. <*> epg@pretzelnet.org

"When everyone has to reinvent the wheel, many people invent
 square wheels."


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

Re: Customizable Keywords

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
"Eric Gillespie, Jr." <ep...@pretzelnet.org> writes:
> In any case, i have two comments about this.  First, some
> analogue of CVS's Id will be necessary (containing the filename,
> last revision in which it changed, who changed it, and when).

Can you give some reasons why an equivalent of $Id$ is necessary?
I.e., Why it's worthwhile to have keywords that are just combinations
of other keywords?

Not being sarcastic, just want to know.

> Second, most projects want a custom keyword ($NetBSD$,
> $XConsortium$, etc.), usually made equivalent to Id.

What do these keywords do?  Why are they preferable to $Id$ or to the
equivalent combination of more primitive keywords?

Thanks,
-Karl

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

Re: Customizable Keywords

Posted by "Eric Gillespie, Jr." <ep...@pretzelnet.org>.
Ben Collins-Sussman <su...@collab.net> writes:

    > Those are the only ones I plan to implement right now; all
    > of the other keywords that CVS supports are way too
    > RCS-specific.

Of the 5 fields in CVS's Id keyword, only one is RCS-specific.
The others are of general use.  Please see my second post in this
thread.  It's about concisely expressing the vital information
about a file.

    > Sorry, Garrett's response isn't clear to me.  What does
    > $NetBSD$ expand to?  Something like $NetBSD: version 2.3.4$

See my second post in this thread.

-- 
Eric Gillespie, Jr. <*> epg@pretzelnet.org

"When everyone has to reinvent the wheel, many people invent
 square wheels."


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

Re: Customizable Keywords

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On Wed, Dec 12, 2001 at 08:38:14AM -0600, Ben Collins-Sussman wrote:
> "Eric Gillespie, Jr." <ep...@pretzelnet.org> writes:
> 
> > Tonight i saw Ben Collins-Sussman's commit to the
> > line-endings-and-keywords.txt file where he lists some keywords.
> > It isn't clear if those are only examples or if those are the
> > only ones he plans to implement.
> 
> Those are the only ones I plan to implement right now;  all of the
> other keywords that CVS supports are way too RCS-specific.
> 
> 
> > Second, most projects want a custom keyword ($NetBSD$,
> > $XConsortium$, etc.), usually made equivalent to Id.
> 
> Sorry, Garrett's response isn't clear to me.  What does $NetBSD$
> expand to?  Something like $NetBSD: version 2.3.4$ ?

check out this url in FreeBSD's cvsweb.

http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/dev/pccard/pccard_cis.c?rev=1.15&content-type=text/x-cvsweb-markup

the file was imported from NetBSD to FreeBSD, thus it has both $FreeBSD$
and $NetBSD$ in it.  the $FreeBSD$ gives you info specific to it's
history in FreeBSD, while the $NetBSD$ preserves the information from
NetBSD.  so we can see this came from version 1.10 of the file in
NetBSD, and was last edited there on 1998/12/29.

-garrett

-- 
garrett rooney                     Unix was not designed to stop you from 
rooneg@electricjellyfish.net       doing stupid things, because that would  
http://electricjellyfish.net/      stop you from doing clever things.

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

Re: Customizable Keywords

Posted by Ben Collins-Sussman <su...@collab.net>.
"Eric Gillespie, Jr." <ep...@pretzelnet.org> writes:

> Tonight i saw Ben Collins-Sussman's commit to the
> line-endings-and-keywords.txt file where he lists some keywords.
> It isn't clear if those are only examples or if those are the
> only ones he plans to implement.

Those are the only ones I plan to implement right now;  all of the
other keywords that CVS supports are way too RCS-specific.


> Second, most projects want a custom keyword ($NetBSD$,
> $XConsortium$, etc.), usually made equivalent to Id.

Sorry, Garrett's response isn't clear to me.  What does $NetBSD$
expand to?  Something like $NetBSD: version 2.3.4$ ?

> Subversion should have *proper* support for creating any
> number of custom keywords, making them equivalent to whatever
> keyword you want.

Ummmm.  Hmmmm.  Could this be done via a file property?

   svn:expand-keyword  =  "foo:bar"

Would translate $foo$ into $foo: bar$?

Or are we talking about a more complex system, whereby a keyword would
need to be programatically discovered via some client-side plugin?


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