From owner-freebsd-cvsweb@FreeBSD.ORG Sat May 3 08:27:05 2003 Return-Path: Delivered-To: freebsd-cvsweb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A9F0F37B401; Sat, 3 May 2003 08:27:05 -0700 (PDT) Received: from mail1.acecape.com (mail1.acecape.com [66.114.74.12]) by mx1.FreeBSD.org (Postfix) with ESMTP id E60EC43FBD; Sat, 3 May 2003 08:27:04 -0700 (PDT) (envelope-from roy@panix.com) Received: from panix.com (p67-13.acedsl.com [66.114.67.13]) by mail1.acecape.com (8.12.9/8.12.9) with ESMTP id h43FR3eT017121; Sat, 3 May 2003 11:27:03 -0400 Date: Sat, 3 May 2003 11:27:01 -0400 Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v552) To: Khachaturov Vassilii From: Roy Smith In-Reply-To: <6B1DF6EEBA51D31182F200902740436803B24F59@mail-in.comverse.com> Message-Id: Content-Transfer-Encoding: 7bit X-Mailer: Apple Mail (2.552) cc: freebsd-cvsweb@freebsd.org Subject: Re: Displaying line numbers X-BeenThere: freebsd-cvsweb@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS Web maintenance mailing list [restricted posting] List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 May 2003 15:27:05 -0000 On Thursday, May 1, 2003, at 01:08 PM, Khachaturov Vassilii wrote: >> In addition to the line numbers, there should be a > name="lXX">XX >> for all lines so that one can point to them using #lXX in URLs. Even Well, I finally sat down and looked at the code. Turns out this is a fairly trivial change, at least for a simple version. Diffs from the 2.0.6 cvsweb.cgi (the line numbers may be off a little; I left out some other, non-related changes). *** 1943,1952 **** } else { print "
";

-               my $lineNumber = 0;
                 while (<$filehandle>) {
-                       $lineNumber++;
-                       printf '%5d:  ', 
$lineNumber, $lineNumber;
                         print htmlquote($_);
                 }
                 print "
"; --- 1941,1947 ---- I didn't worry much about figuring out how many lines the file had. I left room for 5-digit line numbers, which seemed good enough. I guess the next thing would be to add some way to turn the feature on and off. I could see two ways. One would be a static switch in cvsweb.conf, the other would be some sort of control on the "CVS log for xxx" page. Maybe instead of: Revision 1.1 / (download) - annotate - [select for diffs] there could be an additional link: Revision 1.1 (with/without line numbers) / (download) - annotate - [select for diffs], or a checkbox. Maybe the static switch in cvsweb.conf would control the default setting of the checkbox (i.e. by default you get line numbers vs. by default you don't). Any ideas? Left to my own devices, I'm inclined to go with the idea of a checkbox and a cvsweb.conf switch to control the default value.