From 576cfc86fc321688aec0bc7359fb1097e5717631 Mon Sep 17 00:00:00 2001 From: Yann Dirson Date: Fri, 6 Jan 2006 21:54:41 +0100 Subject: [PATCH 01/11] Teach cvsexportcommit to add new files "cvs add" support was already there, but the "unknown" status returned when querying a file not yet known to cvs caused the script to abort prematurely. Signed-off-by: Junio C Hamano --- git-cvsexportcommit.perl | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl index 5a8c011802..d5fbee7ba0 100755 --- a/git-cvsexportcommit.perl +++ b/git-cvsexportcommit.perl @@ -103,8 +103,16 @@ undef @files; # don't need it anymore # check that the files are clean and up to date according to cvs my $dirty; -foreach my $f (@afiles, @mfiles, @dfiles) { - # TODO:we need to handle removed in cvs and/or new (from git) +foreach my $f (@afiles) { + my $status = `cvs -q status "$f" | grep '^File: '`; + + unless ($status =~ m/Status: Unknown$/) { + $dirty = 1; + warn "File $f is already known in your CVS checkout!\n"; + } +} +foreach my $f (@mfiles, @dfiles) { + # TODO:we need to handle removed in cvs my $status = `cvs -q status "$f" | grep '^File: '`; unless ($status =~ m/Status: Up-to-date$/) { From 34c99da2a4324e9b4a9d3f59e8cd7114090bd22a Mon Sep 17 00:00:00 2001 From: Joe English Date: Fri, 6 Jan 2006 12:52:27 -0800 Subject: [PATCH 02/11] Substitute "/" with $opt_s in tag names as well as branch names In 'git cvsimport' changes "/" to "-" (or $opt_s) in branch names, but not in tag names, which is inconsistent. Signed-off-by: Junio C Hamano --- git-cvsimport.perl | 1 + 1 file changed, 1 insertion(+) diff --git a/git-cvsimport.perl b/git-cvsimport.perl index 08a890c2bb..8619e7d183 100755 --- a/git-cvsimport.perl +++ b/git-cvsimport.perl @@ -649,6 +649,7 @@ my $commit = sub { my($xtag) = $tag; $xtag =~ s/\s+\*\*.*$//; # Remove stuff like ** INVALID ** and ** FUNKY ** $xtag =~ tr/_/\./ if ( $opt_u ); + $xtag =~ s/[\/]/$opt_s/g; my $pid = open2($in, $out, 'git-mktag'); print $out "object $cid\n". From 476e801111698ac5df6821f389c81abc017fc0c9 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 6 Jan 2006 18:53:16 -0800 Subject: [PATCH 03/11] unpack-objects: default to quiet if stderr is not a tty. This would help cron/at jobs that run send-pack to mirror repositories. Signed-off-by: Junio C Hamano --- unpack-objects.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/unpack-objects.c b/unpack-objects.c index 5c5cb12f6f..4b5b5cb3e2 100644 --- a/unpack-objects.c +++ b/unpack-objects.c @@ -269,6 +269,8 @@ int main(int argc, char **argv) setup_git_directory(); + quiet = !isatty(2); + for (i = 1 ; i < argc; i++) { const char *arg = argv[i]; From 7d0e65b892ff0adf2ba6626bbe7cdfc723a8b702 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 6 Jan 2006 19:18:12 -0800 Subject: [PATCH 04/11] Retire debian/ directory. The official maintainer is keeping up-to-date quite well, and now the older Debian is supported with backports.org, there is no reason for me to keep debian/ directory around here. I have not been building and publishing debs since 1.0.4 anyway. Signed-off-by: Junio C Hamano --- Makefile | 8 -- debian/.gitignore | 6 -- debian/changelog | 201 --------------------------------------- debian/compat | 1 - debian/control | 63 ------------ debian/copyright | 24 ----- debian/docs | 1 - debian/git-arch.files | 2 - debian/git-core.doc-base | 13 --- debian/git-core.files | 1 - debian/git-cvs.files | 2 - debian/git-doc.files | 4 - debian/git-email.files | 2 - debian/git-svn.files | 2 - debian/git-tk.files | 2 - debian/rules | 109 --------------------- 16 files changed, 441 deletions(-) delete mode 100644 debian/.gitignore delete mode 100644 debian/changelog delete mode 100644 debian/compat delete mode 100644 debian/control delete mode 100644 debian/copyright delete mode 100644 debian/docs delete mode 100644 debian/git-arch.files delete mode 100644 debian/git-core.doc-base delete mode 100644 debian/git-core.files delete mode 100644 debian/git-cvs.files delete mode 100644 debian/git-doc.files delete mode 100644 debian/git-email.files delete mode 100644 debian/git-svn.files delete mode 100644 debian/git-tk.files delete mode 100755 debian/rules diff --git a/Makefile b/Makefile index dde8f331d6..30479b4a19 100644 --- a/Makefile +++ b/Makefile @@ -489,12 +489,6 @@ dist: git.spec git-tar-tree rpm: dist $(RPMBUILD) -ta $(GIT_TARNAME).tar.gz -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: @@ -504,8 +498,6 @@ clean: rm -f *.spec *.pyc *.pyo */*.pyc */*.pyo rm -rf $(GIT_TARNAME) rm -f $(GIT_TARNAME).tar.gz git-core_$(GIT_VERSION)-*.tar.gz - rm -f git-core_$(GIT_VERSION)-*.dsc - rm -f git-*_$(GIT_VERSION)-*.deb $(MAKE) -C Documentation/ clean $(MAKE) -C templates clean $(MAKE) -C t/ clean diff --git a/debian/.gitignore b/debian/.gitignore deleted file mode 100644 index 335ce9c596..0000000000 --- a/debian/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -git-core -git-tk -*.debhelper -*.substvars -build-stamp -files diff --git a/debian/changelog b/debian/changelog deleted file mode 100644 index 4fa6c16e8e..0000000000 --- a/debian/changelog +++ /dev/null @@ -1,201 +0,0 @@ -git-core (1.0.0-0) unstable; urgency=low - - * GIT 1.0.0 - - -- Junio C Hamano Wed, 21 Dec 2005 00:01:00 -0800 - -git-core (0.99.9n-0) unstable; urgency=low - - * GIT 0.99.9n aka 1.0rc6 - - -- Junio C Hamano Wed, 14 Dec 2005 17:27:08 -0800 - -git-core (0.99.9m-0) unstable; urgency=low - - * GIT 0.99.9m aka 1.0rc5 - - -- Junio C Hamano Sun, 11 Dec 2005 16:48:06 -0800 - -git-core (0.99.9l-0) unstable; urgency=low - - * GIT 0.99.9l aka 1.0rc4 - - -- Junio C Hamano Sat, 3 Dec 2005 23:45:23 -0800 - -git-core (0.99.9k-0) unstable; urgency=low - - * GIT 0.99.9k but not 1.0rc yet. - - -- Junio C Hamano Fri, 25 Nov 2005 16:33:11 -0800 - -git-core (0.99.9j-0) unstable; urgency=low - - * GIT 0.99.9j aka 1.0rc3 - - -- Junio C Hamano Wed, 16 Nov 2005 20:39:55 -0800 - -git-core (0.99.9i-0) unstable; urgency=low - - * GIT 0.99.9i aka 1.0rc2 - - -- Junio C Hamano Mon, 14 Nov 2005 18:38:27 -0800 - -git-core (0.99.9h-0) unstable; urgency=low - - * GIT 0.99.9h - - -- Junio C Hamano Fri, 11 Nov 2005 22:33:18 -0800 - -git-core (0.99.9g-0) unstable; urgency=low - - * GIT 0.99.9g - - -- Junio C Hamano Wed, 9 Nov 2005 21:01:55 -0800 - -git-core (0.99.9f-0) unstable; urgency=low - - * GIT 0.99.9f - - -- Junio C Hamano Tue, 8 Nov 2005 01:21:52 -0800 - -git-core (0.99.9e-0) unstable; urgency=low - - * GIT 0.99.9e - - -- Junio C Hamano Sun, 6 Nov 2005 18:37:18 -0800 - -git-core (0.99.9d-0) unstable; urgency=low - - * GIT 0.99.9d - - -- Junio C Hamano Sat, 5 Nov 2005 11:46:37 -0800 - -git-core (0.99.9c-0) unstable; urgency=low - - * GIT 0.99.9c - - -- Junio C Hamano Thu, 3 Nov 2005 15:44:54 -0800 - -git-core (0.99.9b-0) unstable; urgency=low - - * GIT 0.99.9b - - -- Junio C Hamano Tue, 1 Nov 2005 21:39:39 -0800 - -git-core (0.99.9a-0) unstable; urgency=low - - * GIT 0.99.9a - - -- Junio C Hamano Sun, 30 Oct 2005 15:03:32 -0800 - -git-core (0.99.9.GIT-2) unstable; urgency=low - - * Build Dependency did not include libexpat-dev. - - -- Junio C Hamano Sun, 13 Nov 2005 01:55:34 -0800 - -git-core (0.99.9.GIT-1) unstable; urgency=low - - * Do not scatter txt and html documentation into feature - subpackages. Do place man pages into them. - * Capture more cvs stuff into git-cvs package. - - -- Junio C Hamano Tue, 8 Nov 2005 01:19:06 -0800 - -git-core (0.99.9.GIT-0) unstable; urgency=low - - * Test Build. - - -- Junio C Hamano Sat, 5 Nov 2005 11:18:13 -0800 - -git-core (0.99.9-1) unstable; urgency=low - - * Split the git-core binary package into core, doc, and foreign SCM - interoperability modules. - - -- Junio C Hamano Sat, 5 Nov 2005 11:18:13 -0800 - -git-core (0.99.9-0) unstable; urgency=low - - * GIT 0.99.9 - - -- Junio C Hamano Sat, 29 Oct 2005 14:34:30 -0700 - -git-core (0.99.8-0) unstable; urgency=low - - * GIT 0.99.8 - - -- Junio C Hamano Sun, 2 Oct 2005 12:54:26 -0700 - -git-core (0.99.7-0) unstable; urgency=low - - * GIT 0.99.7 - - -- Junio C Hamano Sat, 10 Sep 2005 18:36:39 -0700 - -git-core (0.99.6-0) unstable; urgency=low - - * GIT 0.99.6 - - -- Junio C Hamano Wed, 24 Aug 2005 23:09:35 -0700 - -git-core (0.99.5-1) unstable; urgency=low - - * Enable git-send-email on Debian. There is no reason to shy - away from it, since we have the necessary Perl modules available. - - -- Junio C Hamano Thu, 25 Aug 2005 14:16:59 -0700 - -git-core (0.99.5-0) unstable; urgency=low - - * GIT 0.99.5 - - -- 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. - * Do not depend on diff which is an essential package. - * Use dh_movefiles, not dh_install, to stage two subpackages. - - -- Matthias Urlichs Thu, 11 Aug 2005 01:43:24 +0200 - -git-core (0.99.4-2) unstable; urgency=low - - * Git 0.99.4 official release. - - -- Junio C Hamano Wed, 10 Aug 2005 15:00:00 -0700 - -git-core (0.99.4-1) unstable; urgency=low - - * Pass prefix down to the submake when building. - - -- Junio C Hamano Sat, 6 Aug 2005 13:00:00 -0700 - -git-core (0.99-2) unstable; urgency=low - - * Conflict with the GNU Interactive Tools package, which also installs - /usr/bin/git. - * Use the Mozilla SHA1 code and/or the PPC assembly in preference to - OpenSSL. This is only a partial fix for the license issues with OpenSSL. - * Minor tweaks to the Depends. - - -- Ryan Anderson Sat, 23 Jul 2005 14:15:00 -0400 - -git-core (0.99-1) unstable; urgency=low - - * Update deb package support to build correctly. - - -- Ryan Anderson Thu, 21 Jul 2005 02:03:32 -0400 - -git-core (0.99-0) unstable; urgency=low - - * Initial deb package support - - -- Eric Biederman Tue, 12 Jul 2005 10:57:51 -0600 diff --git a/debian/compat b/debian/compat deleted file mode 100644 index b8626c4cff..0000000000 --- a/debian/compat +++ /dev/null @@ -1 +0,0 @@ -4 diff --git a/debian/control b/debian/control deleted file mode 100644 index ded0a576d6..0000000000 --- a/debian/control +++ /dev/null @@ -1,63 +0,0 @@ -Source: git-core -Section: devel -Priority: optional -Maintainer: Junio C Hamano -Build-Depends-Indep: libz-dev, libssl-dev, libcurl3-dev|libcurl3-gnutls-dev|libcurl3-openssl-dev, asciidoc (>= 7), xmlto, debhelper (>= 4.0.0), bc, libexpat-dev -Standards-Version: 3.6.1 - -Package: git-core -Architecture: any -Depends: ${shlibs:Depends}, ${perl:Depends}, ${misc:Depends}, rcs -Recommends: rsync, curl, ssh, python (>= 2.4.0), less -Suggests: cogito, patch -Conflicts: git, cogito (<< 0.13) -Description: The git content addressable filesystem - GIT comes in two layers. The bottom layer is merely an extremely fast - and flexible filesystem-based database designed to store directory trees - with regard to their history. The top layer is a SCM-like tool which - enables human beings to work with the database in a manner to a degree - similar to other SCM tools. - -Package: git-doc -Architecture: all -Depends: ${shlibs:Depends}, ${misc:Depends}, git-core -Description: The git content addressable filesystem, Documentation - This package contains documentation for GIT. - -Package: git-tk -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. - -Package: git-svn -Architecture: all -Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, git-core, libsvn-core-perl (>= 1.2.1) -Suggests: subversion -Description: The git content addressable filesystem, SVN interoperability - This package contains 'git-svnimport', to import development history from - SVN repositories. - -Package: git-arch -Architecture: all -Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, git-core -Suggests: tla, bazaar -Description: The git content addressable filesystem, GNUArch interoperability - This package contains 'git-archimport', to import development history from - GNUArch repositories. - -Package: git-cvs -Architecture: all -Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, git-core, cvsps (>= 2.1) -Suggests: cvs -Description: The git content addressable filesystem, CVS interoperability - This package contains 'git-cvsimport', to import development history from - CVS repositories. - -Package: git-email -Architecture: all -Depends: ${shlibs:Depends}, ${misc:Depends}, git-core, libmail-sendmail-perl, libemail-valid-perl -Description: The git content addressable filesystem, e-mail add-on - This package contains 'git-send-email', to send a series of patch e-mails. - - diff --git a/debian/copyright b/debian/copyright deleted file mode 100644 index ea61effc40..0000000000 --- a/debian/copyright +++ /dev/null @@ -1,24 +0,0 @@ -This package was downloaded from ftp.kernel.org:/pub/software/scm/git/. - -Upstream Author: Linus Torvalds and many others - -Copyright: - - Copyright 2005, Linus Torvalds and others. - - This package is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 dated June, 1991. - - This package is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this package; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. - -On Debian GNU/Linux systems, the complete text of the GNU General -Public License can be found in `/usr/share/common-licenses/GPL'. diff --git a/debian/docs b/debian/docs deleted file mode 100644 index e845566c06..0000000000 --- a/debian/docs +++ /dev/null @@ -1 +0,0 @@ -README diff --git a/debian/git-arch.files b/debian/git-arch.files deleted file mode 100644 index d7449540cb..0000000000 --- a/debian/git-arch.files +++ /dev/null @@ -1,2 +0,0 @@ -/usr/bin/git-arch* -/usr/share/man/*/git-arch* diff --git a/debian/git-core.doc-base b/debian/git-core.doc-base deleted file mode 100644 index eff1a9523e..0000000000 --- a/debian/git-core.doc-base +++ /dev/null @@ -1,13 +0,0 @@ -Document: git-core -Title: git reference -Abstract: This manual describes git -Section: Devel - -Format: HTML -Index: /usr/share/doc/git-core/git.html -Files: /usr/share/doc/git-core/*.html - /usr/share/doc/git-core/*/*.html - -Format: text -Files: /usr/share/doc/git-core/*.txt - /usr/share/doc/git-core/*/*.txt diff --git a/debian/git-core.files b/debian/git-core.files deleted file mode 100644 index 74e4e23b01..0000000000 --- a/debian/git-core.files +++ /dev/null @@ -1 +0,0 @@ -/usr diff --git a/debian/git-cvs.files b/debian/git-cvs.files deleted file mode 100644 index a6b40ff9ea..0000000000 --- a/debian/git-cvs.files +++ /dev/null @@ -1,2 +0,0 @@ -/usr/bin/git-cvs* -/usr/share/man/*/git-cvs* diff --git a/debian/git-doc.files b/debian/git-doc.files deleted file mode 100644 index 0daf545ad5..0000000000 --- a/debian/git-doc.files +++ /dev/null @@ -1,4 +0,0 @@ -/usr/share/doc/git-core/*.txt -/usr/share/doc/git-core/*.html -/usr/share/doc/git-core/*/*.html -/usr/share/doc/git-core/*/*.txt diff --git a/debian/git-email.files b/debian/git-email.files deleted file mode 100644 index 2d6a51fc33..0000000000 --- a/debian/git-email.files +++ /dev/null @@ -1,2 +0,0 @@ -/usr/bin/git-send-email -/usr/share/man/*/git-send-email.* diff --git a/debian/git-svn.files b/debian/git-svn.files deleted file mode 100644 index eea8d83f62..0000000000 --- a/debian/git-svn.files +++ /dev/null @@ -1,2 +0,0 @@ -/usr/bin/git-svn* -/usr/share/man/*/git-svn* diff --git a/debian/git-tk.files b/debian/git-tk.files deleted file mode 100644 index 478ec94404..0000000000 --- a/debian/git-tk.files +++ /dev/null @@ -1,2 +0,0 @@ -/usr/bin/gitk -/usr/share/man/man1/gitk.* diff --git a/debian/rules b/debian/rules deleted file mode 100755 index 4ab221ce9e..0000000000 --- a/debian/rules +++ /dev/null @@ -1,109 +0,0 @@ -#!/usr/bin/make -f -# -*- makefile -*- - -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - -CFLAGS = -g -Wall -ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) - CFLAGS += -O0 -else - CFLAGS += -O2 -endif -export CFLAGS - -# -# On PowerPC we compile against the hand-crafted assembly, on all -# other architectures we compile against GPL'ed sha1 code lifted -# from Mozilla. OpenSSL is strangely licensed and best avoided -# in Debian. -# -HOST_ARCH=$(shell dpkg-architecture -qDEB_HOST_ARCH) -ifeq (${HOST_ARCH},powerpc) - export PPC_SHA1=YesPlease -else - export MOZILLA_SHA1=YesPlease -endif - -# We do have the requisite perl modules in the mainline, and -# have no reason to shy away from this script. -export WITH_SEND_EMAIL=YesPlease - -PREFIX := /usr -MANDIR := /usr/share/man/ - -SRC := ./ -DOC := Documentation/ -DESTDIR := $(CURDIR)/debian/tmp -DOC_DESTDIR := $(DESTDIR)/usr/share/doc/git-core/ -MAN_DESTDIR := $(DESTDIR)/$(MANDIR) - -build: debian/build-stamp -debian/build-stamp: - dh_testdir - $(MAKE) prefix=$(PREFIX) PYTHON_PATH=/usr/bin/python2.4 all test doc - touch debian/build-stamp - -debian-clean: - dh_testdir - dh_testroot - rm -f debian/build-stamp - dh_clean - -clean: debian-clean - $(MAKE) clean - -install: build - dh_testdir - dh_testroot - dh_clean -k - dh_installdirs - - make DESTDIR=$(DESTDIR) prefix=$(PREFIX) mandir=$(MANDIR) \ - install install-doc - - make -C Documentation DESTDIR=$(DESTDIR) prefix=$(PREFIX) \ - WEBDOC_DEST=$(DOC_DESTDIR) install-webdoc - - dh_movefiles -p git-arch - dh_movefiles -p git-cvs - dh_movefiles -p git-svn - dh_movefiles -p git-tk - dh_movefiles -p git-email - dh_movefiles -p git-doc - dh_movefiles -p git-core - find debian/tmp -type d -o -print | sed -e 's/^/? /' - -binary-arch: build install - dh_testdir - dh_testroot - 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 From 3be7098ce444395959c856de1eb9312550193aac Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sat, 7 Jan 2006 00:29:48 -0800 Subject: [PATCH 05/11] prune: do not show error from pack-redundant when no packs are found. When there is no pack yet, git-prune leaked an error message from "git-pack-redundant --all" which complained that there is no pack. Squelch the annoying message. Signed-off-by: Junio C Hamano --- git-prune.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/git-prune.sh b/git-prune.sh index 7b61d05c4b..c5a5d29aaa 100755 --- a/git-prune.sh +++ b/git-prune.sh @@ -33,8 +33,7 @@ sed -ne '/unreachable /{ git-prune-packed $dryrun -redundant=$(git-pack-redundant --all) -if test "" != "$redundant" +if redundant=$(git-pack-redundant --all 2>/dev/null) && test "" != "$redundant" then if test "" = "$dryrun" then From 8f1d2e6f49ee51ac062ab38337a6a70dd1998def Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sat, 7 Jan 2006 01:33:54 -0800 Subject: [PATCH 06/11] [PATCH] Compilation: zero-length array declaration. ISO C99 (and GCC 3.x or later) lets you write a flexible array at the end of a structure, like this: struct frotz { int xyzzy; char nitfol[]; /* more */ }; GCC 2.95 and 2.96 let you to do this with "char nitfol[0]"; unfortunately this is not allowed by ISO C90. This declares such construct like this: struct frotz { int xyzzy; char nitfol[FLEX_ARRAY]; /* more */ }; and git-compat-util.h defines FLEX_ARRAY to 0 for gcc 2.95 and empty for others. If you are using a C90 C compiler, you should be able to override this with CFLAGS=-DFLEX_ARRAY=1 from the command line of "make". Signed-off-by: Junio C Hamano --- blob.c | 2 +- cache.h | 9 +++++---- commit.c | 2 +- git-compat-util.h | 8 ++++++++ ls-files.c | 2 +- object.c | 2 +- object.h | 2 +- receive-pack.c | 2 +- tag.c | 2 +- tree.c | 2 +- 10 files changed, 21 insertions(+), 12 deletions(-) diff --git a/blob.c b/blob.c index ea52ad5c9d..84ec1212e7 100644 --- a/blob.c +++ b/blob.c @@ -1,5 +1,5 @@ -#include "blob.h" #include "cache.h" +#include "blob.h" #include const char *blob_type = "blob"; diff --git a/cache.h b/cache.h index cb87becb3a..5fd2687636 100644 --- a/cache.h +++ b/cache.h @@ -81,7 +81,7 @@ struct cache_entry { unsigned int ce_size; unsigned char sha1[20]; unsigned short ce_flags; - char name[0]; + char name[FLEX_ARRAY]; /* more */ }; #define CE_NAMEMASK (0x0fff) @@ -257,7 +257,7 @@ extern int checkout_entry(struct cache_entry *ce, struct checkout *state); extern struct alternate_object_database { struct alternate_object_database *next; char *name; - char base[0]; /* more */ + char base[FLEX_ARRAY]; /* more */ } *alt_odb_list; extern void prepare_alt_odb(void); @@ -271,7 +271,8 @@ extern struct packed_git { unsigned int pack_use_cnt; int pack_local; unsigned char sha1[20]; - char pack_name[0]; /* something like ".git/objects/pack/xxxxx.pack" */ + /* something like ".git/objects/pack/xxxxx.pack" */ + char pack_name[FLEX_ARRAY]; /* more */ } *packed_git; struct pack_entry { @@ -286,7 +287,7 @@ struct ref { unsigned char new_sha1[20]; unsigned char force; struct ref *peer_ref; /* when renaming */ - char name[0]; + char name[FLEX_ARRAY]; /* more */ }; extern int git_connect(int fd[2], char *url, const char *prog); diff --git a/commit.c b/commit.c index edd4dedcdd..fb02ba609b 100644 --- a/commit.c +++ b/commit.c @@ -1,6 +1,6 @@ +#include "cache.h" #include "tag.h" #include "commit.h" -#include "cache.h" int save_commit_buffer = 1; diff --git a/git-compat-util.h b/git-compat-util.h index c353b276f0..12ce6590bb 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -1,6 +1,14 @@ #ifndef GIT_COMPAT_UTIL_H #define GIT_COMPAT_UTIL_H +#ifndef FLEX_ARRAY +#if defined(__GNUC__) && (__GNUC__ < 3) +#define FLEX_ARRAY 0 +#else +#define FLEX_ARRAY /* empty */ +#endif +#endif + #include #include #include diff --git a/ls-files.c b/ls-files.c index cd87430127..74ec8c0aee 100644 --- a/ls-files.c +++ b/ls-files.c @@ -208,7 +208,7 @@ static int excluded(const char *pathname) struct nond_on_fs { int len; - char name[0]; + char name[FLEX_ARRAY]; /* more */ }; static struct nond_on_fs **dir; diff --git a/object.c b/object.c index cf5931a942..1577f74281 100644 --- a/object.c +++ b/object.c @@ -1,8 +1,8 @@ +#include "cache.h" #include "object.h" #include "blob.h" #include "tree.h" #include "commit.h" -#include "cache.h" #include "tag.h" struct object **objs; diff --git a/object.h b/object.h index 336d986b51..0e7618283c 100644 --- a/object.h +++ b/object.h @@ -9,7 +9,7 @@ struct object_list { struct object_refs { unsigned count; - struct object *ref[0]; + struct object *ref[FLEX_ARRAY]; /* more */ }; struct object { diff --git a/receive-pack.c b/receive-pack.c index 92878ecac3..ce986fe11c 100644 --- a/receive-pack.c +++ b/receive-pack.c @@ -24,7 +24,7 @@ struct command { unsigned char updated; unsigned char old_sha1[20]; unsigned char new_sha1[20]; - char ref_name[0]; + char ref_name[FLEX_ARRAY]; /* more */ }; static struct command *commands = NULL; diff --git a/tag.c b/tag.c index 61ac434d6b..ac0e57398a 100644 --- a/tag.c +++ b/tag.c @@ -1,5 +1,5 @@ -#include "tag.h" #include "cache.h" +#include "tag.h" const char *tag_type = "tag"; diff --git a/tree.c b/tree.c index e7a7b7190c..dc1c41e938 100644 --- a/tree.c +++ b/tree.c @@ -1,8 +1,8 @@ +#include "cache.h" #include "tree.h" #include "blob.h" #include "commit.h" #include "tag.h" -#include "cache.h" #include const char *tree_type = "tree"; From 3ac0ebbba4d2d47ca2f4a674afead830f76ca256 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sat, 7 Jan 2006 15:11:11 -0800 Subject: [PATCH 07/11] tar-tree: finish honoring extractor's umask in git-tar-tree. Earlier commit 38ec15a973a1f075f0d94d130b0ef279562921cd forgot to apply the same principle of not forcing go-w to the base directory when specified. Signed-off-by: Junio C Hamano --- tar-tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tar-tree.c b/tar-tree.c index 96bd1438d9..f749d4b869 100644 --- a/tar-tree.c +++ b/tar-tree.c @@ -433,7 +433,7 @@ int main(int argc, char **argv) archive_time = time(NULL); if (basedir) write_header((unsigned char *)"0", TYPEFLAG_DIR, NULL, NULL, - basedir, 040755, NULL, 0); + basedir, 040777, NULL, 0); traverse_tree(buffer, size, NULL); free(buffer); write_trailer(); From 36071af305d1491087661b8ad60ef57bf4d19394 Mon Sep 17 00:00:00 2001 From: Yann Dirson Date: Sun, 8 Jan 2006 01:38:43 +0100 Subject: [PATCH 08/11] Fix typo in debug stanza of t2001 Signed-off-by: Yann Dirson Signed-off-by: Junio C Hamano --- t/t2001-checkout-cache-clash.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t2001-checkout-cache-clash.sh b/t/t2001-checkout-cache-clash.sh index b1c5263a91..0dcab8f1de 100755 --- a/t/t2001-checkout-cache-clash.sh +++ b/t/t2001-checkout-cache-clash.sh @@ -74,7 +74,7 @@ test_debug 'show_files $tree3' test_expect_success \ 'read previously written tree and checkout.' \ 'git-read-tree $tree2 && git-checkout-index -f -a' -test_debug show_files $tree2 +test_debug 'show_files $tree2' test_expect_success \ 'checking out conflicting path with -f' \ From 5f815e5922eb31c5826e5f5f21e83d1f6f338ed1 Mon Sep 17 00:00:00 2001 From: Yann Dirson Date: Sun, 8 Jan 2006 01:39:16 +0100 Subject: [PATCH 09/11] Fix git-format-patch usage string wrt output modes. --stdout was not mentionned, and the description for the case where -o was not given was thus incomplete. Signed-off-by: Yann Dirson Signed-off-by: Junio C Hamano --- git-format-patch.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/git-format-patch.sh b/git-format-patch.sh index 818059f242..d3979d7631 100755 --- a/git-format-patch.sh +++ b/git-format-patch.sh @@ -9,8 +9,10 @@ one file per patch, for e-mail submission. Each output file is numbered sequentially from 1, and uses the first line of the commit message (massaged for pathname safety) as the filename. -When -o is specified, output files are created in that directory; otherwise in -the current working directory. +There are three output modes. By default, output files are created in +the current working directory; when -o is specified, they are created +in that directory instead; when --stdout is specified, they are spit +on standard output, and can be piped to git-am. When -n is specified, instead of "[PATCH] Subject", the first line is formatted as "[PATCH N/M] Subject", unless you have only one patch. From 013049c985e4095106e545559c17bc594d56468d Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sat, 7 Jan 2006 20:45:11 -0800 Subject: [PATCH 10/11] revert/cherry-pick: handle single quote in author name. The same fix as aa66c7ec77d474b737da607d6cb2d07f56628def is needed here. Signed-off-by: Junio C Hamano --- git-revert.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/git-revert.sh b/git-revert.sh index 63d201be1b..2c5870684c 100755 --- a/git-revert.sh +++ b/git-revert.sh @@ -93,6 +93,7 @@ revert) cherry-pick) pick_author_script=' /^author /{ + s/'\''/'\''\\'\'\''/g h s/^author \([^<]*\) <[^>]*> .*$/\1/ s/'\''/'\''\'\'\''/g From 6f2eacfeb2c67a7e05f98df2288d7893d3368c8e Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sat, 7 Jan 2006 21:26:30 -0800 Subject: [PATCH 11/11] mailsplit: allow empty input from stdin Signed-off-by: Junio C Hamano --- mailsplit.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mailsplit.c b/mailsplit.c index eb58b1ebe4..14c1358734 100644 --- a/mailsplit.c +++ b/mailsplit.c @@ -169,8 +169,11 @@ int main(int argc, const char **argv) if ( !f ) die ("cannot open mbox %s", file); - if (fgets(buf, sizeof(buf), f) == NULL) + if (fgets(buf, sizeof(buf), f) == NULL) { + if (f == stdin) + break; /* empty stdin is OK */ die("cannot read mbox %s", file); + } while (!file_done) { sprintf(name, "%s/%0*d", dir, nr_prec, ++nr);