summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 437b1b2)
raw | patch | inline | side by side (parent: 437b1b2)
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | |
Tue, 20 Feb 2007 02:01:44 +0000 (03:01 +0100) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Tue, 20 Feb 2007 03:20:05 +0000 (19:20 -0800) |
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>
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>
index 105d76b0ba85ecc4bd2af6dd560ae28310a5c7be..a99a5b321f763911b0d5d233a8135c5b60be6e3b 100644 (file)
SYNOPSIS
--------
-'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>...]
DESCRIPTION
-----------
\--depth=<n>::
Limit fetching to ancestor-chains not longer than n.
+\--no-progress::
+ Do not show the progress.
+
\-v::
Run verbosely.
index 9da062d5c94aa631317fbcdc8b07443e58374bd8..c75c86ea79ed73e7a9e451f3d003462d253385d6 100644 (file)
SYNOPSIS
--------
-'git-upload-pack' <directory>
+'git-upload-pack' [--strict] [--timeout=<n>] [--no-progress] <directory>
DESCRIPTION
-----------
OPTIONS
-------
+
+\--strict::
+ Do not try <directory>/.git/ if <directory> is no git directory.
+
+\--timeout=<n>::
+ Interrupt transfer after <n> seconds of inactivity.
+
+\--no-progress::
+ Do not show the progress.
+
<directory>::
The repository to sync from.
diff --git a/fetch-pack.c b/fetch-pack.c
index c7871067640f65d416500191792747cb451ffd32..fc6b4e06b43722c770eac5e911e48a45cf51ce96 100644 (file)
--- a/fetch-pack.c
+++ b/fetch-pack.c
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)
if (do_keep) {
*av++ = "index-pack";
*av++ = "--stdin";
- if (!quiet)
+ if (!quiet && !no_progress)
*av++ = "-v";
if (use_thin_pack)
*av++ = "--fix-thin";
st.st_mtime = 0;
continue;
}
+ if (!strcmp("--no-progress", arg)) {
+ no_progress = 1;
+ continue;
+ }
usage(fetch_pack_usage);
}
dest = arg;
}
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)
diff --git a/git-clone.sh b/git-clone.sh
index 1bd54ded3c424db30ca46b00b3ed42b4d774d21d..86890ea1f4b0813e9aa7ec45e31659b35defcf9c 100755 (executable)
--- a/git-clone.sh
+++ b/git-clone.sh
origin_override=
use_separate_remote=t
depth=
+no_progress=
+test -t 1 || no_progress=--no-progress
while
case "$#,$1" in
0,*) break ;;
;;
*)
case "$upload_pack" in
- '') git-fetch-pack --all -k $quiet $depth "$repo" ;;
- *) git-fetch-pack --all -k $quiet "$upload_pack" $depth "$repo" ;;
+ '') git-fetch-pack --all -k $quiet $depth $no_progress "$repo";;
+ *) git-fetch-pack --all -k $quiet "$upload_pack" $depth $no_progress "$repo" ;;
esac >"$GIT_DIR/CLONE_HEAD" ||
die "fetch-pack from '$repo' failed."
;;
diff --git a/git-fetch.sh b/git-fetch.sh
index ca984e739a595131dca4070982f524d3a53f9637..851ed6b6466995ef36c02e88a3b1b161f4008471 100755 (executable)
--- a/git-fetch.sh
+++ b/git-fetch.sh
exec=
keep=
shallow_depth=
+no_progress=
+test -t 1 || no_progress=--no-progress
while case "$#" in 0) break ;; esac
do
case "$1" in
( : subshell because we muck with IFS
IFS=" $LF"
(
- git-fetch-pack --thin $exec $keep $shallow_depth "$remote" $rref ||
+ git-fetch-pack --thin $exec $keep $shallow_depth $no_progress \
+ "$remote" $rref ||
echo failed "$remote"
) |
(
diff --git a/upload-pack.c b/upload-pack.c
index 3648aae1a777aec4bba77b40b9cf6da484190441..d1be07fb9efccb8244df1c130a6401a02c0a2ebf 100644 (file)
--- a/upload-pack.c
+++ b/upload-pack.c
#include "revision.h"
#include "list-objects.h"
-static const char upload_pack_usage[] = "git-upload-pack [--strict] [--timeout=nn] <dir>";
+static const char upload_pack_usage[] = "git-upload-pack [--strict] [--timeout=nn] [--no-progress] <dir>";
/* bits #0..7 in revision.h, #8..10 in commit.c */
#define THEY_HAVE (1u << 11)
static unsigned long oldest_have;
static int multi_ack, nr_our_refs;
-static int use_thin_pack, use_ofs_delta;
+static int use_thin_pack, use_ofs_delta, no_progress;
static struct object_array have_obj;
static struct object_array want_obj;
static unsigned int timeout;
die("git-upload-pack: unable to fork git-pack-objects");
}
if (!pid_pack_objects) {
+ const char *argv[10];
+ int i = 0;
+
dup2(lp_pipe[0], 0);
dup2(pu_pipe[1], 1);
dup2(pe_pipe[1], 2);
close(pu_pipe[1]);
close(pe_pipe[0]);
close(pe_pipe[1]);
- execl_git_cmd("pack-objects", "--stdout", "--progress",
- use_ofs_delta ? "--delta-base-offset" : NULL,
- NULL);
+
+ argv[i++] = "pack-objects";
+ argv[i++] = "--stdout";
+ if (!no_progress)
+ argv[i++] = "--progress";
+ if (use_ofs_delta)
+ argv[i++] = "--delta-base-offset";
+ argv[i++] = NULL;
+
+ execv_git_cmd(argv);
kill(pid_rev_list, SIGKILL);
die("git-upload-pack: unable to exec git-pack-objects");
}
timeout = atoi(arg+10);
continue;
}
+ if (!strcmp(arg, "--no-progress")) {
+ no_progress = 1;
+ continue;
+ }
if (!strcmp(arg, "--")) {
i++;
break;