Merge master changes into release candidate branch.
authorJunio C Hamano <junkio@cox.net>
Sat, 13 Aug 2005 07:12:51 +0000 (00:12 -0700)
committerJunio C Hamano <junkio@cox.net>
Sat, 13 Aug 2005 07:12:51 +0000 (00:12 -0700)
Signed-off-by: Junio C Hamano <junkio@cox.net>
14 files changed:
Documentation/Makefile
Documentation/git-fetch-pack.txt
Documentation/git-unpack-objects.txt
Makefile
debian/changelog
debian/control
debian/rules
fetch-pack.c
git-core.spec.in
git-fetch-script
git-format-patch-script
templates/Makefile
tools/Makefile
unpack-objects.c

index 4798933..c887ded 100644 (file)
@@ -11,6 +11,7 @@ bin=$(prefix)/bin
 mandir=$(prefix)/man
 man1=$(mandir)/man1
 man7=$(mandir)/man7
+# DESTDIR=
 
 INSTALL=install
 
@@ -33,9 +34,9 @@ man1: $(DOC_MAN1)
 man7: $(DOC_MAN7)
 
 install:
-       $(INSTALL) -m755 -d $(dest)/$(man1) $(dest)/$(man7)
-       $(INSTALL) $(DOC_MAN1) $(dest)/$(man1)
-       $(INSTALL) $(DOC_MAN7) $(dest)/$(man7)
+       $(INSTALL) -m755 -d $(DESTDIR)/$(man1) $(DESTDIR)/$(man7)
+       $(INSTALL) $(DOC_MAN1) $(DESTDIR)/$(man1)
+       $(INSTALL) $(DOC_MAN7) $(DESTDIR)/$(man7)
 
 # 'include' dependencies
 git-diff-%.txt: diff-format.txt diff-options.txt
index 884a26b..59afa14 100644 (file)
@@ -9,19 +9,19 @@ git-fetch-pack - Receive missing objects from another repository.
 
 SYNOPSIS
 --------
-git-fetch-pack [-q] [--exec=<git-upload-pack>] [<host>:]<directory> [<head>...] < <commit-list>
+git-fetch-pack [-q] [--exec=<git-upload-pack>] [<host>:]<directory> [<refs>...]
 
 DESCRIPTION
 -----------
 Invokes 'git-upload-pack' on a potentially remote repository,
 and asks it to send objects missing from this repository, to
 update the named heads.  The list of commits available locally
-is fed from the standard input, to be sent to 'git-upload-pack'
-running on the other end.
+is found out by scanning local $GIT_DIR/refs/ and sent to
+'git-upload-pack' running on the other end.
 
-This command can be used only when the local side has a common
-(ancestor) commit with the remote head that is being pulled
-from.  Use 'git-clone-pack' for that.
+This command degenerates to download everything to complete the
+asked refs from the remote side when the local side does not
+have a common ancestor commit.
 
 
 OPTIONS
@@ -50,15 +50,11 @@ OPTIONS
 <directory>::
        The repository to sync from.
 
-<head>...::
+<refs>...::
        The remote heads to update from. This is relative to
        $GIT_DIR (e.g. "HEAD", "refs/heads/master").  When
        unspecified, update from all heads the remote side has.
 
-       However the program refuses to work if more than one
-       remote head matches the specified heads.  I am not sure
-       what this means... Help!!!!!
-
 
 Author
 ------
index a12b843..a42a75e 100644 (file)
@@ -9,7 +9,7 @@ git-unpack-objects - Unpack objects from a packed archive.
 
 SYNOPSIS
 --------
-'git-unpack-objects' pack-file
+'git-unpack-objects' [-q] <pack-file
 
 
 DESCRIPTION
@@ -18,6 +18,12 @@ Reads a packed archive (.pack) from the standard input, and
 expands the objects contained in the pack into "one-file
 one-object" format in $GIT_OBJECT_DIRECTORY.
 
+OPTIONS
+-------
+-q::
+       The command usually shows percentage progress.  This
+       flag suppresses it.
+
 
 Author
 ------
index 6bc3ed7..ff3d7e3 100644 (file)
--- a/Makefile
+++ b/Makefile
 
 # DEFINES += -DUSE_STDEV
 
-GIT_VERSION=0.99.5
+GIT_VERSION = 0.99.5
 
-COPTS?=-g -O2
-CFLAGS+=$(COPTS) -Wall $(DEFINES)
+CFLAGS = -g -O2 -Wall
+ALL_CFLAGS = $(CFLAGS) $(DEFINES)
 
-prefix=$(HOME)
-bindir=$(prefix)/bin
-template_dir=$(prefix)/share/git-core/templates/
-# dest=
+prefix = $(HOME)
+bindir = $(prefix)/bin
+template_dir = $(prefix)/share/git-core/templates/
+# DESTDIR=
 
-CC?=gcc
-AR?=ar
-INSTALL?=install
-RPMBUILD?=rpmbuild
+CC = gcc
+AR = ar
+INSTALL = install
+RPMBUILD = rpmbuild
 
 # sparse is architecture-neutral, which means that we need to tell it
 # explicitly what architecture to check for. Fix this up for yours..
-SPARSE_FLAGS?=-D__BIG_ENDIAN__ -D__powerpc__
+SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__
 
 
 
@@ -87,7 +87,7 @@ PROG=   git-update-cache git-diff-files git-init-db git-write-tree \
        git-update-server-info git-show-rev-cache git-build-rev-cache
 
 ifndef NO_CURL
-PROG+= git-http-pull
+       PROG+= git-http-pull
 endif
 
 LIB_FILE=libgit.a
@@ -125,28 +125,28 @@ ifndef NO_OPENSSL
        LIB_OBJS += epoch.o
        OPENSSL_LIBSSL=-lssl
 else
-       CFLAGS += '-DNO_OPENSSL'
+       DEFINES += '-DNO_OPENSSL'
        MOZILLA_SHA1=1
        OPENSSL_LIBSSL=
 endif
 ifdef MOZILLA_SHA1
-  SHA1_HEADER="mozilla-sha1/sha1.h"
-  LIB_OBJS += mozilla-sha1/sha1.o
+       SHA1_HEADER="mozilla-sha1/sha1.h"
+       LIB_OBJS += mozilla-sha1/sha1.o
 else
-ifdef PPC_SHA1
-  SHA1_HEADER="ppc/sha1.h"
-  LIB_OBJS += ppc/sha1.o ppc/sha1ppc.o
-else
-  SHA1_HEADER=<openssl/sha.h>
-ifeq ($(shell uname -s),Darwin)
-  LIBS += -lcrypto -lssl
-else
-  LIBS += -lcrypto
-endif
-endif
+       ifdef PPC_SHA1
+               SHA1_HEADER="ppc/sha1.h"
+               LIB_OBJS += ppc/sha1.o ppc/sha1ppc.o
+       else
+               SHA1_HEADER=<openssl/sha.h>
+               ifeq ($(shell uname -s),Darwin)
+                       LIBS += -lcrypto -lssl
+               else
+                       LIBS += -lcrypto
+               endif
+       endif
 endif
 
-CFLAGS += '-DSHA1_HEADER=$(SHA1_HEADER)'
+DEFINES += '-DSHA1_HEADER=$(SHA1_HEADER)'
 
 
 
@@ -156,12 +156,15 @@ all: $(PROG)
 
 all:
        $(MAKE) -C templates
+       $(MAKE) -C tools
+
+%.o: %.c
+       $(CC) -o $*.o -c $(ALL_CFLAGS) $<
+%.o: %.S
+       $(CC) -o $*.o -c $(ALL_CFLAGS) $<
 
-.SECONDARY: %.o
-.c.o:
-       $(CC) $(CFLAGS) -o $*.o -c $*.c
 git-%: %.o $(LIB_FILE)
-       $(CC) $(CFLAGS) -o $@ $(filter %.o,$^) $(LIBS)
+       $(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^) $(LIBS)
 
 git-http-pull: pull.o
 git-local-pull: pull.o
@@ -172,7 +175,8 @@ git-http-pull: LIBS += -lcurl
 git-rev-list: LIBS += $(OPENSSL_LIBSSL)
 
 init-db.o: init-db.c
-       $(CC) -c $(CFLAGS) -DDEFAULT_GIT_TEMPLATE_DIR='"$(template_dir)"' $*.c
+       $(CC) -c $(ALL_CFLAGS) \
+               -DDEFAULT_GIT_TEMPLATE_DIR='"$(template_dir)"' $*.c
 
 $(LIB_OBJS): $(LIB_H)
 $(patsubst git-%,%.o,$(PROG)): $(LIB_H)
@@ -192,24 +196,22 @@ test: all
        $(MAKE) -C t/ all
 
 test-date: test-date.c date.o
-       $(CC) $(CFLAGS) -o $@ test-date.c date.o
+       $(CC) $(ALL_CFLAGS) -o $@ test-date.c date.o
 
 test-delta: test-delta.c diff-delta.o patch-delta.o
-       $(CC) $(CFLAGS) -o $@ $^
+       $(CC) $(ALL_CFLAGS) -o $@ $^
 
 check:
-       for i in *.c; do sparse $(CFLAGS) $(SPARSE_FLAGS) $$i; done
+       for i in *.c; do sparse $(ALL_CFLAGS) $(SPARSE_FLAGS) $$i; done
 
 
 
 ### Installation rules
 
 install: $(PROG) $(SCRIPTS)
-       $(INSTALL) -m755 -d $(dest)$(bindir)
-       $(INSTALL) $(PROG) $(SCRIPTS) $(dest)$(bindir)
+       $(INSTALL) -m755 -d $(DESTDIR)$(bindir)
+       $(INSTALL) $(PROG) $(SCRIPTS) $(DESTDIR)$(bindir)
        $(MAKE) -C templates install
-
-install-tools:
        $(MAKE) -C tools install
 
 install-doc:
@@ -238,15 +240,18 @@ rpm: dist
 deb: dist
        rm -rf $(GIT_TARNAME)
        tar zxf $(GIT_TARNAME).tar.gz
+       dpkg-source -b $(GIT_TARNAME)
        cd $(GIT_TARNAME) && fakeroot debian/rules binary
 
 ### Cleaning rules
 
 clean:
        rm -f *.o mozilla-sha1/*.o ppc/*.o $(PROG) $(LIB_FILE)
-       rm -f $(GIT_TARNAME).tar.gz git-core.spec
-       rm -f git-core_$(GIT_VERSION)-*.deb git-tk_$(GIT_VERSION)-*.deb
+       rm -f git-core.spec
        rm -rf $(GIT_TARNAME)
+       rm -f $(GIT_TARNAME).tar.gz git-core_$(GIT_VERSION)-*.tar.gz
+       rm -f git-core_$(GIT_VERSION)-*.deb git-core_$(GIT_VERSION)-*.dsc
+       rm -f git-tk_$(GIT_VERSION)-*.deb
        $(MAKE) -C tools/ clean
        $(MAKE) -C Documentation/ clean
        $(MAKE) -C templates/ clean
index 28cfb0f..da7526e 100644 (file)
@@ -4,6 +4,12 @@ git-core (0.99.5-0) unstable; urgency=low
 
  -- Junio C Hamano <junkio@cox.net>  Wed, 10 Aug 2005 22:05:00 -0700
 
+git-core (0.99.4-4) unstable; urgency=low
+
+  * Mark git-tk as architecture neutral.
+
+ -- Junio C Hamano <junkio@cox.net>  Fri, 12 Aug 2005 13:25:00 -0700
+
 git-core (0.99.4-3) unstable; urgency=low
 
   * Split off gitk.
index 53b87f4..5df89dd 100644 (file)
@@ -7,7 +7,7 @@ Standards-Version: 3.6.1
 
 Package: git-core
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, patch, rcs
+Depends: ${shlibs:Depends}, ${perl:Depends}, ${misc:Depends}, patch, rcs
 Recommends: rsync, curl, ssh, libmail-sendmail-perl, libemail-valid-perl
 Conflicts: git
 Description: The git content addressable filesystem
@@ -18,7 +18,7 @@ Description: The git content addressable filesystem
  similar to other SCM tools.
 
 Package: git-tk
-Architecture: any
+Architecture: all
 Depends: ${shlibs:Depends}, ${misc:Depends}, git-core, tk8.4
 Description: The git content addressable filesystem, GUI add-on
  This package contains 'gitk', the git revision tree visualizer.
index 921aeec..c46b4d9 100755 (executable)
@@ -56,7 +56,8 @@ install: build
        dh_clean -k 
        dh_installdirs 
 
-       make dest=$(DESTDIR) prefix=$(PREFIX) mandir=$(MANDIR) install install-tools install-doc
+       make DESTDIR=$(DESTDIR) prefix=$(PREFIX) mandir=$(MANDIR) \
+               install install-doc
 
        mkdir -p $(DOC_DESTDIR)
        find $(DOC) '(' -name '*.txt' -o -name '*.html' ')' -exec install {} $(DOC_DESTDIR) ';'
@@ -65,33 +66,36 @@ install: build
        dh_movefiles -p git-core
        find debian/tmp -type d -o -print | sed -e 's/^/? /'
 
-binary: build install
+binary-arch: build install
        dh_testdir
        dh_testroot
-       dh_installchangelogs
-       dh_installdocs
-       dh_installexamples
-#      dh_installmenu
-#      dh_installdebconf       
-#      dh_installlogrotate     
-#      dh_installemacsen
-#      dh_installpam
-#      dh_installmime
-#      dh_installinit
-#      dh_installcron
-#      dh_installinfo
-       dh_installman
-       dh_link
-       dh_strip
-       dh_compress 
-       dh_fixperms
-#      dh_perl
-#      dh_python
-       dh_makeshlibs
-       dh_installdeb
-       dh_shlibdeps
-       dh_gencontrol
-       dh_md5sums
-       dh_builddeb
+       dh_installchangelogs -a
+       dh_installdocs -a
+       dh_strip -a
+       dh_compress  -a
+       dh_fixperms -a
+       dh_perl -a
+       dh_makeshlibs -a
+       dh_installdeb -a
+       dh_shlibdeps -a
+       dh_gencontrol -a
+       dh_md5sums -a
+       dh_builddeb -a
+
+binary-indep: build install
+       dh_testdir
+       dh_testroot
+       dh_installchangelogs -i
+       dh_installdocs -i
+       dh_compress  -i
+       dh_fixperms -i
+       dh_makeshlibs -i
+       dh_installdeb -i
+       dh_shlibdeps -i
+       dh_gencontrol -i
+       dh_md5sums -i
+       dh_builddeb -i
+
+binary: binary-arch binary-indep
 
 .PHONY: build clean binary install clean debian-clean
index 65e0076..582f967 100644 (file)
@@ -4,10 +4,13 @@
 #include <sys/wait.h>
 
 static int quiet;
-static const char fetch_pack_usage[] = "git-fetch-pack [-q] [--exec=upload-pack] [host:]directory [heads]* < mycommitlist";
+static int verbose;
+static const char fetch_pack_usage[] =
+"git-fetch-pack [-q] [-v] [--exec=upload-pack] [host:]directory <refs>...";
 static const char *exec = "git-upload-pack";
 
-static int find_common(int fd[2], unsigned char *result_sha1, unsigned char *remote)
+static int find_common(int fd[2], unsigned char *result_sha1,
+                      struct ref *refs)
 {
        static char line[1000];
        int count = 0, flushes = 0, retval;
@@ -16,7 +19,16 @@ static int find_common(int fd[2], unsigned char *result_sha1, unsigned char *rem
        revs = popen("git-rev-list $(git-rev-parse --all)", "r");
        if (!revs)
                die("unable to run 'git-rev-list'");
-       packet_write(fd[1], "want %s\n", sha1_to_hex(remote));
+
+       while (refs) {
+               unsigned char *remote = refs->old_sha1;
+               if (verbose)
+                       fprintf(stderr,
+                               "want %s (%s)\n", sha1_to_hex(remote),
+                               refs->name);
+               packet_write(fd[1], "want %s\n", sha1_to_hex(remote));
+               refs = refs->next;
+       }
        packet_flush(fd[1]);
        flushes = 1;
        retval = -1;
@@ -25,6 +37,8 @@ static int find_common(int fd[2], unsigned char *result_sha1, unsigned char *rem
                if (get_sha1_hex(line, sha1))
                        die("git-fetch-pack: expected object name, got crud");
                packet_write(fd[1], "have %s\n", sha1_to_hex(sha1));
+               if (verbose)
+                       fprintf(stderr, "have %s\n", sha1_to_hex(sha1));
                if (!(31 & ++count)) {
                        packet_flush(fd[1]);
                        flushes++;
@@ -38,6 +52,8 @@ static int find_common(int fd[2], unsigned char *result_sha1, unsigned char *rem
                        if (get_ack(fd[0], result_sha1)) {
                                flushes = 0;
                                retval = 0;
+                               if (verbose)
+                                       fprintf(stderr, "got ack\n");
                                break;
                        }
                        flushes--;
@@ -45,19 +61,19 @@ static int find_common(int fd[2], unsigned char *result_sha1, unsigned char *rem
        }
        pclose(revs);
        packet_write(fd[1], "done\n");
+       if (verbose)
+               fprintf(stderr, "done\n");
        while (flushes) {
                flushes--;
-               if (get_ack(fd[0], result_sha1))
+               if (get_ack(fd[0], result_sha1)) {
+                       if (verbose)
+                               fprintf(stderr, "got ack\n");
                        return 0;
+               }
        }
        return retval;
 }
 
-/*
- * Eventually we'll want to be able to fetch multiple heads.
- *
- * Right now we'll just require a single match.
- */
 static int fetch_pack(int fd[2], int nr_match, char **match)
 {
        struct ref *ref;
@@ -70,12 +86,8 @@ static int fetch_pack(int fd[2], int nr_match, char **match)
                packet_flush(fd[1]);
                die("no matching remote head");
        }
-       if (ref->next) {
-               packet_flush(fd[1]);
-               die("multiple remote heads");
-       }
-       if (find_common(fd, sha1, ref->old_sha1) < 0)
-               die("git-fetch-pack: no common commits");
+       if (find_common(fd, sha1, ref) < 0)
+               fprintf(stderr, "warning: no common commits\n");
        pid = fork();
        if (pid < 0)
                die("git-fetch-pack: unable to fork off git-unpack-objects");
@@ -97,7 +109,11 @@ static int fetch_pack(int fd[2], int nr_match, char **match)
                int code = WEXITSTATUS(status);
                if (code)
                        die("git-unpack-objects died with error code %d", code);
-               puts(sha1_to_hex(ref->old_sha1));
+               while (ref) {
+                       printf("%s %s\n",
+                              sha1_to_hex(ref->old_sha1), ref->name);
+                       ref = ref->next;
+               }
                return 0;
        }
        if (WIFSIGNALED(status)) {
@@ -124,6 +140,14 @@ int main(int argc, char **argv)
                                exec = arg + 7;
                                continue;
                        }
+                       if (!strcmp("-q", arg)) {
+                               quiet = 1;
+                               continue;
+                       }
+                       if (!strcmp("-v", arg)) {
+                               verbose = 1;
+                               continue;
+                       }
                        usage(fetch_pack_usage);
                }
                dest = arg;
index 8f079db..ef7cd26 100644 (file)
@@ -28,8 +28,8 @@ make prefix=%{_prefix} all %{!?_without_docs: doc}
 
 %install
 rm -rf $RPM_BUILD_ROOT
-make dest=$RPM_BUILD_ROOT prefix=%{_prefix} mandir=%{_mandir} \
-     install install-tools %{!?_without_docs: install-doc}
+make DESTDIR=$RPM_BUILD_ROOT prefix=%{_prefix} mandir=%{_mandir} \
+     install %{!?_without_docs: install-doc}
 
 %clean
 rm -rf $RPM_BUILD_ROOT
index 24f0a5e..ea09714 100755 (executable)
@@ -31,6 +31,10 @@ rsync://*)
        ;;
 *)
        head=$(git-fetch-pack "$merge_repo" "$merge_head")
+       if h=`expr "$head" : '\([^ ][^ ]*\) '`
+       then
+           head=$h
+       fi
        ;;
 esac || exit 1
 
index c008169..ebe6616 100755 (executable)
@@ -6,7 +6,7 @@
 . git-sh-setup-script || die "Not a git archive."
 
 usage () {
-    echo >&2 "usage: $0"' [-n] [-o dir] [--mbox] [--check] [-<diff options>...] upstream [ our-head ]
+    echo >&2 "usage: $0"' [-n] [-o dir] [--mbox] [--check] [--sign] [-<diff options>...] upstream [ our-head ]
 
 Prepare each commit with its patch since our-head forked from upstream,
 one file per patch, for e-mail submission.  Each output file is
@@ -46,6 +46,8 @@ do
     date=t author=t mbox=t ;;
     -n|--n|--nu|--num|--numb|--numbe|--number|--numbere|--numbered)
     numbered=t ;;
+    -s|--s|--si|--sig|--sign)
+    signoff=t ;;
     -o=*|--o=*|--ou=*|--out=*|--outp=*|--outpu=*|--output=*|--output-=*|\
     --output-d=*|--output-di=*|--output-dir=*|--output-dire=*|\
     --output-direc=*|--output-direct=*|--output-directo=*|\
@@ -174,6 +176,14 @@ Date: '"$ad"
        b body'
 
        sed -ne "$mailScript" <$commsg
+
+       test "$signoff" = "t" && {
+               offsigner=`git-var GIT_COMMITTER_IDENT | sed -e 's/>.*/>/'`
+               echo
+               echo "Signed-off-by: $offsigner"
+               echo
+       }
+
        echo '---'
        echo
        git-diff-tree -p $diff_opts "$commit" | git-apply --stat --summary
index 6b2a900..776e6c8 100644 (file)
@@ -3,7 +3,7 @@
 INSTALL=install
 prefix=$(HOME)
 template_dir=$(prefix)/share/git-core/templates/
-# dest=
+# DESTDIR=
 
 all: boilerplates custom
        find blt
@@ -34,5 +34,5 @@ clean:
        rm -rf blt
 
 install: all
-       $(INSTALL) -d -m755 $(dest)$(template_dir)
-       tar Ccf blt - . | tar Cxf $(dest)$(template_dir) -
+       $(INSTALL) -d -m755 $(DESTDIR)$(template_dir)
+       tar Ccf blt - . | tar Cxf $(DESTDIR)$(template_dir) -
index e423af9..779177c 100644 (file)
@@ -2,25 +2,24 @@
 # Make Linus git-tools
 #
 CC=gcc
-COPTS=-O2
-CFLAGS=-g $(COPTS) -Wall
+CFLAGS = -O2 -g -Wall
+ALL_CFLAGS = $(CFLAGS)
 INSTALL=install
-HOME=$(shell echo $$HOME)
 prefix=$(HOME)
 bindir=$(prefix)/bin
-# dest=
+# DESTDIR=
 
 PROGRAMS=git-mailsplit git-mailinfo
 SCRIPTS=git-applymbox git-applypatch
 
 git-%: %.c
-       $(CC) $(CFLAGS) -o $@ $(filter %.c,$^)
+       $(CC) $(ALL_CFLAGS) -o $@ $(filter %.c,$^)
 
 all: $(PROGRAMS)
 
 install: $(PROGRAMS) $(SCRIPTS)
        $(INSTALL) -m755 -d $(dest)$(bindir)
-       $(INSTALL) $(PROGRAMS) $(SCRIPTS) $(dest)$(bindir)
+       $(INSTALL) $(PROGRAMS) $(SCRIPTS) $(DESTDIR)$(bindir)
 
 clean:
        rm -f $(PROGRAMS) *.o
index 7e7be5c..8ae1a1c 100644 (file)
@@ -6,7 +6,7 @@
 #include <sys/time.h>
 
 static int dry_run, quiet;
-static const char unpack_usage[] = "git-unpack-objects < pack-file";
+static const char unpack_usage[] = "git-unpack-objects [-q] < pack-file";
 
 /* We always read in 4kB chunks. */
 static unsigned char buffer[4096];