remove chattygit mode from got-fetch-pack
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144
diff --git a/libexec/got-fetch-pack/got-fetch-pack.c b/libexec/got-fetch-pack/got-fetch-pack.c
index 548824f..5f2e668 100644
--- a/libexec/got-fetch-pack/got-fetch-pack.c
+++ b/libexec/got-fetch-pack/got-fetch-pack.c
@@ -54,7 +54,6 @@
#define GOT_PKTMAX 65536
struct got_object *indexed;
-static int chattygit;
static char *fetchbranch;
static struct got_object_id zhash = {.sha1={0}};
@@ -80,9 +79,6 @@ flushpkt(int fd)
{
ssize_t w;
- if (chattygit)
- fprintf(stderr, "writepkt: 0000\n");
-
w = write(fd, "0000", 4);
if (w == -1)
return got_error_from_errno("write");
@@ -145,7 +141,7 @@ static const struct got_error *
readpkt(int *outlen, int fd, char *buf, int buflen)
{
const struct got_error *err = NULL;
- int datalen, i;
+ int datalen;
ssize_t n;
err = read_pkthdr(&datalen, fd);
@@ -161,16 +157,6 @@ readpkt(int *outlen, int fd, char *buf, int buflen)
if (n != datalen)
return got_error_msg(GOT_ERR_BAD_PACKET, "short packet");
- if (chattygit) {
- fprintf(stderr, "readpkt: %zd:\t", n);
- fwrite(buf, 1, n, stderr);
- for (i = 0; i < n; i++) {
- if (isprint(buf[i]))
- fputc(buf[i], stderr);
- }
- fputc('\n', stderr);
- }
-
*outlen = n;
return NULL;
}
@@ -179,7 +165,6 @@ static const struct got_error *
writepkt(int fd, char *buf, int nbuf)
{
char len[5];
- int i;
ssize_t w;
if (snprintf(len, sizeof(len), "%04x", nbuf + 4) >= sizeof(len))
@@ -194,15 +179,6 @@ writepkt(int fd, char *buf, int nbuf)
return got_error_from_errno("write");
if (w != nbuf)
return got_error(GOT_ERR_IO);
- if (chattygit) {
- fprintf(stderr, "writepkt: %s:\t", len);
- fwrite(buf, 1, nbuf, stderr);
- for (i = 0; i < nbuf; i++) {
- if (isprint(buf[i]))
- fputc(buf[i], stderr);
- }
- fputc('\n', stderr);
- }
return NULL;
}
@@ -497,8 +473,6 @@ fetch_pack(int fd, int packfd, struct got_object_id *packid,
err = got_error_from_errno("malloc");
goto done;
}
- if (chattygit)
- fprintf(stderr, "starting fetch\n");
while (1) {
err = readpkt(&n, fd, buf, sizeof(buf));
if (err)
@@ -513,17 +487,11 @@ fetch_pack(int fd, int packfd, struct got_object_id *packid,
buf, n);
if (err)
goto done;
- if (chattygit && server_capabilities[0] != '\0')
- fprintf(stderr, "server capabilities: %s\n",
- server_capabilities);
if (is_firstpkt) {
err = match_capabilities(&my_capabilities, &symrefs,
server_capabilities);
if (err)
goto done;
- if (chattygit && my_capabilities)
- fprintf(stderr, "my matched capabilities: %s\n",
- my_capabilities);
err = got_privsep_send_fetch_symrefs(ibuf, &symrefs);
if (err)
goto done;
@@ -556,9 +524,6 @@ fetch_pack(int fd, int packfd, struct got_object_id *packid,
refname);
if (err)
goto done;
-
- if (chattygit)
- fprintf(stderr, "remote %s\n", refname);
nref++;
}
@@ -582,11 +547,8 @@ fetch_pack(int fd, int packfd, struct got_object_id *packid,
if (err)
goto done;
- if (nwant == 0) {
- if (chattygit)
- fprintf(stderr, "up to date\n");
+ if (nwant == 0)
goto done;
- }
for (i = 0; i < nref; i++) {
if (got_object_id_cmp(&have[i], &zhash) == 0)
@@ -648,9 +610,6 @@ fetch_pack(int fd, int packfd, struct got_object_id *packid,
}
}
- if (chattygit)
- fprintf(stderr, "fetching...\n");
-
if (my_capabilities != NULL &&
strstr(my_capabilities, GOT_CAPA_SIDE_BAND_64K) != NULL)
have_sidebands = 1;
@@ -791,11 +750,6 @@ main(int argc, char **argv)
TAILQ_INIT(&have_refs);
- if (getenv("GOT_DEBUG") != NULL) {
- fprintf(stderr, "fetch-pack being chatty!\n");
- chattygit = 1;
- }
-
imsg_init(&ibuf, GOT_IMSG_FD_CHILD);
#ifndef PROFILE
/* revoke access to most system calls */