summaryrefslogtreecommitdiff
path: root/fetch-pack.c
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2007-02-20 03:01:44 +0100
committerJunio C Hamano <junkio@cox.net>2007-02-19 19:20:05 -0800
commit83a5ad61268bbfea7e0d3180528366690f951554 (patch)
tree0cf3088f4bd830efb7b0b70fce31174f4a13a4c0 /fetch-pack.c
parent437b1b20df4b356c9342dac8d38849f24ef44f27 (diff)
downloadgit-83a5ad61268bbfea7e0d3180528366690f951554.tar.gz
fetch & clone: do not output progress when not on a tty
This adds the option "--no-progress" to fetch-pack and upload-pack, and makes fetch and clone pass this option when stdout is not a tty. While at documenting that option, also document --strict and --timeout options for upload-pack. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'fetch-pack.c')
-rw-r--r--fetch-pack.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/fetch-pack.c b/fetch-pack.c
index c787106764..fc6b4e06b4 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -15,8 +15,9 @@ static int quiet;
static int verbose;
static int fetch_all;
static int depth;
+static int no_progress;
static const char fetch_pack_usage[] =
-"git-fetch-pack [--all] [--quiet|-q] [--keep|-k] [--thin] [--upload-pack=<git-upload-pack>] [--depth=<n>] [-v] [<host>:]<directory> [<refs>...]";
+"git-fetch-pack [--all] [--quiet|-q] [--keep|-k] [--thin] [--upload-pack=<git-upload-pack>] [--depth=<n>] [--no-progress] [-v] [<host>:]<directory> [<refs>...]";
static const char *uploadpack = "git-upload-pack";
#define COMPLETE (1U << 0)
@@ -521,7 +522,7 @@ static int get_pack(int xd[2])
if (do_keep) {
*av++ = "index-pack";
*av++ = "--stdin";
- if (!quiet)
+ if (!quiet && !no_progress)
*av++ = "-v";
if (use_thin_pack)
*av++ = "--fix-thin";
@@ -718,6 +719,10 @@ int main(int argc, char **argv)
st.st_mtime = 0;
continue;
}
+ if (!strcmp("--no-progress", arg)) {
+ no_progress = 1;
+ continue;
+ }
usage(fetch_pack_usage);
}
dest = arg;
@@ -727,7 +732,12 @@ int main(int argc, char **argv)
}
if (!dest)
usage(fetch_pack_usage);
- pid = git_connect(fd, dest, uploadpack);
+ if (no_progress) {
+ char buf[256];
+ snprintf(buf, sizeof(buf), "%s --no-progress", uploadpack);
+ pid = git_connect(fd, dest, buf);
+ } else
+ pid = git_connect(fd, dest, uploadpack);
if (pid < 0)
return 1;
if (heads && nr_heads)