zsh-users
 help / color / mirror / code / Atom feed
* Getting the CVS revision of Zsh
@ 2009-01-09 11:01 Richard Hartmann
  2009-01-09 11:21 ` Peter Stephenson
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Richard Hartmann @ 2009-01-09 11:01 UTC (permalink / raw)
  To: Zsh Users

Hi all,

I am wondering if there is any way to get the CVS revision number
of the sources a particular incarnation of Zsh was built with.
And yes, I am aware that distros apply patches, but it would still
be useful :)


Richard

PS: Is is zsh, Zsh, ZSH, Z-Shell, z-shell or what? It may sound
useless, but I care about that stuff and am never sure..


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Getting the CVS revision of Zsh
  2009-01-09 11:01 Getting the CVS revision of Zsh Richard Hartmann
@ 2009-01-09 11:21 ` Peter Stephenson
  2009-01-09 11:48   ` Richard Hartmann
  2009-01-09 11:21 ` AW: " Andreas Fleckl
  2009-01-14 13:33 ` Richard Hartmann
  2 siblings, 1 reply; 15+ messages in thread
From: Peter Stephenson @ 2009-01-09 11:21 UTC (permalink / raw)
  To: Richard Hartmann; +Cc: Zsh Users

"Richard Hartmann" wrote:
> Hi all,
> 
> I am wondering if there is any way to get the CVS revision number
> of the sources a particular incarnation of Zsh was built with.
> And yes, I am aware that distros apply patches, but it would still
> be useful :)

At the moment there isn't, but it would be possible to add the output
from

  cvs status ChangeLog | awk '/Working revision:/ { print $3 }'

to a variable such as $ZSH_PATCHLEVEL.  However, this needs careful
handling to make sure it doesn't get run where CVS isn't available.

> PS: Is is zsh, Zsh, ZSH, Z-Shell, z-shell or what? It may sound
> useless, but I care about that stuff and am never sure..

I tend to refer to it by the command name "zsh".  If you want an
expanded version it's less standard, but "Z shell" as in the manual or,
in titles such as that of the book "Z Shell", is probably good enough.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


^ permalink raw reply	[flat|nested] 15+ messages in thread

* AW: Getting the CVS revision of Zsh
  2009-01-09 11:01 Getting the CVS revision of Zsh Richard Hartmann
  2009-01-09 11:21 ` Peter Stephenson
@ 2009-01-09 11:21 ` Andreas Fleckl
  2009-01-14 13:33 ` Richard Hartmann
  2 siblings, 0 replies; 15+ messages in thread
From: Andreas Fleckl @ 2009-01-09 11:21 UTC (permalink / raw)
  To: Zsh Users

unsubscribe


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Getting the CVS revision of Zsh
  2009-01-09 11:21 ` Peter Stephenson
@ 2009-01-09 11:48   ` Richard Hartmann
  2009-01-09 11:58     ` Peter Stephenson
  0 siblings, 1 reply; 15+ messages in thread
From: Richard Hartmann @ 2009-01-09 11:48 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: Zsh Users

On Fri, Jan 9, 2009 at 12:21, Peter Stephenson <pws@csr.com> wrote:

>  cvs status ChangeLog | awk '/Working revision:/ { print $3 }'
>
> to a variable such as $ZSH_PATCHLEVEL.  However, this needs careful
> handling to make sure it doesn't get run where CVS isn't available.

I would prefer a file like zsh-revision to be introduced (and synced
from a CVS hook). That way, the information would make it both into
tarballs and the various git repositories cloned from the CVS one.
This file could then be read at compile-time.


> I tend to refer to it by the command name "zsh".  If you want an
> expanded version it's less standard, but "Z shell" as in the manual or,
> in titles such as that of the book "Z Shell", is probably good enough.

Thanks. zsh it is :)


Richard


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Getting the CVS revision of Zsh
  2009-01-09 11:48   ` Richard Hartmann
@ 2009-01-09 11:58     ` Peter Stephenson
  2009-01-09 12:41       ` Richard Hartmann
  0 siblings, 1 reply; 15+ messages in thread
From: Peter Stephenson @ 2009-01-09 11:58 UTC (permalink / raw)
  To: Richard Hartmann; +Cc: Zsh Users

"Richard Hartmann" wrote:
> On Fri, Jan 9, 2009 at 12:21, Peter Stephenson <pws@csr.com> wrote:
> 
> >  cvs status ChangeLog | awk '/Working revision:/ { print $3 }'
> >
> > to a variable such as $ZSH_PATCHLEVEL.  However, this needs careful
> > handling to make sure it doesn't get run where CVS isn't available.
> 
> I would prefer a file like zsh-revision to be introduced (and synced
> from a CVS hook). That way, the information would make it both into
> tarballs and the various git repositories cloned from the CVS one.
> This file could then be read at compile-time.

If I were doing it, the output would go into zsh_patchlevel.h
which would be distributed and then #include'd where necessary.  The
trick is regenerating that file at the right point and only at the right
point.

Arranging for this always to be updated in CVS on all commits is another
job I would leave to someone else, but provided you "make" and re-commit
it will work.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Getting the CVS revision of Zsh
  2009-01-09 11:58     ` Peter Stephenson
@ 2009-01-09 12:41       ` Richard Hartmann
  2009-01-09 12:58         ` Peter Stephenson
  2009-01-09 16:42         ` Andrey Borzenkov
  0 siblings, 2 replies; 15+ messages in thread
From: Richard Hartmann @ 2009-01-09 12:41 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: Zsh Users

On Fri, Jan 9, 2009 at 12:58, Peter Stephenson <pws@csr.com> wrote:

> Arranging for this always to be updated in CVS on all commits is another
> job I would leave to someone else, but provided you "make" and re-commit
> it will work.

I have literally no cvs-fu left. Would do it for svn or git, but with
cvs, I fear I
will have to call on the subscribers-at-large for someone to write the script
and to tell us how to hook it.


Richard

PS: Does cvs have something like $Id$ etc? That might be the easiest
thing to use


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Getting the CVS revision of Zsh
  2009-01-09 12:41       ` Richard Hartmann
@ 2009-01-09 12:58         ` Peter Stephenson
  2009-01-09 13:07           ` Richard Hartmann
  2009-01-09 16:42         ` Andrey Borzenkov
  1 sibling, 1 reply; 15+ messages in thread
From: Peter Stephenson @ 2009-01-09 12:58 UTC (permalink / raw)
  To: Zsh Users

"Richard Hartmann" wrote:
> PS: Does cvs have something like $Id$ etc? That might be the easiest
> thing to use

Hmm... yes, grepping an $Id$ out of ChangeLog, which should always be
present, ought to be good enough.  It probably needs to be added at the
end.  That's considerably simpler.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Getting the CVS revision of Zsh
  2009-01-09 12:58         ` Peter Stephenson
@ 2009-01-09 13:07           ` Richard Hartmann
  0 siblings, 0 replies; 15+ messages in thread
From: Richard Hartmann @ 2009-01-09 13:07 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: Zsh Users

On Fri, Jan 9, 2009 at 13:58, Peter Stephenson <pws@csr.com> wrote:

> Hmm... yes, grepping an $Id$ out of ChangeLog, which should always be
> present, ought to be good enough.  It probably needs to be added at the
> end.  That's considerably simpler.

The docs[1] tell me there is a $Revision$


Richard

[1] http://developer.apple.com/opensource/cvs/cederquist/cvs_92.html#SEC93


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Getting the CVS revision of Zsh
  2009-01-09 12:41       ` Richard Hartmann
  2009-01-09 12:58         ` Peter Stephenson
@ 2009-01-09 16:42         ` Andrey Borzenkov
  2009-01-09 17:02           ` Peter Stephenson
  1 sibling, 1 reply; 15+ messages in thread
From: Andrey Borzenkov @ 2009-01-09 16:42 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 702 bytes --]

On Пятница 09 января 2009 15:41:54 Richard Hartmann wrote:
> On Fri, Jan 9, 2009 at 12:58, Peter Stephenson <pws@csr.com> wrote:
> > Arranging for this always to be updated in CVS on all commits is
> > another job I would leave to someone else, but provided you "make"
> > and re-commit it will work.
>
> I have literally no cvs-fu left. Would do it for svn or git, but with
> cvs, I fear I
> will have to call on the subscribers-at-large for someone to write
> the script and to tell us how to hook it.
>

I'd really prefer SVN or GIT as well. SVN should be relatively 
straightforward given that SF supports it. Even if my personal 
preference is GIT for several reasons.

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Getting the CVS revision of Zsh
  2009-01-09 16:42         ` Andrey Borzenkov
@ 2009-01-09 17:02           ` Peter Stephenson
  2009-01-09 22:39             ` Richard Hartmann
  0 siblings, 1 reply; 15+ messages in thread
From: Peter Stephenson @ 2009-01-09 17:02 UTC (permalink / raw)
  To: Andrey Borzenkov; +Cc: zsh-users

Andrey Borzenkov wrote:
> Richard Hartmann wrote:
> > On Fri, Jan 9, 2009 at 12:58, Peter Stephenson <pws@csr.com> wrote:
> > > Arranging for this always to be updated in CVS on all commits is
> > > another job I would leave to someone else, but provided you "make"
> > > and re-commit it will work.
> >
> > I have literally no cvs-fu left. Would do it for svn or git, but with
> > cvs, I fear I
> > will have to call on the subscribers-at-large for someone to write
> > the script and to tell us how to hook it.
> 
> I'd really prefer SVN or GIT as well. SVN should be relatively
> straightforward given that SF supports it. Even if my personal
> preference is GIT for several reasons.

I have no enthusiasm for tracking the trendiest source code management
system.  I've got enough real problems without inventing them.  CVS does
the fairly limited stuff we actually need for committing code and the
git mirror provides git junkies with access.

I'm not interested in hearing how great anyone's favourite system is,
either, I'm afraid.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Getting the CVS revision of Zsh
  2009-01-09 17:02           ` Peter Stephenson
@ 2009-01-09 22:39             ` Richard Hartmann
  0 siblings, 0 replies; 15+ messages in thread
From: Richard Hartmann @ 2009-01-09 22:39 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: Andrey Borzenkov, zsh-users

On Fri, Jan 9, 2009 at 18:02, Peter Stephenson <pws@csr.com> wrote:

> I have no enthusiasm for tracking the trendiest source code management
> system.  I've got enough real problems without inventing them.  CVS does
> the fairly limited stuff we actually need for committing code and the
> git mirror provides git junkies with access.

I should not have brought the topic up. It was meant in an informational
way, but I should have anticipated such a reaction by others.
Sorry.


> I'm not interested in hearing how great anyone's favourite system is,
> either, I'm afraid.

And I just wanted to tell you about how great zsh is.. ;)


Richard


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Getting the CVS revision of Zsh
  2009-01-09 11:01 Getting the CVS revision of Zsh Richard Hartmann
  2009-01-09 11:21 ` Peter Stephenson
  2009-01-09 11:21 ` AW: " Andreas Fleckl
@ 2009-01-14 13:33 ` Richard Hartmann
  2009-01-14 16:57   ` Bart Schaefer
  2009-01-14 17:13   ` Greg Klanderman
  2 siblings, 2 replies; 15+ messages in thread
From: Richard Hartmann @ 2009-01-14 13:33 UTC (permalink / raw)
  To: Zsh Users

On Fri, Jan 9, 2009 at 12:01, Richard Hartmann
<richih.mailinglist@gmail.com> wrote:

> I am wondering if there is any way to get the CVS revision number
> of the sources a particular incarnation of Zsh was built with.
> And yes, I am aware that distros apply patches, but it would still
> be useful :)

After some more thinking, another interesting tidbit of information
would be if the instance of zsh which is running is a released
version. $ZSH_PATCHLEVEL itself does not show that, it simply
tells the user about the revision, nothing more.
$ZSH_VERSION is not really suited imho as it will always be
filled and thus requires parsing.

My suggestion would be to introduce a new variable called
$ZSH_RELEASE which is only filled if the source zsh was
compiled from is tagged as a release.

I.e. in the next release, I would be able to do

% echo $ZSH_PATCHLEVEL
1234
% echo $ZSH_RELEASE
4.3.10
%


Thoughts?


Richard

PS: Maybe there is a clean way in current zsh to do this?


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Getting the CVS revision of Zsh
  2009-01-14 13:33 ` Richard Hartmann
@ 2009-01-14 16:57   ` Bart Schaefer
  2009-01-14 17:13   ` Greg Klanderman
  1 sibling, 0 replies; 15+ messages in thread
From: Bart Schaefer @ 2009-01-14 16:57 UTC (permalink / raw)
  To: Zsh Users

On Jan 14,  2:33pm, Richard Hartmann wrote:
}
} My suggestion would be to introduce a new variable called
} $ZSH_RELEASE which is only filled if the source zsh was
} compiled from is tagged as a release.
} 
} Thoughts?

My thought is that all of this, including ZSH_PATCHLEVEL, should
never have been bothered with in the first place.

Either you're compiling zsh from source yourself, in which case you
should know what you're compiling; or you're using a package that was
installed by somebody else, in which case it's between you and that
somebody if you're having bleeding-edge non-releases forced on you.

If you're a packager like Debian or RedHat who occasionally ports
individual patches backwards or sideways or makes your own stability
patches, anything in these variables is going to be either wrong and
misleading to the end user or fabricated and meaningless to the zsh
developers upstream.

I was holding my tongue on ZSH_PATCHLEVEL despite my annoyance that
it uses the RCS $Revision: tag -- I mirror the zsh sources into my
own local repository, which means that tag gets rewritten whenever
I do a check-in, so my local build will rarely if ever match the
"real thing", hence it's useless cruft to me -- and I suppose it's
up to PWS if he wants to jump through the hoops to make something
like this appear to work, but I'm completely unconvinced by the
argument that they're in some way beneficial.


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Getting the CVS revision of Zsh
  2009-01-14 13:33 ` Richard Hartmann
  2009-01-14 16:57   ` Bart Schaefer
@ 2009-01-14 17:13   ` Greg Klanderman
  2009-01-14 17:30     ` Peter Stephenson
  1 sibling, 1 reply; 15+ messages in thread
From: Greg Klanderman @ 2009-01-14 17:13 UTC (permalink / raw)
  To: zsh-users

>>>>> Richard Hartmann <richih.mailinglist@gmail.com> writes:

> % echo $ZSH_PATCHLEVEL
> 1234

To me, "patchlevel" indicates the patch version of a release, i.e. the
third number in ZSH_VERSION.

Something like ZSH_VCSREVISION to me would be a much better name, or
ZSH_CVSREVISION if you don't care about being version control system
neutral.

The other question I had on this is whether ChangeLog is necessarily
updated with every checkin to zsh source code?

> % echo $ZSH_RELEASE
> 4.3.10

Seems reasonable.  You really should just need a boolean value, as
ZSH_VERSION better be the same when ZSH_RELEASE is set.

> PS: Maybe there is a clean way in current zsh to do this?

Check that there's not a "-" in ZSH_VERSION?

greg


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Getting the CVS revision of Zsh
  2009-01-14 17:13   ` Greg Klanderman
@ 2009-01-14 17:30     ` Peter Stephenson
  0 siblings, 0 replies; 15+ messages in thread
From: Peter Stephenson @ 2009-01-14 17:30 UTC (permalink / raw)
  To: zsh-users

Greg Klanderman wrote:
> >>>>> Richard Hartmann <richih.mailinglist@gmail.com> writes:
> 
> > % echo $ZSH_PATCHLEVEL
> > 1234
> 
> To me, "patchlevel" indicates the patch version of a release, i.e. the
> third number in ZSH_VERSION.

To me a patch is quite clearly a single change for a particular purpose.
I'm not aware of anything that would lead people to suppose it was part
of the version number.  In any case, the fact it's separate here means
it obviously isn't.  However, it's deliberately vague what a "patch"
is.  It means basically nothing more than "the shell changed".

> Something like ZSH_VCSREVISION to me would be a much better name, or
> ZSH_CVSREVISION if you don't care about being version control system
> neutral.

I don't really like variable names to be that geeky and obscure, and if
you're going to be that specific you'd need to call it
ZSH_CVS_CHANGELOG_REVISION.  It's aimed at users sophisticated enough to
know that a "patch" is a single software change, but not necessarily au
fait with revision control, which is an implementation detail.

> The other question I had on this is whether ChangeLog is necessarily
> updated with every checkin to zsh source code?

It's supposed to be, if people are doing the right thing, and I think
they mostly are.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2009-01-14 17:34 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-09 11:01 Getting the CVS revision of Zsh Richard Hartmann
2009-01-09 11:21 ` Peter Stephenson
2009-01-09 11:48   ` Richard Hartmann
2009-01-09 11:58     ` Peter Stephenson
2009-01-09 12:41       ` Richard Hartmann
2009-01-09 12:58         ` Peter Stephenson
2009-01-09 13:07           ` Richard Hartmann
2009-01-09 16:42         ` Andrey Borzenkov
2009-01-09 17:02           ` Peter Stephenson
2009-01-09 22:39             ` Richard Hartmann
2009-01-09 11:21 ` AW: " Andreas Fleckl
2009-01-14 13:33 ` Richard Hartmann
2009-01-14 16:57   ` Bart Schaefer
2009-01-14 17:13   ` Greg Klanderman
2009-01-14 17:30     ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).