Skip to content

Commit

Permalink
Merge branches 'jc/rev-list' and 'jc/pack-thin'
Browse files Browse the repository at this point in the history
* jc/rev-list:
  rev-list --objects: use full pathname to help hashing.
  rev-list --objects-edge: remove duplicated edge commit output.
  rev-list --objects-edge

* jc/pack-thin:
  pack-objects: hash basename and direname a bit differently.
  pack-objects: allow "thin" packs to exceed depth limits
  pack-objects: use full pathname to help hashing with "thin" pack.
  pack-objects: thin pack micro-optimization.
  Use thin pack transfer in "git fetch".
  Add git-push --thin.
  send-pack --thin: use "thin pack" delta transfer.
  Thin pack - create packfile with missing delta base.

Conflicts:

	pack-objects.c (taking "next")
	send-pack.c (taking "next")
  • Loading branch information
Junio C Hamano committed Feb 25, 2006
3 parents 1509bd9 + e646de0 + eeef713 commit f0b0af1
Show file tree
Hide file tree
Showing 8 changed files with 437 additions and 128 deletions.
15 changes: 11 additions & 4 deletions fetch-pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ static int keep_pack;
static int quiet;
static int verbose;
static const char fetch_pack_usage[] =
"git-fetch-pack [-q] [-v] [-k] [--exec=upload-pack] [host:]directory <refs>...";
"git-fetch-pack [-q] [-v] [-k] [--thin] [--exec=upload-pack] [host:]directory <refs>...";
static const char *exec = "git-upload-pack";

#define COMPLETE (1U << 0)
Expand All @@ -18,7 +18,7 @@ static const char *exec = "git-upload-pack";
#define POPPED (1U << 4)

static struct commit_list *rev_list = NULL;
static int non_common_revs = 0, multi_ack = 0;
static int non_common_revs = 0, multi_ack = 0, use_thin_pack = 0;

static void rev_list_push(struct commit *commit, int mark)
{
Expand Down Expand Up @@ -156,8 +156,9 @@ static int find_common(int fd[2], unsigned char *result_sha1,
continue;
}

packet_write(fd[1], "want %s%s\n", sha1_to_hex(remote),
multi_ack ? " multi_ack" : "");
packet_write(fd[1], "want %s%s%s\n", sha1_to_hex(remote),
(multi_ack ? " multi_ack" : ""),
(use_thin_pack ? " thin-pack" : ""));
fetching++;
}
packet_flush(fd[1]);
Expand Down Expand Up @@ -421,6 +422,10 @@ int main(int argc, char **argv)
keep_pack = 1;
continue;
}
if (!strcmp("--thin", arg)) {
use_thin_pack = 1;
continue;
}
if (!strcmp("-v", arg)) {
verbose = 1;
continue;
Expand All @@ -434,6 +439,8 @@ int main(int argc, char **argv)
}
if (!dest)
usage(fetch_pack_usage);
if (keep_pack)
use_thin_pack = 0;
pid = git_connect(fd, dest, exec);
if (pid < 0)
return 1;
Expand Down
2 changes: 1 addition & 1 deletion git-fetch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ fetch_main () {
( : subshell because we muck with IFS
IFS=" $LF"
(
git-fetch-pack $exec $keep "$remote" $rref || echo failed "$remote"
git-fetch-pack $exec $keep --thin "$remote" $rref || echo failed "$remote"
) |
while read sha1 remote_name
do
Expand Down
4 changes: 4 additions & 0 deletions git-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ USAGE='[--all] [--tags] [--force] <repository> [<refspec>...]'
has_all=
has_force=
has_exec=
has_thin=
remote=
do_tags=

Expand All @@ -22,6 +23,8 @@ do
has_force=--force ;;
--exec=*)
has_exec="$1" ;;
--thin)
has_thin="$1" ;;
-*)
usage ;;
*)
Expand Down Expand Up @@ -72,6 +75,7 @@ set x "$remote" "$@"; shift
test "$has_all" && set x "$has_all" "$@" && shift
test "$has_force" && set x "$has_force" "$@" && shift
test "$has_exec" && set x "$has_exec" "$@" && shift
test "$has_thin" && set x "$has_thin" "$@" && shift

case "$remote" in
http://* | https://*)
Expand Down
Loading

0 comments on commit f0b0af1

Please sign in to comment.