Gnus development mailing list
 help / color / mirror / Atom feed
* Patches for cvs and cvslog
@ 2002-01-01  7:32 Lars Magne Ingebrigtsen
  2002-01-02  5:27 ` Russ Allbery
  2002-01-03 13:25 ` Per Abrahamsen
  0 siblings, 2 replies; 18+ messages in thread
From: Lars Magne Ingebrigtsen @ 2002-01-01  7:32 UTC (permalink / raw)



I've applied the following patch from Jason L Tibbitts III:

--- server.c.orig	Thu Sep 24 19:17:31 1998
+++ server.c	Wed Nov 11 09:43:00 1998
@@ -5060,6 +5060,7 @@
 {
     int rc;
     char *host_user = NULL;
+    char *env;
 
     /* First we see if this user has a password in the CVS-specific
        password file.  If so, that's enough to authenticate with.  If
@@ -5175,6 +5176,10 @@
            It might or might not be the same as host_user. */
         CVS_Username = xmalloc (strlen (username) + 1);
         strcpy (CVS_Username, username);
+
+	env = xmalloc (sizeof "CVSUSER=" + strlen (CVS_Username));
+	(void) sprintf (env, "CVSUSER=%s", CVS_Username);
+	(void) putenv (env);
     }
 
     return host_user;

And then did the following change myself:
     
--- cvslog~	Sun Dec 30 07:07:35 2001
+++ cvslog	Tue Jan  1 08:28:44 2002
@@ -409,7 +409,7 @@
 # information about the change.  Returns the header as a list.
 sub build_header {
     my ($data, $showdir) = @_;
-    my $user = (getpwuid $<)[0] || $<;
+    my $user = $ENV{CVSUSER} || (getpwuid $<)[0] || $<;
     my $date = strftime ('%A, %B %e, %Y @ %T', localtime time);
     $date =~ s/  / /;
     my @header;


And now the log messages has the user name of the person who commits,
and not just "cvs".
     
-- 
(domestic pets only, the antidote for overdose, milk.)
   larsi@gnus.org * Lars Magne Ingebrigtsen



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

* Re: Patches for cvs and cvslog
  2002-01-01  7:32 Patches for cvs and cvslog Lars Magne Ingebrigtsen
@ 2002-01-02  5:27 ` Russ Allbery
  2002-01-03 13:25 ` Per Abrahamsen
  1 sibling, 0 replies; 18+ messages in thread
From: Russ Allbery @ 2002-01-02  5:27 UTC (permalink / raw)


Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> And then did the following change myself:
     
> --- cvslog~	Sun Dec 30 07:07:35 2001
> +++ cvslog	Tue Jan  1 08:28:44 2002
> @@ -409,7 +409,7 @@
>  # information about the change.  Returns the header as a list.
>  sub build_header {
>      my ($data, $showdir) = @_;
> -    my $user = (getpwuid $<)[0] || $<;
> +    my $user = $ENV{CVSUSER} || (getpwuid $<)[0] || $<;
>      my $date = strftime ('%A, %B %e, %Y @ %T', localtime time);
>      $date =~ s/  / /;
>      my @header;

Thanks, applied.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>



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

* Re: Patches for cvs and cvslog
  2002-01-01  7:32 Patches for cvs and cvslog Lars Magne Ingebrigtsen
  2002-01-02  5:27 ` Russ Allbery
@ 2002-01-03 13:25 ` Per Abrahamsen
  2002-01-03 14:19   ` Lars Magne Ingebrigtsen
  1 sibling, 1 reply; 18+ messages in thread
From: Per Abrahamsen @ 2002-01-03 13:25 UTC (permalink / raw)


Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> And now the log messages has the user name of the person who commits,
> and not just "cvs".

It would be nice if the user names also appeared on the summary for

   nntp+quimby.gnus.org:gnus.cvslog 

I only see CVS.  I want to see who is active by skimming that
group...  Nah, I really want to see my own name there.




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

* Re: Patches for cvs and cvslog
  2002-01-03 13:25 ` Per Abrahamsen
@ 2002-01-03 14:19   ` Lars Magne Ingebrigtsen
  2002-01-03 14:22     ` Lars Magne Ingebrigtsen
                       ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Lars Magne Ingebrigtsen @ 2002-01-03 14:19 UTC (permalink / raw)


Per Abrahamsen <abraham@dina.kvl.dk> writes:

> It would be nice if the user names also appeared on the summary for
>
>    nntp+quimby.gnus.org:gnus.cvslog 

Yes, that would be nice.

I could add a new file that had a mapping from CVS user names to From
lines -- or names?

From: Per Abrahamsen <cvs@quimby.gnus.org>

Would that make sense?

Or

From: Per Abrahamsen <abraham@dina.kvl.dk>

would probably make even more sense?

-- 
(domestic pets only, the antidote for overdose, milk.)
   larsi@gnus.org * Lars Magne Ingebrigtsen



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

* Re: Patches for cvs and cvslog
  2002-01-03 14:19   ` Lars Magne Ingebrigtsen
@ 2002-01-03 14:22     ` Lars Magne Ingebrigtsen
  2002-01-03 15:17       ` Lars Magne Ingebrigtsen
  2002-01-03 15:24     ` Per Abrahamsen
  2002-01-03 15:25     ` ShengHuo ZHU
  2 siblings, 1 reply; 18+ messages in thread
From: Lars Magne Ingebrigtsen @ 2002-01-03 14:22 UTC (permalink / raw)


Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> I could add a new file that had a mapping from CVS user names to From
> lines -- or names?

I could use the CVS passwd file.  Does anybody have the documentation
for the format it uses?

-- 
(domestic pets only, the antidote for overdose, milk.)
   larsi@gnus.org * Lars Magne Ingebrigtsen



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

* Re: Patches for cvs and cvslog
  2002-01-03 14:22     ` Lars Magne Ingebrigtsen
@ 2002-01-03 15:17       ` Lars Magne Ingebrigtsen
  2002-01-03 15:20         ` Lars Magne Ingebrigtsen
  2002-01-03 15:30         ` Russ Allbery
  0 siblings, 2 replies; 18+ messages in thread
From: Lars Magne Ingebrigtsen @ 2002-01-03 15:17 UTC (permalink / raw)


Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> I could use the CVS passwd file.  Does anybody have the documentation
> for the format it uses?

I just put names and addresses there.

Perl is a strange, strange language.  At the 32nd try, I got my
modifications to work.

Works now.

-- 
(domestic pets only, the antidote for overdose, milk.)
   larsi@gnus.org * Lars Magne Ingebrigtsen



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

* Re: Patches for cvs and cvslog
  2002-01-03 15:17       ` Lars Magne Ingebrigtsen
@ 2002-01-03 15:20         ` Lars Magne Ingebrigtsen
  2002-01-03 15:30           ` Per Abrahamsen
  2002-01-03 15:30         ` Russ Allbery
  1 sibling, 1 reply; 18+ messages in thread
From: Lars Magne Ingebrigtsen @ 2002-01-03 15:20 UTC (permalink / raw)


Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> Works now.

But now I get this message when I apply stuff:

> Your message to ding-cvslog has been delayed, and requires the approval 
> of the moderators, for the following reason(s):

> This list is restricted to CVS commit messages.

> If you do not wish the message to be posted, or have other concerns, 
> please send a message to the list owners at the following address: 
>   ding-cvslog-owner@lists.math.uh.edu

Hm...

-- 
(domestic pets only, the antidote for overdose, milk.)
   larsi@gnus.org * Lars Magne Ingebrigtsen



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

* Re: Patches for cvs and cvslog
  2002-01-03 14:19   ` Lars Magne Ingebrigtsen
  2002-01-03 14:22     ` Lars Magne Ingebrigtsen
@ 2002-01-03 15:24     ` Per Abrahamsen
  2002-01-03 15:25     ` ShengHuo ZHU
  2 siblings, 0 replies; 18+ messages in thread
From: Per Abrahamsen @ 2002-01-03 15:24 UTC (permalink / raw)


Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> Per Abrahamsen <abraham@dina.kvl.dk> writes:
>
>> It would be nice if the user names also appeared on the summary for
>>
>>    nntp+quimby.gnus.org:gnus.cvslog 
>
> Yes, that would be nice.
>
> I could add a new file that had a mapping from CVS user names to From
> lines -- or names?

That would be nice.  However, I just imagined something like

     From: abraham <cvs@quimby.gnus.org>

you already have that information (the cvs login).

> From: Per Abrahamsen <cvs@quimby.gnus.org>
>
> Would that make sense?
>
> Or
>
> From: Per Abrahamsen <abraham@dina.kvl.dk>
>
> would probably make even more sense?

If it says "Per Abrahamsen" in the header, someone replying would
expect me to read the answer.  Where does <cvs@quimby.gnus.org> end
up?

Oh, I see you already implemented the last option.  Nice!



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

* Re: Patches for cvs and cvslog
  2002-01-03 14:19   ` Lars Magne Ingebrigtsen
  2002-01-03 14:22     ` Lars Magne Ingebrigtsen
  2002-01-03 15:24     ` Per Abrahamsen
@ 2002-01-03 15:25     ` ShengHuo ZHU
  2 siblings, 0 replies; 18+ messages in thread
From: ShengHuo ZHU @ 2002-01-03 15:25 UTC (permalink / raw)


Lars Magne Ingebrigtsen <larsi@gnus.org> writes:


[...]

> I could add a new file that had a mapping from CVS user names to From
> lines -- or names?
>
> From: Per Abrahamsen <cvs@quimby.gnus.org>
>
> Would that make sense?

No. This will ruin my BBDB database.

> Or
>
> From: Per Abrahamsen <abraham@dina.kvl.dk>
>
> would probably make even more sense?

This is better.

ShengHuo



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

* Re: Patches for cvs and cvslog
  2002-01-03 15:20         ` Lars Magne Ingebrigtsen
@ 2002-01-03 15:30           ` Per Abrahamsen
  2002-01-03 16:25             ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 18+ messages in thread
From: Per Abrahamsen @ 2002-01-03 15:30 UTC (permalink / raw)


Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

>> This list is restricted to CVS commit messages.

Maybe adding:

      Sender: CVS <cvs@quimby2.netfonds.no>

will avoid that?



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

* Re: Patches for cvs and cvslog
  2002-01-03 15:17       ` Lars Magne Ingebrigtsen
  2002-01-03 15:20         ` Lars Magne Ingebrigtsen
@ 2002-01-03 15:30         ` Russ Allbery
  2002-01-03 16:27           ` Lars Magne Ingebrigtsen
  1 sibling, 1 reply; 18+ messages in thread
From: Russ Allbery @ 2002-01-03 15:30 UTC (permalink / raw)


Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
> Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

>> I could use the CVS passwd file.  Does anybody have the documentation
>> for the format it uses?

> I just put names and addresses there.

> Perl is a strange, strange language.  At the 32nd try, I got my
> modifications to work.

> Works now.

I'd be happy to roll those changes into my version if you have a patch, so
that you won't have to maintain them locally.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>



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

* Re: Patches for cvs and cvslog
  2002-01-03 15:30           ` Per Abrahamsen
@ 2002-01-03 16:25             ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 18+ messages in thread
From: Lars Magne Ingebrigtsen @ 2002-01-03 16:25 UTC (permalink / raw)


Per Abrahamsen <abraham@dina.kvl.dk> writes:

> Maybe adding:
>
>       Sender: CVS <cvs@quimby2.netfonds.no>
>
> will avoid that?

Didn't have any effect...

-- 
(domestic pets only, the antidote for overdose, milk.)
   larsi@gnus.org * Lars Magne Ingebrigtsen



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

* Re: Patches for cvs and cvslog
  2002-01-03 15:30         ` Russ Allbery
@ 2002-01-03 16:27           ` Lars Magne Ingebrigtsen
  2002-01-03 16:56             ` Michael Cook
  2002-02-17  0:18             ` Russ Allbery
  0 siblings, 2 replies; 18+ messages in thread
From: Lars Magne Ingebrigtsen @ 2002-01-03 16:27 UTC (permalink / raw)


Russ Allbery <rra@stanford.edu> writes:

> I'd be happy to roll those changes into my version if you have a patch, so
> that you won't have to maintain them locally.

I've included the patch below, but remember: I don't know any Perl, so
try not to hurt yourself too badly when you fall off your chair,
laughing.  :-)

--- cvslog.old	Wed Jan  2 06:27:52 2002
+++ cvslog	Thu Jan  3 17:24:37 2002
@@ -586,6 +586,26 @@
 }
 $data{messages} = [ $data{message} ] unless $data{messages};
 
+my $from_line = "";
+
+if (open (PASSWD, "/usr/local/cvsroot/CVSROOT/passwd")) {
+    my $passwd_user = $ENV{CVSUSER};
+    my $full_name = "CVS";
+    my $email_address = "cvs\@" . `hostname --fqdn`;
+    chomp $email_address;
+    my $line;
+    my @info;
+    while ($line = <PASSWD>) {
+	chomp $line;
+	@info = split (/:/, $line);
+	if ($info[0] eq $passwd_user) {
+	    $full_name = $info[3];
+	    $email_address = $info[4];
+	}
+    }
+    $from_line = "From: \"$full_name\" <$email_address>\n";
+}
+
 # Open our mail program.
 open (MAIL, '| /usr/lib/sendmail -t -oi -oem')
     or die "$0: can't fork /usr/lib/sendmail: $!\n";
@@ -603,7 +623,13 @@
     print MAIL "To: $address\n";
 }
 print MAIL $headers if $headers;
+print MAIL $from_line;
 print MAIL "Subject: $subject", build_subject (\%data), "\n\n";
 
 # Build the message and write it out.
 print MAIL build_header (\%data, $showdir);

-- 
(domestic pets only, the antidote for overdose, milk.)
   larsi@gnus.org * Lars Magne Ingebrigtsen



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

* Re: Patches for cvs and cvslog
  2002-01-03 16:27           ` Lars Magne Ingebrigtsen
@ 2002-01-03 16:56             ` Michael Cook
  2002-02-17  0:18             ` Russ Allbery
  1 sibling, 0 replies; 18+ messages in thread
From: Michael Cook @ 2002-01-03 16:56 UTC (permalink / raw)


Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> I've included the patch below, but remember: I don't know any Perl, so
> try not to hurt yourself too badly when you fall off your chair,
> laughing.  :-)

it looks pretty reasonable.  you probably want to close PASSWD.  and
a couple other performance tweaks would be easy if you're inclined:

  }
  $data{messages} = [ $data{message} ] unless $data{messages};
 
  my $from_line = "";
  
  if (open (PASSWD, "/usr/local/cvsroot/CVSROOT/passwd")) {
      my $passwd_user = $ENV{CVSUSER};
-     my $full_name = "CVS";
-     my $email_address = "cvs\@" . `hostname --fqdn`;
-     chomp $email_address;
+     my $full_name;
+     my $email_address;
      my $line;
      my @info;
      while ($line = <PASSWD>) {
  	chomp $line;
  	@info = split (/:/, $line);
  	if ($info[0] eq $passwd_user) {
  	    $full_name = $info[3];
  	    $email_address = $info[4];
+ 	    last;
  	}
+     }
+     close PASSWD;
+     unless (defined $full_name)
+     {
+	$full_name = "CVS";
+	$email_address = "cvs\@" . `hostname --fqdn`;
+	chomp $email_address;
      }
      $from_line = "From: \"$full_name\" <$email_address>\n";
  }
  
  # Open our mail program.
  open (MAIL, '| /usr/lib/sendmail -t -oi -oem')
      or die "$0: can't fork /usr/lib/sendmail: $!\n";

m.



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

* Re: Patches for cvs and cvslog
  2002-01-03 16:27           ` Lars Magne Ingebrigtsen
  2002-01-03 16:56             ` Michael Cook
@ 2002-02-17  0:18             ` Russ Allbery
  2002-02-18  1:22               ` Lars Magne Ingebrigtsen
  1 sibling, 1 reply; 18+ messages in thread
From: Russ Allbery @ 2002-02-17  0:18 UTC (permalink / raw)


Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
> Russ Allbery <rra@stanford.edu> writes:

>> I'd be happy to roll those changes into my version if you have a patch,
>> so that you won't have to maintain them locally.

> I've included the patch below, but remember: I don't know any Perl, so
> try not to hurt yourself too badly when you fall off your chair,
> laughing.  :-)

(For building a proper From: header.)  Thanks!  I've now added this to my
copy.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>



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

* Re: Patches for cvs and cvslog
  2002-02-17  0:18             ` Russ Allbery
@ 2002-02-18  1:22               ` Lars Magne Ingebrigtsen
  2002-02-18  3:32                 ` Russ Allbery
  2002-02-18 17:28                 ` Steinar Bang
  0 siblings, 2 replies; 18+ messages in thread
From: Lars Magne Ingebrigtsen @ 2002-02-18  1:22 UTC (permalink / raw)


Speaking of cvs and cvslog -- I think there must be something I'm not
quite understanding about how cvs is supposed to work.

Now, everything works fine when you have one project in your cvs
repository.  But I've just added the Gmane project files to the
repository, so that "gnus" and "gmane" are in the same $CVSROOT.  For
the password file, I'm letting the Gmane users use a different user
name ("gmane"), and I've chowned $CVSROOT/gmane to "gmane.gmane".  Is
that how one is supposed to do it?

It seems to work OK, so perhaps it is the right way, but it seems a
bit... odd.

And how does one make cvslog not emit log messages for "gmane", but
still do it for "gnus"?

(What's Gmane about, you ask?  It's a mail-to-news gateway thing, and
I've now set things up so that I'm not the only one who can
administrate the thing.  It's all done via CVS and news.  None of that
web thing here.  Nuh-uh.

Anyway, you can read more on <URL: http://gmane.org/> when NSI gets
around to pushing out an update.)

-- 
(domestic pets only, the antidote for overdose, milk.)
   larsi@gnus.org * Lars Magne Ingebrigtsen



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

* Re: Patches for cvs and cvslog
  2002-02-18  1:22               ` Lars Magne Ingebrigtsen
@ 2002-02-18  3:32                 ` Russ Allbery
  2002-02-18 17:28                 ` Steinar Bang
  1 sibling, 0 replies; 18+ messages in thread
From: Russ Allbery @ 2002-02-18  3:32 UTC (permalink / raw)


Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> Speaking of cvs and cvslog -- I think there must be something I'm not
> quite understanding about how cvs is supposed to work.

> Now, everything works fine when you have one project in your cvs
> repository.  But I've just added the Gmane project files to the
> repository, so that "gnus" and "gmane" are in the same $CVSROOT.  For
> the password file, I'm letting the Gmane users use a different user name
> ("gmane"), and I've chowned $CVSROOT/gmane to "gmane.gmane".  Is that
> how one is supposed to do it?

Well, normally CVS folks recommend a separate repository for each
project.  But yes, that should work too, and I've done it that way before
(albeit not through pserver).

> It seems to work OK, so perhaps it is the right way, but it seems a
> bit... odd.

CVS is really designed to have one repository per project, which is why
it's odd.

> And how does one make cvslog not emit log messages for "gmane", but
> still do it for "gnus"?

Change loginfo so that rather than having DEFAULT there, instead put:

^gnus/          <cvslog invocation>

replacing the <> bit with the invocation that you have now.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>



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

* Re: Patches for cvs and cvslog
  2002-02-18  1:22               ` Lars Magne Ingebrigtsen
  2002-02-18  3:32                 ` Russ Allbery
@ 2002-02-18 17:28                 ` Steinar Bang
  1 sibling, 0 replies; 18+ messages in thread
From: Steinar Bang @ 2002-02-18 17:28 UTC (permalink / raw)


>>>>> Lars Magne Ingebrigtsen <larsi@gnus.org>:

> Now, everything works fine when you have one project in your cvs
> repository.  But I've just added the Gmane project files to the
> repository, so that "gnus" and "gmane" are in the same $CVSROOT.
> For the password file, I'm letting the Gmane users use a different
> user name ("gmane"), and I've chowned $CVSROOT/gmane to
> "gmane.gmane".  Is that how one is supposed to do it?

I always also do
	cd $CVSROOT/gmane/
	find . -type d | xargs chmod g+s




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

end of thread, other threads:[~2002-02-18 17:28 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-01  7:32 Patches for cvs and cvslog Lars Magne Ingebrigtsen
2002-01-02  5:27 ` Russ Allbery
2002-01-03 13:25 ` Per Abrahamsen
2002-01-03 14:19   ` Lars Magne Ingebrigtsen
2002-01-03 14:22     ` Lars Magne Ingebrigtsen
2002-01-03 15:17       ` Lars Magne Ingebrigtsen
2002-01-03 15:20         ` Lars Magne Ingebrigtsen
2002-01-03 15:30           ` Per Abrahamsen
2002-01-03 16:25             ` Lars Magne Ingebrigtsen
2002-01-03 15:30         ` Russ Allbery
2002-01-03 16:27           ` Lars Magne Ingebrigtsen
2002-01-03 16:56             ` Michael Cook
2002-02-17  0:18             ` Russ Allbery
2002-02-18  1:22               ` Lars Magne Ingebrigtsen
2002-02-18  3:32                 ` Russ Allbery
2002-02-18 17:28                 ` Steinar Bang
2002-01-03 15:24     ` Per Abrahamsen
2002-01-03 15:25     ` ShengHuo ZHU

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).