diff options
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/git-gpush | 4 | ||||
-rw-r--r-- | bin/git_gpush.pm | 14 |
2 files changed, 14 insertions, 4 deletions
diff --git a/bin/git-gpush b/bin/git-gpush index 77dc221..2d47df0 100755 --- a/bin/git-gpush +++ b/bin/git-gpush @@ -1853,7 +1853,7 @@ sub update_unpushed($) my ($rvrs, $ccs) = ($$group{add_rvrs} // [], $$group{add_ccs} // []); if (@$rvrs) { run_process(FWD_OUTPUT | DRY_RUN, - 'ssh', @gerrit_ssh, 'gerrit', 'set-reviewers', + @gerrit_ssh, 'gerrit', 'set-reviewers', (map { ('-a', $_) } @$rvrs), '--', (map { $$_{key} } @$invite_list)); } if (@$ccs) { @@ -1871,7 +1871,7 @@ sub update_unpushed($) if (!$quiet && !$printed); $printed = 1; run_process(FWD_OUTPUT | DRY_RUN, - 'ssh', @gerrit_ssh, 'gerrit', 'set-topic', + @gerrit_ssh, 'gerrit', 'set-topic', '-t', $$group{topic}, map { $$_{key} } @$topic_list); } } diff --git a/bin/git_gpush.pm b/bin/git_gpush.pm index 455ebf0..351f44d 100644 --- a/bin/git_gpush.pm +++ b/bin/git_gpush.pm @@ -2167,7 +2167,7 @@ sub _update_target_branches($) # URL for pushing/fetching from the Gerrit instance. our $gerrit_url; -# SSH arguments for connecting the Gerrit instance. +# SSH command with arguments for connecting the Gerrit instance. our @gerrit_ssh; # Target repository name on the Gerrit instance. our $gerrit_project; @@ -2192,6 +2192,16 @@ sub set_gerrit_config($) } else { fail("Remote '$rmt' does not use a supported protocol.\n") } + if (@gerrit_ssh) { + # Precedence according to git/connect.c:fill_ssh_args() + my $gssh = $ENV{GIT_SSH_COMMAND} // git_config('core.sshcommand'); + if (defined($gssh)) { + # Should use shell rules here, but that seems like overkill. + unshift @gerrit_ssh, split(/ /, $gssh); + } else { + unshift @gerrit_ssh, $ENV{GIT_SSH} // 'ssh'; + } + } } sub query_gerrit_only($;$) @@ -2199,7 +2209,7 @@ sub query_gerrit_only($;$) my ($ids, $extra) = @_; my @ginfos; - my $info = open_cmd_pipe(0, 'ssh', @gerrit_ssh, 'gerrit', 'query', '--format', 'JSON', + my $info = open_cmd_pipe(0, @gerrit_ssh, 'gerrit', 'query', '--format', 'JSON', '--no-limit', '--patch-sets', $extra ? @$extra : (), "project:$gerrit_project", '\\('.join(' OR ', @$ids).'\\)'); while (read_process($info)) { |