Discussion:
How to detect new CVS dirs
Peter Toft
2011-07-06 21:45:39 UTC
Permalink
Hi all

I have a small brain-teaser for the CVS-gurus....

Assume
that I "pto" have a CVS module checked out, and the user "donald" have
the same module checked out -

both on HEAD version. Then "donald" adds
two dirs (Donald/ + Scrooge/) and one file (Scrooge/McDuck)

mkdir
Donald

mkdir Scrooge

echo "money" > Scrooge/McDuck

cvs add
Donald Scrooge

cvs commit Donald Scrooge

cvs add Scrooge/McDuck


cvs commit -m "Money makes the world go around" Scrooge/McDuck

My
question to you is how can "pto" detect what "donald" did - WITHOUT
changing the files locally.

Part of the question is solved by running


cvs -q -n update -AdP

However now it gets a bit more blurry....

I
will see the directories "Donald" and "Scrooge" in my stderr output


cvs update: New directory `Donald' -- ignored

cvs update: New
directory `Scrooge' -- ignored

well - I kinda dislike this, since a
real "cvs update -AdP will prune the empty "Donald" away i.e. I cannot
see

why "cvs -q -n update -AdP" should show this. Comments on this?


The other issue is that I cannot see the file "Scrooge/McDuck" with my
"cvs -q -n update -AdP".

Clues to get that information - again without
actually modifying the local files of me? Comments?

I can solve this
by first doing an actual update of the two dirs, and see what I get -
and then remove the

two dirs, but I would like to solve this with
that strategy.

Best

Peter Toft
--
Peter Toft,
PhD
http://petertoft.dk
Arthur Barrett
2011-07-07 08:39:12 UTC
Permalink
Hi Peter,

What version client, and what version of server? CVS 1.12 and CVSNT 2.5/2.8 have commands that older releases like CVS 1.10 do not.

Let me ask a fundamental question: why?

I ask this because I've often seen complex technical questions disguise a perfectly simple requirement that is solved a different way by CVS.

Software that detects changes in the repository, and advises users of this is quite common. And commonly done poorly. eg: Eclipse 'syncronise' and Oracle JDeveloper. At least in the case or Oracle, the JDeveloper team did contact us at some point to ask suggestions of how to do it 'better'. And I applaud you too for asking.

Technically my answer is that commitlog is the way to achieve this. ie: when the server receives a change, it can trigger some event (typically sending an e-mail) and client apps can use that information, or query that information to get the result. Typically this answer is not well liked. Developers of GUIs often want something like what you are asking for, i.e.: oh just run command xyz and it'll tell you....

So here are some more technical thoughts:

1. you could use a variation of 'cvs log' to find all changes between two points in time - the time your sandbox was last updated and the current time.

2. you could use 'cvs rls' to get a listing of a directory and compare it to your own directory.

3. try to avoid complex 'cvs -n ' cases - or at least test them thoroughly. I mostly work on CVSNT (forked from CVS several years ago to support additional features), and I know that in many cases cvsnt 'cvs -n' does not do what it is advertised to do. In fact we only 'support' a couple of specific cases of 'cvs -n up' since we consider it an 'outdated/deprecated' way to 'list modules'. After 7 years and about 7 million downloads we've only ever had 1 person notice - and they were a CVS developer (GUI) not a 'person using CVS'. My point? 'cvs -n' is not widely used and therefore probably not widely tested.


Regards,



Arthur Barrett




-----Original Message-----
From: info-cvs-bounces+arthur.barrett=march-***@nongnu.org on behalf of Peter Toft
Sent: Thu 07/07/2011 7:45 AM
To: Info cvs
Cc:
Subject: How to detect new CVS dirs



Hi all

I have a small brain-teaser for the CVS-gurus....

Assume
that I "pto" have a CVS module checked out, and the user "donald" have
the same module checked out -

both on HEAD version. Then "donald" adds
two dirs (Donald/ + Scrooge/) and one file (Scrooge/McDuck)

mkdir
Donald

mkdir Scrooge

echo "money" > Scrooge/McDuck

cvs add
Donald Scrooge

cvs commit Donald Scrooge

cvs add Scrooge/McDuck


cvs commit -m "Money makes the world go around" Scrooge/McDuck

My
question to you is how can "pto" detect what "donald" did - WITHOUT
changing the files locally.

Part of the question is solved by running


cvs -q -n update -AdP

However now it gets a bit more blurry....

I
will see the directories "Donald" and "Scrooge" in my stderr output


cvs update: New directory `Donald' -- ignored

cvs update: New
directory `Scrooge' -- ignored

well - I kinda dislike this, since a
real "cvs update -AdP will prune the empty "Donald" away i.e. I cannot
see

why "cvs -q -n update -AdP" should show this. Comments on this?


The other issue is that I cannot see the file "Scrooge/McDuck" with my
"cvs -q -n update -AdP".

Clues to get that information - again without
actually modifying the local files of me? Comments?

I can solve this
by first doing an actual update of the two dirs, and see what I get -
and then remove the

two dirs, but I would like to solve this with
that strategy.

Best

Peter Toft
--
Peter Toft,
PhD
http://petertoft.dk
Peter Toft
2011-07-07 11:27:19 UTC
Permalink
On Thu, 7 Jul 2011 19:39:12 +1100, Arthur Barrett wrote:

CVS
1.12.13 in both ends.

Your fundamental question "why" - well it is for
a Python rework of the old "cvsstat"

I wrote many years ago ->
http://cvs.sslug.dk/cvs2html/ [3]

i.e. in order to answer "why do I
get if I would update?" - very relevant question IMHO.

* cvs lrs ->
NICE one - I will check this one out - never used it

* cvs log -> I
want to avoid this since I normally have quite big projects, i.e. cvs
log will give a lot of output.

THANX!

Best

Peter
Post by Arthur Barrett
Hi Peter,
What version client, and what version of server? CVS 1.12 and CVSNT
2.5/2.8 have commands that older releases like CVS 1.10 do not.
Post by Arthur Barrett
Let
me ask a fundamental question: why?
Post by Arthur Barrett
I ask this because I've often
seen complex technical questions disguise a perfectly simple requirement
that is solved a different way by CVS.
Post by Arthur Barrett
Software that detects
changes in the repository, and advises users of this is quite common.
And commonly done poorly. eg: Eclipse 'syncronise' and Oracle
JDeveloper. At least in the case or Oracle, the JDeveloper team did
contact us at some point to ask suggestions of how to do it 'better'.
And I applaud you too for asking.
Post by Arthur Barrett
Technically my answer is that
commitlog is the way to achieve this. ie: when the server receives a
change, it can trigger some event (typically sending an e-mail) and
client apps can use that information, or query that information to get
the result. Typically this answer is not well liked. Developers of GUIs
often want something like what you are asking for, i.e.: oh just run
command xyz and it'll tell you....
Post by Arthur Barrett
So here are some more technical
1. you could use a variation of 'cvs log' to find all
changes between two points in time - the time your sandbox was last
updated and the current time.
Post by Arthur Barrett
2. you could use 'cvs rls' to get a
listing of a directory and compare it to your own directory.
Post by Arthur Barrett
3. try
to avoid complex 'cvs -n ' cases - or at least test them thoroughly. I
mostly work on CVSNT (forked from CVS several years ago to support
additional features), and I know that in many cases cvsnt 'cvs -n' does
not do what it is advertised to do. In fact we only 'support' a couple
of specific cases of 'cvs -n up' since we consider it an
'outdated/deprecated' way to 'list modules'. After 7 years and about 7
million downloads we've only ever had 1 person notice - and they were a
CVS developer (GUI) not a 'person using CVS'. My point? 'cvs -n' is not
widely used and therefore probably not widely tested.
Post by Arthur Barrett
Regards,
Arthur Barrett
Post by Arthur Barrett
-----Original Message-----
info-cvs-bounces+arthur.barrett=march-***@nongnu.org [1] on behalf
of Peter Toft
Post by Arthur Barrett
Sent: Thu 07/07/2011 7:45 AM
To: Info cvs
Subject: How to detect new CVS dirs
Post by Arthur Barrett
Hi all
I have a small
brain-teaser for the CVS-gurus....
Post by Arthur Barrett
Assume
that I "pto" have a
CVS module checked out, and the user "donald" have
Post by Arthur Barrett
the same module
checked out -
Post by Arthur Barrett
both on HEAD version. Then "donald" adds
two dirs
(Donald/ + Scrooge/) and one file (Scrooge/McDuck)
Post by Arthur Barrett
mkdir
Donald
mkdir Scrooge
echo "money" > Scrooge/McDuck
cvs add
Donald Scrooge
Post by Arthur Barrett
cvs commit Donald Scrooge
cvs add
Scrooge/McDuck
Post by Arthur Barrett
cvs commit -m "Money makes the world go around"
Scrooge/McDuck
Post by Arthur Barrett
My
question to you is how can "pto" detect what
"donald" did - WITHOUT
Post by Arthur Barrett
changing the files locally.
Part of the
question is solved by running
Post by Arthur Barrett
cvs -q -n update -AdP
However
now it gets a bit more blurry....
Post by Arthur Barrett
I
will see the directories
"Donald" and "Scrooge" in my stderr output
Post by Arthur Barrett
cvs update: New
directory `Donald' -- ignored
Post by Arthur Barrett
cvs update: New
directory
`Scrooge' -- ignored
Post by Arthur Barrett
well - I kinda dislike this, since a
real
"cvs update -AdP will prune the empty "Donald" away i.e. I cannot
Post by Arthur Barrett
see
why "cvs -q -n update -AdP" should show this. Comments on this?
The other issue is that I cannot see the file "Scrooge/McDuck" with my
"cvs -q -n update -AdP".
Clues to get that information -
again without
Post by Arthur Barrett
actually modifying the local files of me? Comments?
I can solve this
by first doing an actual update of the two dirs,
and see what I get -
Post by Arthur Barrett
and then remove the
two dirs, but I would
like to solve this with
Post by Arthur Barrett
that strategy.
Best
Peter Toft
--
Peter Toft,
PhD
http://petertoft.dk [2]
--
Peter Toft,
PhD
http://petertoft.dk


Links:
------
[1]
mailto:info-cvs-bounces+arthur.barrett=march-***@nongnu.org
[2]
http://petertoft.dk
[3] http://cvs.sslug.dk/cvs2html/
Loading...