From f1d090e13a46d30a14089de0575dbb2fc44a583a Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 19 Aug 2005 02:06:52 -0700 Subject: [PATCH 1/3] Fix __attribute__ changes. It cannot be checked with #ifndef, if you really think about what it does which cannot be done only with the preprocessor. My thinko. Signed-off-by: Junio C Hamano --- cache.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cache.h b/cache.h index 996466795f..ba5c4ab7ee 100644 --- a/cache.h +++ b/cache.h @@ -38,11 +38,10 @@ #define NORETURN __attribute__((__noreturn__)) #else #define NORETURN -#endif - #ifndef __attribute__ #define __attribute__(x) #endif +#endif /* * Intensive research over the course of many years has shown that From cc5625a5e2e10a94560347333c43b7032c2566f3 Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Fri, 19 Aug 2005 12:35:03 +0200 Subject: [PATCH 2/3] [PATCH] Fix git-format-patch-script to handle empty messages In case of a commit with an empty message there is no mandatory empty line between headers and body [jc: This makes --mbox output valid even when the commit message does not have anything but its first line, which the one I wrote botched. One side-effect is that it adds an extra blank line at the end even if it has more than one lines, which will be eaten by the receiving end. As Marco says, this is a stop-gap measure. This script needs to be split into two, one that gets the format specifier and a commit ID to write to its standard output, and another that drives that one reading from rev-list. I'll fix things properly when that happens by rewriting the former part in Perl or something more reasonable than the current shell, sed and grep mishmash.] Signed-off-by: Marco Costalba Signed-off-by: Junio C Hamano --- git-format-patch-script | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-format-patch-script b/git-format-patch-script index 3565205426..9b13b8858b 100755 --- a/git-format-patch-script +++ b/git-format-patch-script @@ -195,7 +195,7 @@ Date: '"$ad" echo } } - + echo echo '---' echo git-diff-tree -p $diff_opts "$commit" | git-apply --stat --summary From 7f1335c74c4ba0baac8649974e95f6e6f84f8632 Mon Sep 17 00:00:00 2001 From: Sergey Vlasov Date: Fri, 19 Aug 2005 22:28:35 +0400 Subject: [PATCH 3/3] [PATCH] git-rev-list: avoid crash on broken repository When following tags, check for parse_object() success and error out properly instead of segfaulting. Signed-off-by: Sergey Vlasov Signed-off-by: Junio C Hamano --- rev-list.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rev-list.c b/rev-list.c index ce5b8b2ad5..2ed5e87e12 100644 --- a/rev-list.c +++ b/rev-list.c @@ -418,6 +418,8 @@ static struct commit *get_commit_reference(const char *name, unsigned int flags) if (tag_objects && !(object->flags & UNINTERESTING)) add_pending_object(object, tag->tag); object = parse_object(tag->tagged->sha1); + if (!object) + die("bad object %s", sha1_to_hex(tag->tagged->sha1)); } /*