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

cvs2git and file permissions

From
SVSven Verdoolaege <sven.verdoolaege@cs.kuleuven.ac.be>
Date
Jun 18, 2005, 20:52 UTC
Message-ID
<20050618205208.GA4917@billie.cs.kuleuven.ac.be>

cvs2git currently drops mode information. I've been bitten by this behaviour twice already. The patch below fixes that, though not very cleanly.

skimo -- git-cvs2git: propagate mode information

Let cvs checkout in a temporary directory rather than using the pipe option to avoid loss of mode information.

Signed-off-by: Sven Verdoolaege <skimo@liacs.nl>

--- commit df97fd9b709bd927f15adbc1a90ddfcfa79c7895 tree 0f223f52fdf7d61d7d1df0da1137a542811d27f9 parent fdf95bf8d4d1182db579bd25fe5e25811084eaa6 author Sven Verdoolaege <skimo@kotnet.org> Sat, 18 Jun 2005 22:41:46 +0200 committer Sven Verdoolaege <skimo@kotnet.org> Sat, 18 Jun 2005 22:41:46 +0200

 cvs2git.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/cvs2git.c b/cvs2git.c
--- a/cvs2git.c
+++ b/cvs2git.c
@@ -196,10 +196,15 @@ static void update_file(char *line)
 	}
 
 	dir = strrchr(name, '/');
-	if (dir)
+	if (dir) {
 		printf("mkdir -p %.*s\n", (int)(dir - name), name);
+		printf("mkdir -p .git-tmp/%.*s\n", (int)(dir - name), name);
+	}
 
-	printf("cvs -q -d %s checkout -r%s -p '%s/%s' > '%s'\n", cvsroot, version, cvsmodule, name, name);
+	printf("cvs -q -d %s checkout -N -d .git-tmp -r%s '%s/%s'\n", 
+		cvsroot, version, cvsmodule, name);
+	printf("mv -f .git-tmp/%s/%s %s\n", cvsmodule, name, name);
+	printf("rm -rf .git-tmp\n");
 	printf("git-update-cache --add -- '%s'\n", name);
 }
 
Next: Linus Torvalds
Message 1 of 3 in “cvs2git and file permissions”
  1. Sven VerdoolaegeJun 18, 2005
  2. Linus TorvaldsJun 18, 2005
  3. Sven VerdoolaegeJun 18, 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.