From e1e9c254660244756a72ecfcfff81c15fb32a6e9 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sat, 8 Oct 2005 14:54:41 -0700 Subject: Give proper prototype to gitstrcasestr. Borrow from NO_MMAP patch by Johannes, squelch compiler warnings by declaring gitstrcasestr() when we use it. Signed-off-by: Junio C Hamano --- Makefile | 2 +- mailinfo.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 92f0bda5e..b8ca504f0 100644 --- a/Makefile +++ b/Makefile @@ -246,7 +246,7 @@ ifdef NEEDS_NSL SIMPLE_LIB += -lnsl endif ifdef NO_STRCASESTR - DEFINES += -Dstrcasestr=gitstrcasestr + DEFINES += -Dstrcasestr=gitstrcasestr -DNO_STRCASESTR=1 LIB_OBJS += compat/strcasestr.o endif diff --git a/mailinfo.c b/mailinfo.c index df470bb9c..cb853df99 100644 --- a/mailinfo.c +++ b/mailinfo.c @@ -9,6 +9,10 @@ #include #include +#ifdef NO_STRCASESTR +extern char *gitstrcasestr(const char *haystack, const char *needle); +#endif + static FILE *cmitmsg, *patchfile; static int keep_subject = 0; -- cgit v1.2.1 From 8c51242873d63cfaf87fa2e2e407198a6ad2c3d0 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sat, 8 Oct 2005 18:01:24 -0700 Subject: Make sure 'make install' does not have to rebuild templates. The dependency rule in templates directory forced 'make install' that immediately followed 'make all' to rebuild boilerplates. This was problematic for a workflow that built first as yourself and then installed as root, from a working tree that is on an NFS mounted filesystem that is unwritable by root. Signed-off-by: Junio C Hamano --- templates/Makefile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/templates/Makefile b/templates/Makefile index 221a08606..c23aee866 100644 --- a/templates/Makefile +++ b/templates/Makefile @@ -6,13 +6,15 @@ prefix ?= $(HOME) template_dir ?= $(prefix)/share/git-core/templates/ # DESTDIR= -all: boilerplates custom +all: boilerplates.made custom find blt # Put templates that can be copied straight from the source # in a file direc--tory--file in the source. They will be # just copied to the destination. -boilerplates: + +bpsrc = $(filter-out %~,$(wildcard *--*)) +boilerplates.made : $(bpsrc) ls *--* 2>/dev/null | \ while read boilerplate; \ do \ @@ -25,6 +27,7 @@ boilerplates: *) cp $$boilerplate blt/$$dst ;; \ esac || exit; \ done || exit + date >$@ # If you need build-tailored templates, build them into blt/ # directory yourself here. @@ -32,7 +35,7 @@ custom: : no custom templates yet clean: - rm -rf blt + rm -rf blt boilerplates.made install: all $(INSTALL) -d -m755 $(DESTDIR)$(template_dir) -- cgit v1.2.1 From 5a6850e8aae7c6ef4f22e07cb620eb9325543732 Mon Sep 17 00:00:00 2001 From: Paolo 'Blaisorblade' Giarrusso Date: Sun, 9 Oct 2005 16:50:34 -0700 Subject: Fix git-verify-tag for light-weight tags It currently exits printing "git-cat-file SHA1: bad file", while instead we must just abort the verification for light-weight tags (e.g. referring to commit objects). [jc: tag objects can tag anything not just commits, so I fixed up the original patch slightly. you should be able to validate a signed tag that points at a blob object. ] Signed-off-by: Paolo 'Blaisorblade' Giarrusso Signed-off-by: Junio C Hamano --- git-verify-tag.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/git-verify-tag.sh b/git-verify-tag.sh index 156c75bb3..ed4c89396 100755 --- a/git-verify-tag.sh +++ b/git-verify-tag.sh @@ -1,8 +1,12 @@ #!/bin/sh . git-sh-setup || die "Not a git archive" -tag=$(git-rev-parse $1) || exit 1 +type="$(git-cat-file -t "$1" 2>/dev/null)" || + die "$1: no such object." -git-cat-file tag $tag > .tmp-vtag || exit 1 +test "$type" = tag || + die "$1: cannot verify a non-tag object of type $type." + +git-cat-file tag "$1" > .tmp-vtag || exit 1 cat .tmp-vtag | sed '/-----BEGIN PGP/Q' | gpg --verify .tmp-vtag - || exit 1 rm -f .tmp-vtag -- cgit v1.2.1 From 9fabdedc0edd4ff150197a53cc3032e7bf27c4d4 Mon Sep 17 00:00:00 2001 From: Kai Ruemmler Date: Sun, 9 Oct 2005 16:52:50 -0700 Subject: ignore new git-diff index header when computing patch ids Two else equal patches should not result in different checksums, only because they were applied to different versions of the file. Signed-off-by: Kai Ruemmler Signed-off-by: Junio C Hamano --- patch-id.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/patch-id.c b/patch-id.c index 5a8dc75d0..960e7cedf 100644 --- a/patch-id.c +++ b/patch-id.c @@ -55,6 +55,10 @@ static void generate_id_list(void) if (!patchlen && memcmp(line, "diff ", 5)) continue; + /* Ignore git-diff index header */ + if (!memcmp(line, "index ", 6)) + continue; + /* Ignore line numbers when computing the SHA1 of the patch */ if (!memcmp(line, "@@ -", 4)) continue; -- cgit v1.2.1 From fb8024b414b417d85ce215eba3dd23c188500c15 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sun, 9 Oct 2005 19:13:47 -0700 Subject: git-tag: update usage string and documentation. Signed-off-by: Junio C Hamano --- Documentation/git-tag.txt | 4 +--- git-tag.sh | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Documentation/git-tag.txt b/Documentation/git-tag.txt index 1e0d4f5f4..e11f51c26 100644 --- a/Documentation/git-tag.txt +++ b/Documentation/git-tag.txt @@ -1,16 +1,14 @@ git-tag(1) ========== -v0.99.4, Aug 2005 NAME ---- git-tag - Create a tag object signed with GPG - SYNOPSIS -------- -'git-tag' [-s | -a] [-f] +'git-tag' [-a | -s] [-f] [-m ] [] DESCRIPTION ----------- diff --git a/git-tag.sh b/git-tag.sh index 76c1bcd8c..400bdb984 100755 --- a/git-tag.sh +++ b/git-tag.sh @@ -4,7 +4,7 @@ . git-sh-setup || die "Not a git archive" usage () { - echo >&2 "Usage: git-tag [-a | -s] [-f] [-m "tag message"] tagname" + echo >&2 "Usage: git-tag [-a | -s] [-f] [-m "tag message"] tagname [head]" exit 1 } -- cgit v1.2.1