diff --git a/Documentation/Makefile b/Documentation/Makefile index 4798933a49..c887ded6af 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -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 diff --git a/Documentation/git-fetch-pack.txt b/Documentation/git-fetch-pack.txt index 884a26bbf3..59afa14a30 100644 --- a/Documentation/git-fetch-pack.txt +++ b/Documentation/git-fetch-pack.txt @@ -9,19 +9,19 @@ git-fetch-pack - Receive missing objects from another repository. SYNOPSIS -------- -git-fetch-pack [-q] [--exec=] [:] [...] < +git-fetch-pack [-q] [--exec=] [:] [...] 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 :: The repository to sync from. -...:: +...:: 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 ------ diff --git a/Documentation/git-unpack-objects.txt b/Documentation/git-unpack-objects.txt index a12b8438bf..a42a75e077 100644 --- a/Documentation/git-unpack-objects.txt +++ b/Documentation/git-unpack-objects.txt @@ -9,7 +9,7 @@ git-unpack-objects - Unpack objects from a packed archive. SYNOPSIS -------- -'git-unpack-objects' < pack-file +'git-unpack-objects' [-q] -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= + 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 diff --git a/debian/changelog b/debian/changelog index 28cfb0f84f..da7526e2cb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,12 @@ git-core (0.99.5-0) unstable; urgency=low -- Junio C Hamano 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 Fri, 12 Aug 2005 13:25:00 -0700 + git-core (0.99.4-3) unstable; urgency=low * Split off gitk. diff --git a/debian/control b/debian/control index 53b87f44a6..5df89dde32 100644 --- a/debian/control +++ b/debian/control @@ -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. diff --git a/debian/rules b/debian/rules index 921aeecfb4..c46b4d9466 100755 --- a/debian/rules +++ b/debian/rules @@ -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 diff --git a/fetch-pack.c b/fetch-pack.c index 65e007639a..582f967a7a 100644 --- a/fetch-pack.c +++ b/fetch-pack.c @@ -4,10 +4,13 @@ #include 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 ..."; 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; diff --git a/git-core.spec.in b/git-core.spec.in index 8f079dbb59..ef7cd26b96 100644 --- a/git-core.spec.in +++ b/git-core.spec.in @@ -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 diff --git a/git-fetch-script b/git-fetch-script index 24f0a5ec82..ea097144f7 100755 --- a/git-fetch-script +++ b/git-fetch-script @@ -31,6 +31,10 @@ rsync://*) ;; *) head=$(git-fetch-pack "$merge_repo" "$merge_head") + if h=`expr "$head" : '\([^ ][^ ]*\) '` + then + head=$h + fi ;; esac || exit 1 diff --git a/git-format-patch-script b/git-format-patch-script index c0081697da..ebe6616494 100755 --- a/git-format-patch-script +++ b/git-format-patch-script @@ -6,7 +6,7 @@ . git-sh-setup-script || die "Not a git archive." usage () { - echo >&2 "usage: $0"' [-n] [-o dir] [--mbox] [--check] [-...] upstream [ our-head ] + echo >&2 "usage: $0"' [-n] [-o dir] [--mbox] [--check] [--sign] [-...] 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 diff --git a/templates/Makefile b/templates/Makefile index 6b2a90071b..776e6c8009 100644 --- a/templates/Makefile +++ b/templates/Makefile @@ -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) - diff --git a/tools/Makefile b/tools/Makefile index e423af9593..779177c5a9 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -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 diff --git a/unpack-objects.c b/unpack-objects.c index 7e7be5cbd4..8ae1a1c0fd 100644 --- a/unpack-objects.c +++ b/unpack-objects.c @@ -6,7 +6,7 @@ #include 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];