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

Re: cvsimport and branches with "(" in the name

From
Jeff King <peff@peff.net>
Date
Apr 29, 2008, 15:52 UTC
Message-ID
<20080429155238.GA18494@sigill.intra.peff.net>
In-Reply-To
<320075ff0804290022r56c9f4efx74a13d3502be212@mail.gmail.com>
On Tue, Apr 29, 2008 at 08:22:02AM +0100, Nigel Magnay wrote:
Show 6 quoted lines
> git 1.5.4.4 on ubuntu, I cvsimport a repository that has an oddly
> named branch - I get
> 
> sh: Syntax error: "(" unexpected
> Cannot write branch ChapelHill_3_0(iteration2)_esap_demo for update:
> Bad file descriptor

Looks like cvsimport is handing something as an argument to a git command, but we accidentally involve the shell. Maybe here:

diff --git a/git-cvsimport.perl b/git-cvsimport.perl
index 95c5eec..bdac5d5 100755
--- a/git-cvsimport.perl
+++ b/git-cvsimport.perl
@@ -772,7 +772,7 @@ sub commit {
 	waitpid($pid,0);
 	die "Error running git-commit-tree: $?\n" if $?;
 
-	system("git-update-ref $remote/$branch $cid") == 0
+	system('git-update-ref', "$remote/$branch", $cid) == 0
 		or die "Cannot write branch $branch for update: $!\n";
 
 	if ($tag) {

Does that fix it?

> Any ideas on how to diagnose / fix it further ?

If that doesn't work, you might try running with GIT_TRACE=1, and then
you can see which commands are being run when the error occurs.

-Peff
Previous: Nigel MagnayNext: Morten Welinder
Message 2 of 4 in “cvsimport and branches with "(" in the name”
  1. Nigel MagnayApr 29, 2008
  2. Jeff KingApr 29, 2008
  3. Morten WelinderApr 30, 2008
  4. Jeff KingApr 30, 2008

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.