Git development
 help / color / mirror / Atom feed
* [PATCH] git-rev-list: fix --header
@ 2006-04-17 12:51 Johannes Schindelin
  2006-04-17 19:36 ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Johannes Schindelin @ 2006-04-17 12:51 UTC (permalink / raw)
  To: git, junkio


gitk expects raw verbose headers limited by \0. Meet these expectations.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>

---

	This fixes the "clock format" bug I mentioned in another thread: 
	git-rev-list printed non-raw headers (lacking "author", 
	"committer", and the other lines), and thus, the author date was
	empty.

 rev-list.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

18f897509cd95b7e55c63e75fa40655c532507f6
diff --git a/rev-list.c b/rev-list.c
index 9d8db25..54e92f7 100644
--- a/rev-list.c
+++ b/rev-list.c
@@ -293,6 +293,7 @@ int main(int argc, const char **argv)
 {
 	struct commit_list *list;
 	int i;
+	int header = 0;
 
 	init_revisions(&revs);
 	revs.abbrev = 0;
@@ -303,7 +304,8 @@ int main(int argc, const char **argv)
 		const char *arg = argv[i];
 
 		if (!strcmp(arg, "--header")) {
-			revs.verbose_header = 1;
+			header = 1;
+			revs.commit_format = CMIT_FMT_UNSPECIFIED;
 			continue;
 		}
 		if (!strcmp(arg, "--timestamp")) {
@@ -324,6 +326,10 @@ int main(int argc, const char **argv)
 			revs.header_prefix = "";
 		else
 			revs.header_prefix = "commit ";
+	} else if (header) {
+		revs.verbose_header = 1;
+		revs.commit_format = CMIT_FMT_RAW;
+		hdr_termination = 0;
 	}
 
 	list = revs.commits;
-- 
1.2.0.ga8a6

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-04-18 14:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-17 12:51 [PATCH] git-rev-list: fix --header Johannes Schindelin
2006-04-17 19:36 ` Junio C Hamano
2006-04-17 20:24   ` Johannes Schindelin
2006-04-17 21:42     ` Junio C Hamano
2006-04-18 14:50       ` Johannes Schindelin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox