Ok, one thing that I did not say is that we don't use "cvs commit" directly
here, we have a wrapper which we run instead of "cvs commit" :-) and this
wrapper runs "cvs commit" after setting its pid in some environment
variable.
I didn't say how to do it if you don't have a wrapper, I just thought that
it should not be a problem since:
1. Donald Shart wrote this thought, so I thought he knew how to do it, and
2. There is some common parent to both anyway (for example, the shell that
ran this command), so, just by knowing how many levels up you need to go
from each process, you can find the pid of the common parent. In my case it
was just simpler because we need to wrapper to do other things anyway.
And mostly, I wrote this response for the 2nd paragraph (the "duh" part)...
Shlomo
-----Original Message-----
From: Laird Nelson [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 03, 2000 4:41 PM
To: Reinstein, Shlomo
Cc: 'Donald Sharp'; [EMAIL PROTECTED]
Subject: Re: CVS pids and the pids of its kids
"Reinstein, Shlomo" wrote:
>
> Hi,
>
> I've used that method to communicate information between the commitinfo
and
> the loginfo of the same commit process - that is, using the pid of the
"cvs
> commit" process itself, which is the parent of both.
How have you done this? The pid of the "cvs commit" process itself is
NOT the parent of both commitinfo and loginfo. The fork-and-exec
happens (apparently?) *after* the commit actually occurs. This means
that commitinfo and verifymsg are run by the same pid, but loginfo is
not. As the Cederqvist manual says somewhere, the order of the relevant
*info scripts is this:
1. commitinfo
2. verifymsg
(commit happens if (1) and (2) let it happen)
3. loginfo
(1) and (2) are run by the same parent pid; (3) is not.
> Just one point: In case
> you don't work with a CVS server, and people can access the repository
from
> various machines, the pid is not enough for distinguishing between
commits,
> you need to use both the pid of the commit process and the name of the
> machine.
Yes, of course. {whap} Duh.
Cheers,
Laird