[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CVS diff and unknown files.

From: Sergei Organov
Subject: Re: CVS diff and unknown files.
Date: 30 Jan 2005 17:40:23 +0300
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Common Lisp)

Paul Sander <address@hidden> writes:
> On Jan 28, 2005, at 8:50 AM, address@hidden wrote:
> > Paul Sander <address@hidden> writes:
> >> On Jan 27, 2005, at 1:07 AM, address@hidden wrote:
> > [...]
> >>> Just to understand your point better, do you propose 'cvs add -c
> >>> new_file' and 'cvs ci new_file' run exactly the same set of triggers?
> >>> Different sets?
> >>
> >> I think the consensus in the last iteration of the topic was that, if
> >> add-time triggers were implemented, they would run as a client-side
> >> option at add-time and and be obligatory at commit time, preceding
> >> commit-time triggers. Doubling the overhead was the only way we came
> >> up with at the time that guaranteed that the add-time triggers fired
> >> at least once prior to the first commit of a new file.
> >
> > Well, so the answer to my question is "the two trigger sets are
> > different". But it in turn means that it could be the case that I won't
> > be able to 'cvs ci new_file' even though 'cvs add -c new_file' just said
> > the file is OK to be added. IMHO that's a mess. And I believe this mess
> > is direct consequence of poor design choices you are advocating, sorry.
> A commitinfo trigger can always refuse a file for which "cvs add"
> completed successfully. There's nothing new here. If you don't like
> that, then don't use commitinfo.

In my design the triggers are the same, so there is no such problem.
Either the file is OK for repository or not, -- simple and clear. The
less problems, -- the better.

In your design there is "OK for addition, but wrong for commit" that
IMHO is a nonsense. I believe such a design is seriously flawed, sorry.

> What's new is that we can cause "cvs add" to fail under certain
> conditions that we know in advance will cause commitinfo to refuse a
> file. To make sure that the condition is checked, we do it a second
> time before commitinfo, because some users insist on defeating it the
> first time.

What functionality is lacking? "cvs -n ci" allows you to do it. All you
require is "cvs add" to *enforce* the checks. I have two levels of
objection here:

1. Enforcement by "cvs add" of the checks doesn't require introduction
   of separate "add triggers" as usual "commit triggers" could do the
   job as well.

2. Enforcement by "cvs add" of the checks is wrong idea by itself as CVS
   is not a project management tool and should not be. If your project
   indeed requires such things, let users execute your wrappers instead
   of direct CVS commands.

> >>>> Another point that I would like to make, however, is that CVS can
> >>>> become more feature-rich, support multiple policies, and have a
> >>>> simpler user interface (in most use cases, at least) all at the same
> >>>> time. The problem is that most of us here are too close to the
> >>>> implementation to take a fresh view of the problem.
> >>>>
> >>>>> In the core CVS program the "cvs add" and "cvs remove" operations
> >>>>> must be fixed to be equivalent to "vi file.c" -- i.e. operations
> >>>>> which _ONLY_ affect the local working directory and which _NEVER_
> >>>>> contact the server.
> >>>>
> >>>> See above. If there are no add-time triggers, then I can live with
> >>>> what you say. On the other hand, some shops REQUIRE add-time triggers,
> >>>> and if add-time triggers are used then contacting the server is
> >>>> REQUIRED to make them run.
> >>>
> >>> Sorry, add-time with respect to what? Add-time w.r.t. to working copy is
> >>> entirely different from the add-time w.r.t. repository. Do you realize
> >>> currently there is no command but 'cvs ci' meaning "add this file to the
> >>> repository"? Add time w.r.t. repository currently happens when you 'cvs
> >>> commit' the new file. Do you propose to change this?
> >>
> >> What I mean by "add-time" is the moment in which the user invokes
> >> the "cvs add" command. The canonical example of such a trigger is
> >> one that enforces naming conventions, but there are other reasons
> >> to control what the user can add. (Some shops don't want users
> >> creating directories, for example, and require the CM team to do it
> >> for them.)
> >
> > So, provided that "cvs add" adds the file to the working copy, your
> > definition means "add-time to working copy". Requiring server triggers
> > to be run at add-time to working copy seems rather strange design choice
> > in my opinion.
> Can you suggest another way to enforce add-time policy in a way that's
> centrally controlled by the CVS admin?

Sure. Commit triggers. If "cvs add" is capable to invoke them, if it
invokes them by default, and if trigger failure results in a warning or
in error are additional concerns. The primary concern is that separate
add-time triggers are not required.

BTW, if you believe your project indeed requires it, arrange wrappers
that clients will run instead of "cvs add". In fact, as you requirements
are in the field of project management, your users should never invoke
CVS commands directly, -- it's the job of your project management tool
to invoke CVS commands when required.

> >> When "cvs add" runs, I don't care whether or not the CVS server
> >> modifies the repository. Some people seem to think that running "cvs
> >> add" while disconnected is a useful thing to do. (I take the attitude
> >> that client/server applications shouldn't be expected to run without a
> >> working network, so I'd never run any CVS command when I was unable to
> >> connect to the server.)
> >
> > Very strange attitude. And a very unusual definition of expectations
> > associated with client/server applications. Having this definition, mail
> > client isn't supposed to let you do anything with the mail on your
> > computer without a working network?!
> I rely heavily on IMAP and SMTP for mail transport.  At work, my mail client
> lives on an NFS server.  So no, I don't expect mail to work when the network
> is down.
> BTW, the definition of "client/server" implies the presence of a
> network for communication between the two parts,

Wrong. Client and server can work on the same computer without any
network. Moreover, client/server idiom is heavily used inside
"monolithic" programs as well. Basically, client/server only means that
there is some "server" that makes some operations on behalf of
"clients", how clients communicate with the server is a secondary issue.

> without which the application fails.

Which part of it, client, server, or both? Server should never fail,
client will fail only if an operation that indeed requires to contact
the server has been requested. That's how things are supposed to work in
client/server applications. Your limited idea of client/server
applications is noticed, but can't be agreed upon, sorry.

> The other method is usually called "monolithic", in which the
> application is self-contained. CVS works both ways, but most of us
> prefer a remote repository, hence the client/server implementation.

In fact, client/server implementation is to let you to have remote
repository, -- it doesn't prevent you from having local repository as a
special case of a remote one. I.e., if I have a good client/server
implementation, I don't need "monolithic" one.

> >> However, since triggers enforce policy and must not be defeatable,
> >> e.g. by changing one's path or bypassing a wrapper or hacking the
> >> client machine, they're best implemented as a server feature. It's for
> >> that reason, assuming add-time triggers are implemented, they require
> >> a connection to the server.
> >
> > The "add-time triggers" you are advocating would then create an
> > unfortunate precedent of preventing user from modifying his working copy
> > at a will of CVS repository administrator! PLEASE, DON'T DO IT TO CVS!
> > Sorry for shouting. Fortunately, as triggers are run on the server,
> > there is in fact no way to actually impose any policy on the client
> > side.
> The CVS administrator guards what enters the repository. Users
> typically don't do things that they know will be refused by the
> repository; it's a waste of time and effort. The add-time triggers
> simply bring to the attention of the users earlier in the cycle that
> their code will be refused later anyway.

To aid this it's enough to make it possible to run commit-time triggers at
add-time. No invention of separate ugly "add-time triggers" is required.
That's what I'm trying to explain.

> What I'm seeing is a knee-jerk reaction of "ooooh, he wants to limit
> what I can do in my own workspace!"

Don't you?

> or "he wants to change the behavior of a command that I use!".

Backward incompatible changes are usually wrong idea. You need really
firm arguments to make it happen. Fortunately for you, current "cvs add"
does contact the server, so that's not an argument against your

> But think about what's really going on. If the work will be refused
> anyway, why would you possibly want to deliberately proceed toward a
> dead end?

OK, the repository told me it won't accept my changes. In my particular
case it was due to the fact that I don't have write access to the
repository. And here is actual problem. I need the files to be added to
the working copy anyway.

> If you really, really want to go that route, the add-time test is
> optional anyway.

What I really try to explain is that an ability to have
add-to-working-copy time tests don't require invention of add-time
triggers. Ability to invoke commit-time triggers at add-to-working-copy
time is sufficient and I believe is better alternative to add-time

BTW, one of the problems with "optional" is that there is currently no
way (or am I missing something?) to specify options on per- repository
or per- working copy basis. This is orthogonal to the discussion though.

> What you do privately in your workspace isn't my concern. It's just
> that once you make CVS aware of the file, you must become aware that
> certain policies begin to apply. I find it more efficient to detect
> violations early because history has shown that problems are easier,
> faster, and cheaper to fix when found earlier than when found later.

You once again state this point of early detection. However, I didn't
see anybody arguing its validity. The problem is that your "make CVS
aware of the file" is not well-defined. Some people here argue that
"make CVS aware of local file addition" is not the same as "making CVS
repository aware of the file addition", and the former has in fact
nothing to do with the repository and the server. If you need CVS server
to be aware of the additions to the working copies, just do it, i.e.,
invoke "cvs ci -n" early. Adding corresponding option to the "cvs add" for
convenience won't be a big problem either. All this doesn't require any
special "add-time triggers".

> >>> In fact the semantics of proposed 'cvs add -c' is: "add this file to the
> >>> working copy and check if the repository will allow me to commit this
> >>> new file if I decide to". In this semantic only the latter part has
> >>> anything to do with the repository, and it is "commit", not "add",
> >>> that's why I suggested 'cvs commit' would be more logical place to check
> >>> for such things.
> >>
> >> Certain conditions that "will allow me to commit this new file if I
> >> decide to" can be checked at the time the user invokes the "cvs add"
> >> command. The rationale is that if a failure condition can be detected
> >> at add-time then any conditions deriving from those creating the
> >> failure condition can be halted, thus avoiding costly recovery action
> >> at the time when the first commit actually fails.
> >
> > The problem is that you still try at add-to-the-working-copy time to
> > impose policies that in fact make sense at the add-to-repository time.
> There's nothing I can say here that I haven't said before:  The commit will
> fail anyway, so why not find out early and fix it while it's still
> easy?

No reason, -- just do it. Invoke commit-time triggers as early as you
wish. That will give you the most authoritative answer about validity of
your addition.
> >> For example, suppose a mixed Windows/Unix shop requires all files to
> >> have upper-case 8.3 file names. A new programmer splits a header file
> >> and creates a new foo.h. He adds the file, then proceeds to modify all
> >> of the source files to include the new foo.h. Then he updates all of
> >> the dependencies in his makefiles. He builds and tests on Unix. He
> >> types "cvs commit", types a very detailed log of his actions, and
> >> finally punches the screen. This person might have saved a day's work,
> >> his equipment, and his knuckles if only "cvs add" had said "Sorry,
> >> this new file violates our naming policy, try renaming it to FOO.H
> >> instead."
> >
> > ... and what? Is the file added to the working copy or not? If not, then
> > if I've specified a few files, are they all not added, or only those
> > that didn't pass the test? Still I'm opposed to the idea that "cvs add"
> > would refrain from adding files to the working copy. It's not repository
> > administrator business to decide what I can and what I can't do to my
> > working copy. If "cvs add" will only warn about the problems, -- that's
> > OK with me as a user.
> Seriously, think about what you're saying.  You want to do the following,
> dramatically oversimplied:
> edit foo.h
> cvs add foo.h
> edit foo.h
> cc FOO.C
> cvs commit foo.h
> It's at this point you want to fail, after you've done all the work.  In my
> opinion it's better all around you fail after two steps, not five.

You've missed my point. I have nothing against step2 warns me about the
problems, maybe even by default, if I still have ability to suppress the
warnings. I'm strongly against step2 to refuse to add the file as I
believe it would just disturb instead of help: if step2 refuses to add
the file, it doesn't prevent me from doing steps 3 and 4. In fact it
even doesn't prevent me from invoking 'cvs commit foo.h', but instead of
getting comprehensive explanation from the server why my change isn't
accepted, I'll get less useful message "run cvs add first".

> Sure, you can change your behavior and move the add down to right before the
> commit, and that is consistent with the working styles of many people, but
> then they get what they ask for.

So even with you proposals implemented you fail to actually impose
policies you are trying to impose with the proposals, -- too bad.

That's another thing I'm trying to explain, -- you have no way to
actually impose policies on the client side. Thinking otherwise is no
more than self-delusion.

> > However, I still believe "cvs add" is a wrong place to implementing the
> > functionality from the design point of view. I can only repeat my
> > argument: as "cvs ci new_file" will do the checks anyway, that's what
> > "cvs -n ci new_file" should do, not "cvs add". The same opportunities
> > for the user, but cleaner and simple design.
> But it's a lousy user model because it allows the user to proceed a long way
> down a dead end before turning him around.

Well, the fundamental difference of my proposal is that it doesn't
require special add-time triggers by replacing them with the ability to
invoke commit-time triggers as early as possible. Does "cvs add"
actually invokes these triggers (either by default or not), and if the
result of invocations is a warning or an error, are additional concerns
that could be decided upon afterwards. The main of my points still is:
"there is no need for special add-time triggers as commit-time triggers
can do the job better".

> >>> To get your semantics, it seems you need a new operation with the
> >>> semantics "add the file to the working copy and to the repository, but
> >>> don't give it to anybody on 'cvs update' yet, until I latter commit the
> >>> addition". Do you propose exactly this? How could it be done without
> >>> write access to the repository?
> >>
> >> The semantics I want are to validate the addition of a new
> >> artifact. I frankly don't care if "cvs add" is implemented as you
> >> describe in that last paragraph or if it's implemented Greg's way.
> >
> > Maybe you don't care, but implementing a messy design will
> > eventually result in a mess for end-user. Then you will probably
> > care.
> The change to the CVS design really isn't significant. It can already
> contact the server, and it already implements server-side triggers.
> Adding a new one really has no significant impact to the quality of
> its implementation.

Introducing yet another trigger will have significant impact to the
quality of implementation because it doesn't improve anything while
increases complexity.

> And as I've demonstrated above, it actually improves the user model.

No, you didn't demonstrate it, I'm afraid. No, it doesn't improve
anything compared to the ability to invoke commit-time triggers early,
or at least I still fail to see how it does.

> >> No matter which method records the new file, the client must still
> >> contact the server to run the add-time trigger.
> >
> > Sure, the only difference is that you require add-to-repository trigger
> > to be run at add-time-to-working-copy time as well, and that's IMHO a
> > wrong design decision.
> Okay, use the option to disable the add-time trigger.

Thanks, I will, though is still don't see why do you call the trigger
"add-to-working-copy-time" if it's in fact "add-to-repository-time"
trigger just happened to be invoked as a part of "cvs add" command, and
the latter trigger already has its name, the "commit-to-repository-time"

> Or, don't use add-time triggers at all.

Sorry, as a user, I can't if repository administrator uses them.

> >>>> I had hoped that this was clear in the last go-round, but apparently
> >>>> not.
> >>>
> >>> For me it is not, sorry. Let me give yet another example. Suppose I've
> >>> created a new_file today and have checked it's ok using proposed 'cvs
> >>> add -c new_file' command. Two days later what I've checked could already
> >>> be wrong (policy change, another user added the same file, etc.). So
> >>> there are two questions:
> >>>
> >>> 1. How do I repeat my check later? By just repeating 'cvs add -c
> >>>    new_file'? This would produce warnings "new_file has already been
> >>>    added" that is not a good thing for an operation intended to make
> >>>    checks, I'm afraid.
> >>>
> >>> 2. Should 'cvs -n ci new_file' run the same triggers 'cvs add -c
> >>>    new_file' runs? If exactly the same, then why the duplication?
> >>
> >> My vision is that the user would run "cvs ci new_file" without the -n
> >> option.
> >
> > If this is supposed to be an answer to my first question, then it is not
> > in fact an acceptable answer. I asked "how do I repeat the check?" and
> > you've answered "by committing your changes to the repository". Should I
> > take it as "no, you will have no easy way to repeat the check later"?
> Okay, here's a different tack:  *You* don't perform the check.  CVS performs
> the check on your behalf.  When you run the  "cvs add" command, what would
> happen below the covers is this:
> Run add-time trigger
> If trigger succeeds, create entry in Entries file
> When you invoke "cvs commit" at a later time, CVS performs the
> following steps:
> Run add-time trigger
> If add-time trigger succeeds, run commit-time trigger
> If both triggers succeed, create new version in repository and update
> Entries

You've just explained what I already understood. That's quibbling. Are
you going to answer to my direct question: how do I repeat the "run
add-time trigger" part? No way?

And here yet another question: what your add-time trigger does that
commit-time trigger can't do?

> >> It would run the add-time triggers (for the first commit) and then the
> >> commit-time triggers.
> >
> > Will "cvs -n ci new_file" run the triggers in the design you have in
> > mind?
> It would do exactly what "cvs commit" would do without the -n option, except
> that it would not modify any persistent state in the repository or in the
> workspace.

Great. Than why do you need separate beasts called add-time triggers? Run
commit-time ones as early as you wish instead.

> >> The reason for the duplication is partly to catch possible changes in
> >> policy between add-time and commit-time, and partly to avoid abuses by
> >> those who unplug their computers as part of their procedure to add new
> >> files (which includes those who insist that running "cvs add" while
> >> disconnected is a reasonable thing to do).
> >
> > Running "cvs add" is indeed reasonable thing to do no matter if
> > connected or not. When I'm sitting on another end of our planet from the
> > server running the repository I don't wish to depend on the existence of
> > the link between my computer and the server when I decide the file
> > should be added to the project. The more I can do offline, -- the
> > better, -- ability to do things independently is one of the properties
> > of distributed systems that make them superior in many cases.
> Well, there's also the founding philosophy of the whole client/server
> revolution, which is that data islands are bad.

Excuse me my ignorance, but what's client/server revolution? When did it

> But I also recognize that, if you must work offline, it's better to
> have "cvs add" succeed in isolation than to fail (so that the user
> does not need to remember over a long period of time to add the file
> next time he connects). It's for this reason that the add-time trigger
> is optional when "cvs add" runs, but is mandatory at commit time.

And that's one of problems with your proposed add-time triggers
solution. The user needs a way to invoke later the checks "cvs add"
didn't do in this case. That's the scenario where user needs separate
"add file to working copy" and "check file for validity against
repository" actions. Every time I ask you how do I repeat the add-time
check, you don't give satisfactory answer.

Besides, I still don't see why add-time triggers != commit-time
triggers. I.e., provided they are run on server, how they are different
from the point of view of the server?

> > Whatever the reasons for duplication are, the fact is that the server
> > must run add-time triggers when new file is being added to the
> > repository. Adding files to repository is what "cvs commit" does. Then
> > it's logical for "cvs -n commit" to run the triggers as well. Then,
> > provided you already have a way to run these add-time triggers through
> > "cvs -n commit", why do you need yet another way to perform the same
> > operation (through "cvs add")? Thus, the duplication is not in fact
> > required, -- it's the wrong design choice you are advocating that leads
> > to the duplication.
> The reason to have "cvs add" do it is because it saves a step and
> makes a single action (from the user's point of view) whole. There
> should be no reason in the world why the user must invoke two commands
> to complete a single action, to add a file in this case.

Ok, if I agree "cvs -n commit" is run as part of "cvs add", does it
eliminate this particular point of disagreement?

> >>>>> Policy goes above -- it is not hard-coded in the core
> >>>>> functionality.
> >>>>
> >>>> Agreed. But the tool must be sufficiently flexible to allow
> >>>> robust implementations of policies. Sometimes triggers are the
> >>>> right way (and wrapper scripts are not), and we've identified one
> >>>> area here where CVS is not sufficiently flexible.
> >>>
> >>> That's why I insist CVS should have sane set of elementary
> >>> operations that could be then combined in different ways. I have
> >>> no objection against "compound" CVS commands that do multiple
> >>> things (preferably making them atomic), but existing of
> >>> corresponding elementary commands is a must, I believe. Designing
> >>> tools in a different manner results in a lack of flexibility, or
> >>> at least my experience suggests it does.
> >>
> >> Indeed. To me, the ideal implementation would be a collection of
> >> very primitive operations glued together by a scripting language,
> >> and have the command line interface invoke scripts.
> >
> > ... and then you suggest "cvs add" semantics that instead of doing
> > one thing, adding files to the working copy, will in fact do two
> > things, -- adding files to the working copy and checking if the
> > commitment of these files later would be OK. It seems you finally
> > contradict to your own goals, sorry.
> Not a bit. Logical primitives and user operations are two different
> things. Creating a new revision in the repository is a logical
> primitive. Invoking a trigger is logical primitive. Updating the
> Entries file is a logical primitive. The "cvs commit" command is a
> user operation that does all of these things. There's a big difference
> in these concepts, and I think that they should be kept separated. And
> I don't think that every logical primitive should necessarily be
> exposed to the user, though APIs to logical primitives are useful in
> building new user operations.

Ah, now I see. I suggest "add new file to the working copy" to be a
useful user operation, and you believe it is not? So the minimum
semantics of "cvs add" you agree with is something like "add new file to
the working copy but only after you make sure the file path is OK with
respect to the repository".

Well, suppose you are designer and I'm a user then. I, the user, ask
you, the designer, to explain me why do you think I, the user, will
never need plain and simple "add new file to the working copy" user


> >> I don't believe that the existing CVS command line offers enough
> >> flexibility, in a number of ways. And an implementation like the one I
> >> describe here cannot be built without trashing most of the existing
> >> code. But that's a different discussion...
> >
> > If what you have in mind will trash most of the existing code, then
> > it's obviously better to take a fresh start and design the tools from
> > scratch. But that won't be the CVS anymore, I'm afraid.
> Yeah, and I'm not recommending (at this time) that CVS be rewritten as
> a library with an embedded scripting language. I'm just recommending
> that add-time triggers be added. The latter is easy, it's a huge win
> for those who need it, and has zero impact on those who don't.

You still didn't provide any argument in favor of add-time triggers in
comparison with commit-time triggers invoking as part of 'cvs add', so I
still fail to see how add-time triggers could be a huge win to anybody.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]