git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[OT] ancestor branch in cvsps is wrong for branch-of-branch

From
CSChris Shoemaker <c.shoemaker@cox.net>
Date
Nov 1, 2005, 03:51 UTC
Message-ID
<20051101035148.GA11807@pe.Belkin>
[ Maybe the git list is interested in a problem with cvsps? ]
Summary: When creating a patchset for the first modification in a
branch-off-a-branch, cvsps (version 2.1) declares that the ancestor
branch is HEAD.  Presumably this is because the file in the patchset
hadn't been modified since it was on HEAD.  But this means that files
that are *added* to the first branch are never counted as added to the
branch-off-a-branch.
Figure:
-HEAD-(add file 'a')--+-------------------------
                       \
                        \-stable-(add file 'b')-+
                                                 \
                                                  \-dev-(change 'a')-->

In CVS, branch "dev" clearly contains both 'a' and 'b'. But cvsps makes it look like this:

                        /-dev-(change 'a') ---->
                       /
-HEAD-(add file 'a')--+-------------------------
                       \
                        \-stable-(add file 'b')---->

So that in the imported git repository, the "dev" branch contains ONLY 'a'.

Below are: a script to reproduce this example, the cvs log output, and cvsps output. It's clear from the cvs log that 'b' has the 'dev' symbolic tag, so it seems like we should be able to recreate 'dev'.

Before I look into fixing this, I wanted to see if there were any comments from the list. David?

-chris

#!/bin/sh dirname=`date +"%Y%m%d%H%M%S"` mkdir $dirname && cd $dirname

# create the repository mkdir cvsroot && cd cvsroot export CVSROOT=`pwd` cd .. cvs init

# import an empty project mkdir project && cd project cvs import -m "Create initial repo" project yoyo start cd .. rmdir project

# checkout the project cvs co project && cd project

# create a new file on HEAD echo 1 >a cvs add a cvs ci -m "added file a to HEAD" a

# create and switch to "stable" branch cvs tag -b stable cvs update -r stable

# add a new file to stable branch echo 2 > b cvs add b cvs ci -m "added file b to 'stable' branch" b

# create and switch to "dev" branch from "stable" cvs tag -b dev cvs update -r dev

# modify file 'a' on "dev" branch echo "change" >> a cvs ci -m "changed file a on dev branch" a

# see what CVS thinks the "dev" branch looks like cd .. rm -rf project cvs checkout -r dev project ls project && echo "Note how b is PRESENT"

# check output of cvsps cd project cvs log > ../cvslog cd .. cvsps -A --test-log cvslog project > cvsps.out

# check behavior of git-cvsimport git-cvsimport -i -d $CVSROOT -C project.git project cd project.git git-checkout -f dev ls && echo "Note how b is ABSENT!" #***********EOF*********************

cvsps output
---------------------
PatchSet 1 
Date: 2005/10/31 22:30:46
Author: chris
Branch: HEAD
Tag: (none) 
Log:
added file a to HEAD
Members: 
	a:INITIAL->1.1 
---------------------
PatchSet 2 
Date: 2005/10/31 22:30:47
Author: chris
Branch: stable
Ancestor branch: HEAD
Tag: (none) 
Log:
added file b to 'stable' branch
Members: 
	b:1.1->1.1.2.1 
---------------------
PatchSet 3 
Date: 2005/10/31 22:30:48
Author: chris
Branch: dev
Ancestor branch: HEAD
Tag: (none) 
Log:
changed file a on dev branch
Members: 
	a:1.1->1.1.4.1 
******************EOF*********
cvs log output
RCS file: /home/chris/import/20051031223046/cvsroot/project/a,v
Working file: a
head: 1.1
branch:
locks: strict
access list:
symbolic names:
	dev: 1.1.0.4
	stable: 1.1.0.2
keyword substitution: kv
total revisions: 2;	selected revisions: 2
description:
----------------------------
revision 1.1
date: 2005/11/01 03:30:46;  author: chris;  state: Exp;
branches:  1.1.4;
added file a to HEAD
----------------------------
revision 1.1.4.1
date: 2005/11/01 03:30:48;  author: chris;  state: Exp;  lines: +1 -0
changed file a on dev branch
=============================================================================
RCS file: /home/chris/import/20051031223046/cvsroot/project/Attic/b,v
Working file: b
head: 1.1
branch:
locks: strict
access list:
symbolic names:
	dev: 1.1.2.1.0.2
	stable: 1.1.0.2
keyword substitution: kv
total revisions: 2;	selected revisions: 2
description:
----------------------------
revision 1.1
date: 2005/11/01 03:30:47;  author: chris;  state: dead;
branches:  1.1.2;
file b was initially added on branch stable.
----------------------------
revision 1.1.2.1
date: 2005/11/01 03:30:47;  author: chris;  state: Exp;  lines: +1 -0
added file b to 'stable' branch
=============================================================================
Next: Chris Shoemaker
Message 1 of 3 in “[OT] ancestor branch in cvsps is wrong for branch-of-branch”
  1. Chris ShoemakerNov 1, 2005
  2. CVSps fixed, git-cvsimport still buggy (WAS: [OT] ancestor branch in cvsps is wrong for branch-of-branch)Chris Shoemaker, Nov 9, 2005
  3. CVSps fixed; git-cvsimport works, tooChris Shoemaker, Nov 10, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.