delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2013/03/23/21:35:48

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:reply-to:message-id:to:subject
:in-reply-to:references:mime-version:content-type
:content-transfer-encoding; q=dns; s=default; b=VhfsbnHbJjRxdaE0
LnZK8DPRInuLYNGLTkSdxkzI981tEgF+21vvFRwv2/L6NQTQGBTI22+LFOLPQX8h
EwipiI5PMQRG23AI+o2uplIvnBsZ52oQLif7t8E3akjICSJ+F9A8MJDh3RUtS3Xe
1SGkLP9Ch8I7gcym07dPJFcQ/PA=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:reply-to:message-id:to:subject
:in-reply-to:references:mime-version:content-type
:content-transfer-encoding; s=default; bh=ZdwGQ4am/6HW67jI0zWGf/
dD/y8=; b=a/baa5uUPS3p1JdQFTNwJJgQqmcrLWIU3nvdVuaxVsnR8GMDrb8ulN
sCjEotjPpDkFbV7I8NrTxXHJJ2CIatAupL8f4cIXPvlT2wk2NHS4sz/HbD8B0N1q
TsKmWVrMkWlWUGbTXus08Nx/SmaPEJ8oSaGIkp0p/829S5HSVVY5g=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-Spam-SWARE-Status: No, score=0.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KAM_THEBAT,SPF_SOFTFAIL,TW_SV autolearn=no version=3.3.1
Date: Sun, 24 Mar 2013 05:26:26 +0400
From: Andrey Repin <anrdaemon AT freemail DOT ru>
Reply-To: Andrey Repin <cygwin AT cygwin DOT com>
Message-ID: <685324079.20130324052626@mtu-net.ru>
To: Bill Priest <priestwilliaml AT gmail DOT com>, cygwin AT cygwin DOT com
Subject: Re: cvs changes to support CR/LF in Root & Repository files
In-Reply-To: <CAP_ScW24EmSaiybpyz2iVszUWYnEo=gOFr76O9QDCoGsdN59xQ@mail.gmail.com>
References: <CAP_ScW24EmSaiybpyz2iVszUWYnEo=gOFr76O9QDCoGsdN59xQ AT mail DOT gmail DOT com>
MIME-Version: 1.0
X-IsSubscribed: yes

Greetings, Bill Priest!

> All,
>   I used tortoisecvs (as a plugin for windows eclipse) to check out
> some repositories to a "windows 7" directory (e.g. not a cygwin
> directory).  I tried to use the cygwin cvs client to diff files and
> check status but it complained ": no such repository" for "cvs log
> <filename>".  A simple dos2unix on the CVS/Root file changed the error
> to "cvs log: nothing known about <filename>"; a dos2unix on
> CVS/Repository allowed the "cvs log" command to work correctly.
>   I'm used to being able to copy/move svn sandboxes between linux and
> windows w/o any issues so I checked into the cvs source to see what it
> would take to support LF as well as CR/LF.  This issue isn't limited
> to the cygwin cvs as the same "sandbox" copied to linux has the same
> problem.
>   I hacked the root.c and repos.c to work around the problem (as of
> yet I haven't seen any impact to commands wrt Entries and template
> don't seem to be affected.
>   I've attached patch.txt with the changes.  This can be tested by
> running dos2unix CVS/Root CVS/Repository; cvs log configure (the
> current version of cvs will not work while the patched version will
> work normally).

"Normally", you either use Cygwin CVS, or windows CVS tools (such as
TortoiseCVS, or March-Hare CVS toolkit...).
Also, comparison with Subversion in this regard is just comparing apples and
oranges. Subversion was built from the ground with this issue in mind, and it
is explicitly using LF line endings in technical area under all operating
systems.
Speaking of which, can someone PLEASE take a look at GIT setup.hint and REMOVE
cvsps requirement. It is not used in daily git operations, and should not be
there.

> Bill

> Index: ChangeLog
> ===================================================================
> RCS file: /sources/cvs/ccvs/ChangeLog,v
> retrieving revision 1.1379
> diff -u -r1.1379 ChangeLog
> --- ChangeLog   12 Nov 2009 02:29:17 -0000      1.1379
> +++ ChangeLog   23 Mar 2013 17:48:31 -0000
> @@ -1,3 +1,8 @@
> +2013-03-23  Bill Pries <priestwilliaml AT gmail DOT com>
> +
> +       * root.c: Support CR/LF as well as LF
> +       * repos.c: Support CR/LF as well as LF
> +
>  2009-11-11  Derek R. Price  <derek AT ximbiot DOT com>

>         * NEWS: Note default taginfo format string fix.
> Index: src/repos.c
> ===================================================================
> RCS file: /sources/cvs/ccvs/src/repos.c,v
> retrieving revision 1.49
> diff -u -r1.49 repos.c
> --- src/repos.c 18 Nov 2008 22:56:55 -0000      1.49
> +++ src/repos.c 23 Mar 2013 17:48:31 -0000
> @@ -101,6 +101,9 @@
>         error (0, errno, "cannot close %s", quote (tmp));
>      free (tmp);

> +    if ((cp = strrchr (repos, '\r')) != NULL)
> +       *cp = '\0';                     /* strip the carriage return */
> +
>      if ((cp = strrchr (repos, '\n')) != NULL)
>         *cp = '\0';                     /* strip the newline */

> Index: src/root.c
> ===================================================================
> RCS file: /sources/cvs/ccvs/src/root.c,v
> retrieving revision 1.137
> diff -u -r1.137 root.c
> --- src/root.c  12 Sep 2008 19:55:29 -0000      1.137
> +++ src/root.c  23 Mar 2013 17:48:31 -0000
> @@ -60,7 +60,6 @@
>      char *tmp;
>      char *cvsadm;
>      char *cp;
> -    int len;

>      TRACE (TRACE_FLOW, "Name_Root (%s, %s)",
>            TRACE_NULL (dir), TRACE_NULL (update_dir));
> @@ -88,7 +87,7 @@
>       */
>      fpin = xfopen (tmp, "r");

> -    if ((len = getline (&root, &root_allocated, fpin)) < 0)
> +    if (getline (&root, &root_allocated, fpin) < 0)
>      {
>         char *admfile = dir_append (update_dir, CVSADM_ROOT);
>         /* FIXME: should be checking for end of file separately; errno
> @@ -99,8 +98,11 @@
>         goto out;
>      }
>      fclose (fpin);
> -    cp = root + len - 1;
> -    if (*cp == '\n')
> +
> +    if ((cp = strrchr (root, '\r')) != NULL)
> +       *cp = '\0';                     /* strip the carriage return */
> +
> +    if ((cp = strrchr (root, '\n')) != NULL)
>         *cp = '\0';                     /* strip the newline */

>      /*


--
WBR,
Andrey Repin (anrdaemon AT freemail DOT ru) 24.03.2013, <05:19>

Sorry for my terrible english...


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019