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

[PATCH 3/3] cvsimport: standarize system() calls to external git tools

From
Ben Walton <bwalton@artsci.utoronto.ca>
Date
Jan 19, 2010, 19:03 UTC
Message-ID
<1263927790-1872-3-git-send-email-bwalton@artsci.utoronto.ca>
In-Reply-To
<1263927790-1872-2-git-send-email-bwalton@artsci.utoronto.ca>

This patch standardizes calls to system() where. Instead of system("git foo ... "), use system(qw(git foo ...)). This standarization should see all calls made without the use of an 'sh -c' process to split the arguments.

Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
---
 git-cvsimport.perl |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/git-cvsimport.perl b/git-cvsimport.perl
index e838c2e..4853bf7 100755
--- a/git-cvsimport.perl
+++ b/git-cvsimport.perl
@@ -609,9 +609,9 @@ $orig_git_index = $ENV{GIT_INDEX_FILE} if exists $ENV{GIT_INDEX_FILE};
 my %index; # holds filenames of one index per branch
 
 unless (-d $git_dir) {
-	system("git init");
+	system(qw(git init));
 	die "Cannot init the GIT db at $git_tree: $?\n" if $?;
-	system("git read-tree");
+	system(qw(git read-tree));
 	die "Cannot init an empty tree: $?\n" if $?;
 
 	$last_branch = $opt_o;
@@ -993,7 +993,7 @@ while (<CVS>) {
 		}
 		commit();
 		if (($commitcount & 1023) == 0) {
-			system("git repack -a -d");
+			system(qw(git repack -a -d));
 		}
 		$state = 1;
 	} elsif ($state == 11 and /^-+$/) {
@@ -1017,7 +1017,7 @@ my $line = `git count-objects`;
 if ($line =~ /^(\d+) objects, (\d+) kilobytes$/) {
   my ($n_objects, $kb) = ($1, $2);
   1024 < $kb
-    and system("git repack -a -d");
+    and system(qw(git repack -a -d));
 }
 
 foreach my $git_index (values %index) {
@@ -1059,7 +1059,7 @@ if ($orig_branch) {
 		if ($opt_r && $opt_o ne 'HEAD');
 	system('git', 'update-ref', 'HEAD', "$orig_branch");
 	unless ($opt_i) {
-		system('git checkout -f');
+		system(qw(git checkout -f));
 		die "checkout failed: $?\n" if $?;
 	}
 }
-- 
1.6.5.3
Previous: Ben Walton
Message 6 of 6 in “cvsimport: update to use non-dash git commands”
  1. cvsimport: update to use non-dash git commandsBen Walton, Jan 17, 2010
  2. cvsimport: modernize and standardize external tool callingBen Walton, Jan 17, 2010
  3. Junio C HamanoJan 17, 2010
  4. 1/3 cvsimport: modernize callouts to git subcommandsBen Walton, Jan 19, 2010
  5. 2/3 cvsimport: standarize open() calls to external git toolsBen Walton, Jan 19, 2010
  6. 3/3 cvsimport: standarize system() calls to external git toolsBen Walton, Jan 19, 2010

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.