From patchwork Wed Aug 26 19:46:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junio C Hamano X-Patchwork-Id: 11739559 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3C9AC14E5 for ; Wed, 26 Aug 2020 19:47:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 197412080C for ; Wed, 26 Aug 2020 19:47:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=pobox.com header.i=@pobox.com header.b="HbpHRNG7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727034AbgHZTrB (ORCPT ); Wed, 26 Aug 2020 15:47:01 -0400 Received: from pb-smtp20.pobox.com ([173.228.157.52]:58288 "EHLO pb-smtp20.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726783AbgHZTrA (ORCPT ); Wed, 26 Aug 2020 15:47:00 -0400 Received: from pb-smtp20.pobox.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id CBC54E80D4; Wed, 26 Aug 2020 15:46:55 -0400 (EDT) (envelope-from gitster@pobox.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=sasl; bh=123IM9wycRIQZX81oRElcwg48 WQ=; b=HbpHRNG7Y74F+VybVYp2JJnZkJdTZwOaDnQaYgKp0iI4RzIsbe3/SaQKe w7qT69LZAK+6iDrNk4zqe8K5wbQulFx0uRLsVqshZ8pcSQ/50f/EZmluD5fAIUEa KcUO7EPx/mx6rEkySbvefwQQSRrX0WOPp5RyFoz6/Q2wfa6LG4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:subject :date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; q=dns; s=sasl; b=pizuB1daFCdRVsWMtuR DL0L5KIH+FAaTT7u8NsPK22H8Zi/GmqAEXuMpvdEycQn7vN/NB92bt5ogPoT4u8/ XkJOSQDkT+n1NzeNTN9MOW/RJew2hvmedByGecIuoi71xRGMxpwM5MP2XAPIv9Sz QinY8/KIL6n5hjfzKvNJxfLM= Received: from pb-smtp20.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id C2F49E80D2; Wed, 26 Aug 2020 15:46:55 -0400 (EDT) (envelope-from gitster@pobox.com) Received: from pobox.com (unknown [34.75.7.245]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp20.pobox.com (Postfix) with ESMTPSA id 12090E80D1; Wed, 26 Aug 2020 15:46:52 -0400 (EDT) (envelope-from gitster@pobox.com) From: Junio C Hamano To: git@vger.kernel.org Subject: [PATCH v2 1/2] transport-helper: do not run git-remote-ext etc. in dashed form Date: Wed, 26 Aug 2020 12:46:49 -0700 Message-Id: <20200826194650.4031087-2-gitster@pobox.com> X-Mailer: git-send-email 2.28.0-454-g5f859b1948 In-Reply-To: <20200826194650.4031087-1-gitster@pobox.com> References: <20200826194650.4031087-1-gitster@pobox.com> MIME-Version: 1.0 X-Pobox-Relay-ID: E3E79064-E7D4-11EA-9804-F0EA2EB3C613-77302942!pb-smtp20.pobox.com Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Running it as "git remote-ext" and letting "git" dispatch to "remote-ext" would just be fine and is more idiomatic. Signed-off-by: Junio C Hamano --- transport-helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/transport-helper.c b/transport-helper.c index defafbf4c1..c52c99d829 100644 --- a/transport-helper.c +++ b/transport-helper.c @@ -128,10 +128,10 @@ static struct child_process *get_helper(struct transport *transport) helper->in = -1; helper->out = -1; helper->err = 0; - strvec_pushf(&helper->args, "git-remote-%s", data->name); + strvec_pushf(&helper->args, "remote-%s", data->name); strvec_push(&helper->args, transport->remote->name); strvec_push(&helper->args, remove_ext_force(transport->url)); - helper->git_cmd = 0; + helper->git_cmd = 1; helper->silent_exec_failure = 1; if (have_git_dir()) From patchwork Wed Aug 26 19:46:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junio C Hamano X-Patchwork-Id: 11739561 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9776614E5 for ; Wed, 26 Aug 2020 19:47:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7FFD62080C for ; Wed, 26 Aug 2020 19:47:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=pobox.com header.i=@pobox.com header.b="YkGGyySu" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727042AbgHZTrE (ORCPT ); Wed, 26 Aug 2020 15:47:04 -0400 Received: from pb-smtp1.pobox.com ([64.147.108.70]:63177 "EHLO pb-smtp1.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727024AbgHZTrC (ORCPT ); Wed, 26 Aug 2020 15:47:02 -0400 Received: from pb-smtp1.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 067307EC4D; Wed, 26 Aug 2020 15:46:56 -0400 (EDT) (envelope-from gitster@pobox.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=sasl; bh=zzMDb/9sIVy7yhrr/9OAREjr0 z8=; b=YkGGyySuxUB8CihMBzZh/0Ka5EHmnCAELkhaOrMu6pEhkM8i65HssG5xV gMap60xD6EYrC+Fv0tZT8tUL8hYSUNkyheuHqKDqYRnq2YcaUc426zsVaj4Um2G1 oRysNOEs6uDcW8wNEmODdn6/btjy1TJaFnJ0XJidCHPgYJNI6c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:subject :date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; q=dns; s=sasl; b=DYjSGTZJE9a06A3u7ke PdYRZ413idjlDD9tlCemOe6g1gBX4J0B5tpqgJl+Esg2mN+SECeXVG3awO8dEIz4 WnHbzyNL6NWDKXWxacQQkfmv4SAHf+Jyw/yacQvt0Rts/lp0rN3YLpwcL5lMAaco zh3l+lCdg+K6zi+2TVlZqdqQ= Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id F2E3B7EC4C; Wed, 26 Aug 2020 15:46:55 -0400 (EDT) (envelope-from gitster@pobox.com) Received: from pobox.com (unknown [34.75.7.245]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp1.pobox.com (Postfix) with ESMTPSA id 7B2EC7EC49; Wed, 26 Aug 2020 15:46:55 -0400 (EDT) (envelope-from gitster@pobox.com) From: Junio C Hamano To: git@vger.kernel.org Subject: [PATCH v2 2/2] cvsexportcommit: do not run git programs in dashed form Date: Wed, 26 Aug 2020 12:46:50 -0700 Message-Id: <20200826194650.4031087-3-gitster@pobox.com> X-Mailer: git-send-email 2.28.0-454-g5f859b1948 In-Reply-To: <20200826194650.4031087-1-gitster@pobox.com> References: <20200826194650.4031087-1-gitster@pobox.com> MIME-Version: 1.0 X-Pobox-Relay-ID: E559F770-E7D4-11EA-B893-01D9BED8090B-77302942!pb-smtp1.pobox.com Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org This ancient script runs "git-foo" all over the place, which is OK for a scripted Porcelain in the Git suite, but asking "git" to dispatch to subcommands is the usual way these days. Signed-off-by: Junio C Hamano --- git-cvsexportcommit.perl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl index 0ae8bce3fb..289d4bc684 100755 --- a/git-cvsexportcommit.perl +++ b/git-cvsexportcommit.perl @@ -30,7 +30,7 @@ # Remember where GIT_DIR is before changing to CVS checkout unless ($ENV{GIT_DIR}) { # No GIT_DIR set. Figure it out for ourselves - my $gd =`git-rev-parse --git-dir`; + my $gd =`git rev-parse --git-dir`; chomp($gd); $ENV{GIT_DIR} = $gd; } @@ -66,7 +66,7 @@ # resolve target commit my $commit; $commit = pop @ARGV; -$commit = safe_pipe_capture('git-rev-parse', '--verify', "$commit^0"); +$commit = safe_pipe_capture('git', 'rev-parse', '--verify', "$commit^0"); chomp $commit; if ($?) { die "The commit reference $commit did not resolve!"; @@ -76,7 +76,7 @@ my $parent; if (@ARGV) { $parent = pop @ARGV; - $parent = safe_pipe_capture('git-rev-parse', '--verify', "$parent^0"); + $parent = safe_pipe_capture('git', 'rev-parse', '--verify', "$parent^0"); chomp $parent; if ($?) { die "The parent reference did not resolve!"; @@ -84,7 +84,7 @@ } # find parents from the commit itself -my @commit = safe_pipe_capture('git-cat-file', 'commit', $commit); +my @commit = safe_pipe_capture('git', 'cat-file', 'commit', $commit); my @parents; my $committer; my $author; @@ -162,9 +162,9 @@ close MSG; if ($parent eq $noparent) { - `git-diff-tree --binary -p --root $commit >.cvsexportcommit.diff`;# || die "Cannot diff"; + `git diff-tree --binary -p --root $commit >.cvsexportcommit.diff`;# || die "Cannot diff"; } else { - `git-diff-tree --binary -p $parent $commit >.cvsexportcommit.diff`;# || die "Cannot diff"; + `git diff-tree --binary -p $parent $commit >.cvsexportcommit.diff`;# || die "Cannot diff"; } ## apply non-binary changes @@ -178,7 +178,7 @@ print "Checking if patch will apply\n"; my @stat; -open APPLY, "GIT_INDEX_FILE=$tmpdir/index git-apply $context --summary --numstat<.cvsexportcommit.diff|" || die "cannot patch"; +open APPLY, "GIT_INDEX_FILE=$tmpdir/index git apply $context --summary --numstat<.cvsexportcommit.diff|" || die "cannot patch"; @stat=; close APPLY || die "Cannot patch"; my (@bfiles,@files,@afiles,@dfiles); @@ -333,7 +333,7 @@ if ($opt_W) { system("git checkout -q $commit^0") && die "cannot patch"; } else { - `GIT_INDEX_FILE=$tmpdir/index git-apply $context --summary --numstat --apply <.cvsexportcommit.diff` || die "cannot patch"; + `GIT_INDEX_FILE=$tmpdir/index git apply $context --summary --numstat --apply <.cvsexportcommit.diff` || die "cannot patch"; } print "Patch applied successfully. Adding new files and directories to CVS\n"; From patchwork Wed Aug 26 21:37:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junio C Hamano X-Patchwork-Id: 11739647 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F1D5513B6 for ; Wed, 26 Aug 2020 21:37:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C71AB2087C for ; Wed, 26 Aug 2020 21:37:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=pobox.com header.i=@pobox.com header.b="HExYyPgP" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727000AbgHZVhn (ORCPT ); Wed, 26 Aug 2020 17:37:43 -0400 Received: from pb-smtp1.pobox.com ([64.147.108.70]:63155 "EHLO pb-smtp1.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726783AbgHZVhm (ORCPT ); Wed, 26 Aug 2020 17:37:42 -0400 Received: from pb-smtp1.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 7C6A87FB0F; Wed, 26 Aug 2020 17:37:40 -0400 (EDT) (envelope-from junio@pobox.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to :subject:references:cc:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=eCMO6rKSlsX+LyNj6fUSRcEpMjg=; b=HExYyP gPDCQoz2Xx7Gz8MRy2L7BlbclVBRwhttf8DTsVUNBQ+V5eGoi7ECRfvTtdOEXO15 h5quRYOUYgwe9/cCGnEMBWNGqYSPNQjQdwvgIkoGbqoKXWtVFXruO/Ni+d3vD0IZ a+Nlz4RrPDS/+g7/fKDuSaDf/+YdDiSy0a3UY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:subject :references:cc:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=nzdgE4bUPs7iOoUYkFA4gHa//HJJCcNn nDrS5DWBkwdUpUyvIVdMd7vb0mRetuW+8v6LFoQQ+W1pgh5BtAPcXmVHdPCjDOC8 J6I8nSfBdeUPWN/Qb4RTNAUszpuM18US95/OwciQKVEJ31eItJ9c0wGsTuHl8dAH 7eSoLZcCshw= Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 750EE7FB0E; Wed, 26 Aug 2020 17:37:40 -0400 (EDT) (envelope-from junio@pobox.com) Received: from pobox.com (unknown [34.75.7.245]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp1.pobox.com (Postfix) with ESMTPSA id 0204F7FB0D; Wed, 26 Aug 2020 17:37:39 -0400 (EDT) (envelope-from junio@pobox.com) From: Junio C Hamano To: git@vger.kernel.org Subject: [PATCH v2 3/2] credential-cache: use child_process.args References: <20200826194650.4031087-1-gitster@pobox.com> <20200826194650.4031087-3-gitster@pobox.com> cc: Jeff King Date: Wed, 26 Aug 2020 14:37:39 -0700 In-Reply-To: <20200826194650.4031087-3-gitster@pobox.com> (Junio C. Hamano's message of "Wed, 26 Aug 2020 12:46:50 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 X-Pobox-Relay-ID: 5DC9648E-E7E4-11EA-90C3-01D9BED8090B-77302942!pb-smtp1.pobox.com Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org As child_process structure has an embedded strvec args for formulating the command line, let's use it instead of using an out-of-line argv[] whose length needs to be maintained correctly. Signed-off-by: Junio C Hamano Signed-off-by: Junio C Hamano --- builtin/credential-cache.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/builtin/credential-cache.c b/builtin/credential-cache.c index d0fafdeb9e..195335a783 100644 --- a/builtin/credential-cache.c +++ b/builtin/credential-cache.c @@ -42,13 +42,13 @@ static int send_request(const char *socket, const struct strbuf *out) static void spawn_daemon(const char *socket) { struct child_process daemon = CHILD_PROCESS_INIT; - const char *argv[] = { NULL, NULL, NULL }; char buf[128]; int r; - argv[0] = "git-credential-cache--daemon"; - argv[1] = socket; - daemon.argv = argv; + strvec_pushl(&daemon.args, + "credential-cache--daemon", socket, + NULL); + daemon.git_cmd = 1; daemon.no_stdin = 1; daemon.out = -1;