You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by John Peacock <jp...@rowman.com> on 2004/03/20 03:58:52 UTC
[PATCH] Keyword hash and Properties as keyword
OK, here's my version of plasma's patch to make keywords work using hashes. I
cannot take credit (or blame ;) for most of it, except for the support for
properties as keywords. Includes tests and patches to the book. Both diff and
log message attached.
John
--
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4720 Boston Way
Lanham, MD 20706
301-459-3366 x.5010
fax 301-429-5747
Re: [PATCH] Keyword hash and Properties as keyword
Posted by John Peacock <jp...@rowman.com>.
Garrett Rooney wrote:
> Here's the thing. We haven't actually said we're going to have
> inheritable properties, at least not that I'm aware of.
However, I think it is clear that in-database ACL's _are_ on the menu. What
I've read about this suggests that exactly the same framework that will support
ACL rights inheritance will also be ideal for property inheritance. Of course
that also means that property inheritance will be dependent on the ACL feature
being developed. Consequently, I don't think that the lack of /current/
development efforts on inheritable properties reflects anything more than lack
of agreement on inheritance in general.
>
> I'm all for adding extra features related to keywords, but if they
> require either repository based config options on one side or
> inheritable properties on the other, I'd much rather see those features
> happen first, rather than adding features that are only going to be
> really useful someday in the future when we add these other features.
I think that the important thing to focus on here is that the current keywords
structure is very resistant to _any_ extension. plasma's original patch to
convert keywords from static #define'd values into a hash with printf()-like
formatting is a good way to enable future keyword extension. All I've done is
to provide an additional extension which works now. I could just as easily
split this into two patches: one with plasma's changes and one with my extension.
I will also say that while I think that the 'properties as keyword' feature is
not as general as I'd like it to be, it is still useful as it is. I have a
design already spec'd which will do the following:
1) build/test a Perl module for release to CPAN
2) if #1 is successful, increment the module's $VERSION
3) generate a 'Changes' file from the log entries
4) create a tag for the release
5) make a distro based on the tag
6) optionally upload the module to CPAN
I intend to call it 'release' and it will make it much easier for me to manage
releases. The difference between now and later is that I will have to adjust
the VERSION property of the main .pm file directly; with inherited properties, I
would set it at the project level and all .pm files would get it automatically.
I fully intend to be involved (limited by tuits of course) in making sure that
inherited properties get developed for 2.0.0.
John
--
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4720 Boston Way
Lanham, MD 20706
301-459-3366 x.5010
fax 301-429-5747
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] Keyword hash and Properties as keyword
Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On Mar 20, 2004, at 9:25 PM, John Peacock wrote:
> Garrett Rooney wrote:
>> I mean I'm all for providing some kind of customization of keywords,
>> but I always assumed such customization would either be aliasing one
>> keyword to a new name (i.e. $Id$ -> $FreeBSD$ or something like
>> that), or providing a way to pick and chose the various bits of data
>> we already provide, so you could have a single keyword with both the
>> URL and the LastChangedRev or something...
>
> The problem with that is how to set it. There are no repository-wide
> configuration settings (currently) which could be used for that
> purpose. There is hardly any point doing a compile-time
> configuration. In the comments for subst.c, I point out exactly where
> to check any repository-wide configurations to create new custom
> keywords (once those exist).
Oh, I recognize that...
>> Just being able to plug in arbitrary properties doesn't seem all that
>> appealing to me, but you've put a fair amount of work into it, so I
>> assume there's something I'm missing...
>
> At the moment, it's not all that useful, I'll admit. Once we have
> inheritable properties, you could set a property called VERSION at the
> top of the directory tree, and all files requiring a version property
> would be automatically populated with that keyword.
Here's the thing. We haven't actually said we're going to have
inheritable properties, at least not that I'm aware of. Sure, I think
it would be useful, but since nobody is hacking on it right now, and we
don't seem to know for sure if they will in the future, adding this
feature now seems premature.
I'm all for adding extra features related to keywords, but if they
require either repository based config options on one side or
inheritable properties on the other, I'd much rather see those features
happen first, rather than adding features that are only going to be
really useful someday in the future when we add these other features.
I mean what if inheritable properties never materialize? Then we get
to support a less than entirely useful feature until the end of time,
which doesn't seem like the best way to go forward to me.
-garrett
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] Keyword hash and Properties as keyword
Posted by John Peacock <jp...@rowman.com>.
Garrett Rooney wrote:
> I mean I'm all for providing some kind of customization of keywords, but
> I always assumed such customization would either be aliasing one keyword
> to a new name (i.e. $Id$ -> $FreeBSD$ or something like that), or
> providing a way to pick and chose the various bits of data we already
> provide, so you could have a single keyword with both the URL and the
> LastChangedRev or something...
The problem with that is how to set it. There are no repository-wide
configuration settings (currently) which could be used for that purpose. There
is hardly any point doing a compile-time configuration. In the comments for
subst.c, I point out exactly where to check any repository-wide configurations
to create new custom keywords (once those exist).
>
> Just being able to plug in arbitrary properties doesn't seem all that
> appealing to me, but you've put a fair amount of work into it, so I
> assume there's something I'm missing...
At the moment, it's not all that useful, I'll admit. Once we have inheritable
properties, you could set a property called VERSION at the top of the directory
tree, and all files requiring a version property would be automatically
populated with that keyword.
John
--
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4720 Boston Way
Lanham, MD 20706
301-459-3366 x.5010
fax 301-429-5747
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] Keyword hash and Properties as keyword
Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On Mar 20, 2004, at 4:48 PM, John Peacock wrote:
> Yup, I figured as much. I wanted to get the rest of the patch out
> there to discuss how to best go about that. If there is a lot of
> resistance to the "property as keyword" feature itself, I don't want
> to spend too much [more] time upfront without knowing that first.
> Once we hash out whether this is suitable at all, I can work on how to
> make it ABI compatible...
I'm not sure I've ever heard a use case for this feature...
I mean I'm all for providing some kind of customization of keywords,
but I always assumed such customization would either be aliasing one
keyword to a new name (i.e. $Id$ -> $FreeBSD$ or something like that),
or providing a way to pick and chose the various bits of data we
already provide, so you could have a single keyword with both the URL
and the LastChangedRev or something...
Just being able to plug in arbitrary properties doesn't seem all that
appealing to me, but you've put a fair amount of work into it, so I
assume there's something I'm missing...
-garrett
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] Keyword hash and Properties as keyword
Posted by John Peacock <jp...@rowman.com>.
Philip Martin wrote:
>> /** Values used in keyword expansion. */
>>-typedef struct svn_subst_keywords_t
>>-{
>>- const svn_string_t *revision;
>>- const svn_string_t *date;
>>- const svn_string_t *author;
>>- const svn_string_t *url;
>>- const svn_string_t *id;
>>-} svn_subst_keywords_t;
>>+typedef apr_hash_t svn_subst_keywords_t;
>
>
> I haven't looked at the rest of the patch, but this jumped out. This
> is an ABI change just as much as changing a function signature and so
> it cannot go into 1.1. If you want to put this feature into 1.1. you
> will need to use a new type.
>
Yup, I figured as much. I wanted to get the rest of the patch out there to
discuss how to best go about that. If there is a lot of resistance to the
"property as keyword" feature itself, I don't want to spend too much [more] time
upfront without knowing that first. Once we hash out whether this is suitable
at all, I can work on how to make it ABI compatible...
John
--
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4720 Boston Way
Lanham, MD 20706
301-459-3366 x.5010
fax 301-429-5747
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] Keyword hash and Properties as keyword
Posted by Philip Martin <ph...@codematters.co.uk>.
John Peacock <jp...@rowman.com> writes:
> Index: /svn/trunk/subversion/include/svn_subst.h
> ==================================================================
> --- /svn/trunk/subversion/include/svn_subst.h (/svn/trunk/subversion/include/svn_subst.h) (revision 7672)
> +++ /svn/trunk/subversion/include/svn_subst.h (/svn/local/trunk/subversion/include/svn_subst.h) (revision 7672)
> @@ -76,26 +76,34 @@
>
>
> /** Values used in keyword expansion. */
> -typedef struct svn_subst_keywords_t
> -{
> - const svn_string_t *revision;
> - const svn_string_t *date;
> - const svn_string_t *author;
> - const svn_string_t *url;
> - const svn_string_t *id;
> -} svn_subst_keywords_t;
> +typedef apr_hash_t svn_subst_keywords_t;
I haven't looked at the rest of the patch, but this jumped out. This
is an ABI change just as much as changing a function signature and so
it cannot go into 1.1. If you want to put this feature into 1.1. you
will need to use a new type.
--
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org