Skip to content

Commit 5a277f3

Browse files
committed
Revert "Merge branch 'cb/maint-quiet-push' into maint"
This reverts commit ffa69e6, reversing changes made to 4a13c4d. Adding a new command line option to receive-pack and feed it from send-pack is not an acceptable way to add features, as there is no guarantee that your updated send-pack will be talking to updated receive-pack. New features need to be added via the capability mechanism negotiated over the protocol. Signed-off-by: Junio C Hamano <[email protected]>
1 parent b15b5b1 commit 5a277f3

File tree

6 files changed

+10
-39
lines changed

6 files changed

+10
-39
lines changed

Documentation/git-receive-pack.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ git-receive-pack - Receive what is pushed into the repository
99
SYNOPSIS
1010
--------
1111
[verse]
12-
'git-receive-pack' [--quiet] <directory>
12+
'git-receive-pack' <directory>
1313

1414
DESCRIPTION
1515
-----------
@@ -35,9 +35,6 @@ are not fast-forwards.
3535

3636
OPTIONS
3737
-------
38-
--quiet::
39-
Print only error messages.
40-
4138
<directory>::
4239
The repository to sync into.
4340

Documentation/git-send-pack.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ git-send-pack - Push objects over git protocol to another repository
99
SYNOPSIS
1010
--------
1111
[verse]
12-
'git send-pack' [--all] [--dry-run] [--force] [--receive-pack=<git-receive-pack>] [--quiet] [--verbose] [--thin] [<host>:]<directory> [<ref>...]
12+
'git send-pack' [--all] [--dry-run] [--force] [--receive-pack=<git-receive-pack>] [--verbose] [--thin] [<host>:]<directory> [<ref>...]
1313

1414
DESCRIPTION
1515
-----------
@@ -45,9 +45,6 @@ OPTIONS
4545
the remote repository can lose commits; use it with
4646
care.
4747

48-
--quiet::
49-
Print only error messages.
50-
5148
--verbose::
5249
Run verbosely.
5350

builtin/receive-pack.c

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ static const char *parse_pack_header(struct pack_header *hdr)
636636

637637
static const char *pack_lockfile;
638638

639-
static const char *unpack(int quiet)
639+
static const char *unpack(void)
640640
{
641641
struct pack_header hdr;
642642
const char *hdr_err;
@@ -651,10 +651,8 @@ static const char *unpack(int quiet)
651651

652652
if (ntohl(hdr.hdr_entries) < unpack_limit) {
653653
int code, i = 0;
654-
const char *unpacker[5];
654+
const char *unpacker[4];
655655
unpacker[i++] = "unpack-objects";
656-
if (quiet)
657-
unpacker[i++] = "-q";
658656
if (receive_fsck_objects)
659657
unpacker[i++] = "--strict";
660658
unpacker[i++] = hdr_arg;
@@ -755,7 +753,6 @@ static void add_alternate_refs(void)
755753

756754
int cmd_receive_pack(int argc, const char **argv, const char *prefix)
757755
{
758-
int quiet = 0;
759756
int advertise_refs = 0;
760757
int stateless_rpc = 0;
761758
int i;
@@ -769,11 +766,6 @@ int cmd_receive_pack(int argc, const char **argv, const char *prefix)
769766
const char *arg = *argv++;
770767

771768
if (*arg == '-') {
772-
if (!strcmp(arg, "--quiet")) {
773-
quiet = 1;
774-
continue;
775-
}
776-
777769
if (!strcmp(arg, "--advertise-refs")) {
778770
advertise_refs = 1;
779771
continue;
@@ -822,7 +814,7 @@ int cmd_receive_pack(int argc, const char **argv, const char *prefix)
822814
const char *unpack_status = NULL;
823815

824816
if (!delete_only(commands))
825-
unpack_status = unpack(quiet);
817+
unpack_status = unpack();
826818
execute_commands(commands, unpack_status);
827819
if (pack_lockfile)
828820
unlink_or_warn(pack_lockfile);

builtin/send-pack.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -439,10 +439,6 @@ int cmd_send_pack(int argc, const char **argv, const char *prefix)
439439
args.force_update = 1;
440440
continue;
441441
}
442-
if (!strcmp(arg, "--quiet")) {
443-
args.quiet = 1;
444-
continue;
445-
}
446442
if (!strcmp(arg, "--verbose")) {
447443
args.verbose = 1;
448444
continue;
@@ -492,13 +488,8 @@ int cmd_send_pack(int argc, const char **argv, const char *prefix)
492488
fd[0] = 0;
493489
fd[1] = 1;
494490
} else {
495-
struct strbuf sb = STRBUF_INIT;
496-
strbuf_addstr(&sb, receivepack);
497-
if (args.quiet)
498-
strbuf_addstr(&sb, " --quiet");
499-
conn = git_connect(fd, dest, sb.buf,
491+
conn = git_connect(fd, dest, receivepack,
500492
args.verbose ? CONNECT_VERBOSE : 0);
501-
strbuf_release(&sb);
502493
}
503494

504495
memset(&extra_have, 0, sizeof(extra_have));

remote-curl.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -762,9 +762,7 @@ static int push_git(struct discovery *heads, int nr_spec, char **specs)
762762
argv[argc++] = "--thin";
763763
if (options.dry_run)
764764
argv[argc++] = "--dry-run";
765-
if (options.verbosity < 0)
766-
argv[argc++] = "--quiet";
767-
else if (options.verbosity > 1)
765+
if (options.verbosity > 1)
768766
argv[argc++] = "--verbose";
769767
argv[argc++] = url;
770768
for (i = 0; i < nr_spec; i++)

transport.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -482,18 +482,14 @@ static int set_git_option(struct git_transport_options *opts,
482482
static int connect_setup(struct transport *transport, int for_push, int verbose)
483483
{
484484
struct git_transport_data *data = transport->data;
485-
struct strbuf sb = STRBUF_INIT;
486485

487486
if (data->conn)
488487
return 0;
489488

490-
strbuf_addstr(&sb, for_push ? data->options.receivepack :
491-
data->options.uploadpack);
492-
if (for_push && transport->verbose < 0)
493-
strbuf_addstr(&sb, " --quiet");
494-
data->conn = git_connect(data->fd, transport->url, sb.buf,
489+
data->conn = git_connect(data->fd, transport->url,
490+
for_push ? data->options.receivepack :
491+
data->options.uploadpack,
495492
verbose ? CONNECT_VERBOSE : 0);
496-
strbuf_release(&sb);
497493

498494
return 0;
499495
}

0 commit comments

Comments
 (0)