OpenSolaris

Discussions Communities Projects Download Source Browser

Home » OpenSolaris Forums » tools » discuss

Thread: Keywords syntax in Mercurial repository

Welcome, Guest Help
Login Login
Guest Settings Guest Settings
Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 9 - Last Post: May 28, 2006 8:10 PM by: carlsonj
stevel

Posts: 1,156
From: US

Registered: 3/9/05
Keywords syntax in Mercurial repository
Posted: May 22, 2006 2:40 PM

  Click to reply to this thread Reply

I just wanted to start a discussion on what format we want to use for
keywords in ON. Currently, the #ident we use is something akin to:

# ident "%Z%%M% %I% %E% SMI"

which expands out to something like:

# ident "@(#)Makefile.master 1.204 06/04/13 SMI"

Currently, I've got a Mercurial python hook that will expand $Id$ to
something like:

$Id: fubar 9f7070beca6e 2006-05-23 stevel $

so my proposal is to adopt a #ident syntax of:

# ident $Id$ SMI.

What do people think of this? It's easy enough to change the format,
I'd just like to start getting this settled as its one of the points
we'll need to address in the conversion from Teamware to Mercurial.

I prefer the $Id$ syntax, since it's also supported under Subversion.

cheers,
steve
--
stephen lau // stevel at sun dot com | 650.786.0845 | http://whacked.net
opensolaris // solaris kernel development
_______________________________________________
tools-discuss mailing list
tools-discuss at opensolaris dot org



alanc

Posts: 5,506
From: US

Registered: 3/9/05
Re: Keywords syntax in Mercurial repository
Posted: May 22, 2006 3:01 PM   in response to: stevel

  Click to reply to this thread Reply

Stephen Lau wrote:
> Currently, I've got a Mercurial python hook that will expand $Id$ to
> something like:
>
> $Id: fubar 9f7070beca6e 2006-05-23 stevel $
>
> so my proposal is to adopt a #ident syntax of:
>
> # ident $Id$ SMI.
>
> What do people think of this? It's easy enough to change the format,
> I'd just like to start getting this settled as its one of the points
> we'll need to address in the conversion from Teamware to Mercurial.

Will /usr/ccs/bin/what, mcs, showrev, and similar tools be updated to
search for $Id.*$ instead of @(#) ?

--
-Alan Coopersmith- alan dot coopersmith at sun dot com
Sun Microsystems, Inc. - X Window System Engineering
_______________________________________________
tools-discuss mailing list
tools-discuss at opensolaris dot org



richlowe

Posts: 770
From: US

Registered: 6/17/05
Re: Keywords syntax in Mercurial repository
Posted: May 22, 2006 3:34 PM   in response to: alanc

  Click to reply to this thread Reply

Alan Coopersmith <alan dot coopersmith at sun dot com> writes:

> Stephen Lau wrote:
>> Currently, I've got a Mercurial python hook that will expand $Id$ to
>> something like:
>> $Id: fubar 9f7070beca6e 2006-05-23 stevel $
>> so my proposal is to adopt a #ident syntax of:
>> # ident $Id$ SMI.
>> What do people think of this? It's easy enough to change the
>> format, I'd just like to start getting this settled as its one of
>> the points we'll need to address in the conversion from Teamware to
>> Mercurial.
>
> Will /usr/ccs/bin/what, mcs, showrev, and similar tools be updated to
> search for $Id.*$ instead of @(#) ?

I'd say "In addition to" rather than instead of.
I don't believe (at a quick glance) that mcs(1) has any intimate
knowledge of @(#), so that should be safe.

Given that what(1) has to continue using @(#) (in addition, perhaps), it
seems reasonable not to change the post processing rules in ON and
similar to use $Id:.*$ for no reason.

-- Rich.
_______________________________________________
tools-discuss mailing list
tools-discuss at opensolaris dot org



richlowe

Posts: 770
From: US

Registered: 6/17/05
Re: Keywords syntax in Mercurial repository
Posted: May 22, 2006 3:13 PM   in response to: stevel

  Click to reply to this thread Reply

Stephen Lau <stevel at sun dot com> writes:

> I just wanted to start a discussion on what format we want to use for
> keywords in ON. Currently, the #ident we use is something akin to:
>
> # ident "%Z%%M% %I% %E% SMI"
>
> which expands out to something like:
>
> # ident "@(#)Makefile.master 1.204 06/04/13 SMI"
>
> Currently, I've got a Mercurial python hook that will expand $Id$ to
> something like:
>
> $Id: fubar 9f7070beca6e 2006-05-23 stevel $
>
> so my proposal is to adopt a #ident syntax of:
>
> # ident $Id$ SMI.
>
> What do people think of this? It's easy enough to change the format,
> I'd just like to start getting this settled as its one of the points
> we'll need to address in the conversion from Teamware to Mercurial.
>
> I prefer the $Id$ syntax, since it's also supported under Subversion.
>

Agreed, it's better to be consistent.

The date section will need to be UTC to have any coherent meaning,
since keywords will be expanded pre-commit rather than on checkout
as now, which raises the possibility of them being spread between a
variety of timezones.

It would be nice if they could be unexpanded for the purposes of
merging (doable with a snippet of code wrapping the merge program, if
there's no hook it can be done in), since this should remove the
spurious conflict of both parties changes having updated the ident.

-- Rich.
_______________________________________________
tools-discuss mailing list
tools-discuss at opensolaris dot org



sommerfe

Posts: 976
From: US

Registered: 3/9/05
Re: Keywords syntax in Mercurial repository
Posted: May 23, 2006 8:44 PM   in response to: stevel

  Click to reply to this thread Reply

On Mon, 2006-05-22 at 17:40, Stephen Lau wrote:
> I prefer the $Id$ syntax, since it's also supported under Subversion.

Existing practice among the *BSD's is to define *specific* $Keyword$
(such as $NetBSD$/$OpenBSD$/$FreeBSD$) recognized only by the master
repository so that folks checking copies of the files into their own SCM
system don't lose the original.

I suspect we may need to put something like: @(#)$Id$ so as to not
confuse old versions of what(1).

> Will /usr/ccs/bin/what, mcs, showrev, and similar tools be updated to
> search for $Id.*$ instead of @(#) ?

There's already a tool (part of RCS) to search for $Keyword$ in files:
"ident".

Perhaps more problematic: a number of kernel modules embed keywords like
%I% in literal strings which become admin-visible, especially in
"modstat" output.

What do you propose to do about this?

- Bill


_______________________________________________
tools-discuss mailing list
tools-discuss at opensolaris dot org



alanc

Posts: 5,506
From: US

Registered: 3/9/05
Re: Keywords syntax in Mercurial repository
Posted: May 23, 2006 9:16 PM   in response to: sommerfe

  Click to reply to this thread Reply

Bill Sommerfeld wrote:
> Perhaps more problematic: a number of kernel modules embed keywords like
> %I% in literal strings which become admin-visible, especially in
> "modstat" output.

Hopefully it won't result in more instances like this in modinfo:

69 fffffffff5bb5000 4d91b8 187 1 nvidia (nvidia %I% May 3 2006 15:03:18)

--
-Alan Coopersmith- alan dot coopersmith at sun dot com
Sun Microsystems, Inc. - X Window System Engineering
_______________________________________________
tools-discuss mailing list
tools-discuss at opensolaris dot org



stevel

Posts: 1,156
From: US

Registered: 3/9/05
Re: Keywords syntax in Mercurial repository
Posted: May 24, 2006 9:38 AM   in response to: sommerfe

  Click to reply to this thread Reply

Bill Sommerfeld wrote:
> Perhaps more problematic: a number of kernel modules embed keywords like
> %I% in literal strings which become admin-visible, especially in
> "modstat" output.
>
> What do you propose to do about this?

I believe the plan is to remove these...

cheers,
steve
--
stephen lau // stevel at sun dot com | 650.786.0845 | http://whacked.net
opensolaris // solaris kernel development
_______________________________________________
tools-discuss mailing list
tools-discuss at opensolaris dot org



jmcp

Posts: 937
From: AU

Registered: 3/9/05
Re: Keywords syntax in Mercurial repository
Posted: May 28, 2006 5:55 AM   in response to: stevel

  Click to reply to this thread Reply

Stephen Lau wrote:
> Bill Sommerfeld wrote:
>> Perhaps more problematic: a number of kernel modules embed keywords like
>> %I% in literal strings which become admin-visible, especially in
>> "modstat" output.
>> What do you propose to do about this?
> I believe the plan is to remove these...

Whoa there, tiger! Where and by whom is this plan being developed?
It's certainly news to me.

Is this supposed to be a directive which gets enforced for every
consolidation? Has there been communication with the non-ON cteams
on this matter?

There are a heck of a lot of scripts and analysis which Support
services people depend on that make use of the %I% information.

What do you propose to replace the %I% with?


James C. McPherson
--
Solaris Datapath Engineering
Data Management Group
Sun Microsystems
_______________________________________________
tools-discuss mailing list
tools-discuss at opensolaris dot org



carlsonj

Posts: 6,813
From: US

Registered: 3/9/05
Re: Keywords syntax in Mercurial repository
Posted: May 28, 2006 8:10 PM   in response to: jmcp

  Click to reply to this thread Reply

James C. McPherson writes:
> Stephen Lau wrote:
> > Bill Sommerfeld wrote:
> >> Perhaps more problematic: a number of kernel modules embed keywords like
> >> %I% in literal strings which become admin-visible, especially in
> >> "modstat" output.
> >> What do you propose to do about this?
> > I believe the plan is to remove these...
>
> Whoa there, tiger! Where and by whom is this plan being developed?
> It's certainly news to me.

It's news to me, too, but it doesn't seem surprising. I've always
viewed those as a bit grotty as they don't give the real versioning
information.

It's not real because:

- It's just the SID on the one file that has the string compiled
into it for modinfo. Most kernel modules consist of *MULTIPLE*
source files and the one with this string is often the one that
just has the kernel linkage glue, which rarely (if ever) changes.
Thus, you won't necessarily see it updated when something in the
driver changes.

- It bears no relationship to patch ID numbers, releases, or any
other "official" source of information. This means that you need
to have an illuminated manuscript somewhere engraved with the
mappings between SIDs and patches for every single release. We've
likely got better things to do with our time than manual
compilation of data like that.

> There are a heck of a lot of scripts and analysis which Support
> services people depend on that make use of the %I% information.

Really? Where is that text format documented in way that makes it
possible for some automated tool to _depend_ on it?

That smells like a hack to me. The same rules that go for customers
go for these sorts of scripts: if we haven't documented the format in
a way allows you to parse it, and if you haven't negotiated a contract
on the interface to hold the format stable, then your script can't be
supported and almost certainly will break in the future. It's only a
question of "when," not "if."

That could be a bad thing if it's an important script.

In any event, it looks like you've got the attention of the right
audience. The next step is to outline the _specific_ requirements
(not just "we need the SCCS SID buried in the text"), and then make
sure this new system being proposed gives you some suitably stable way
to get at the information you need.

And I hope it's not just groveling through modinfo tea leaves ...

--
James Carlson, KISS Network <james dot d dot carlson at sun dot com>
Sun Microsystems / 1 Network Drive 71.232W Vox +1 781 442 2084
MS UBUR02-212 / Burlington MA 01803-2757 42.496N Fax +1 781 442 1677
_______________________________________________
tools-discuss mailing list
tools-discuss at opensolaris dot org



richlowe

Posts: 770
From: US

Registered: 6/17/05
Re: Keywords syntax in Mercurial repository
Posted: May 25, 2006 7:04 PM   in response to: sommerfe

  Click to reply to this thread Reply

Bill Sommerfeld <sommerfeld at sun dot com> writes:

> On Mon, 2006-05-22 at 17:40, Stephen Lau wrote:
>> I prefer the $Id$ syntax, since it's also supported under Subversion.
>
> Existing practice among the *BSD's is to define *specific* $Keyword$
> (such as $NetBSD$/$OpenBSD$/$FreeBSD$) recognized only by the master
> repository so that folks checking copies of the files into their own SCM
> system don't lose the original.

I agree that this is generally desirable, but as far as I can tell
subversion has no support for custom keyword expansion, so it would
require modifying subversion to handle it.

Using $SMI$ as the tag would seem preferable if that was done, since
(as best I can tell) it effectively would cover its current usage also.

-- Rich
_______________________________________________
tools-discuss mailing list
tools-discuss at opensolaris dot org






Terms of Use | Privacy | Trademarks | Copyright Policy | Site Guidelines
Your use of this web site or any of its content or software indicates your agreement to be bound by these Terms of Use.
Copyright © 1995-2005 Sun Microsystems, Inc.