git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] git-rev-list: fix --header

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Apr 17, 2006, 12:51 UTC
Message-ID
<Pine.LNX.4.63.0604171443300.18017@wbgn013.biozentrum.uni-wuerzburg.de>
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
Next: Junio C Hamano
Message 1 of 5 in “git-rev-list: fix --header”
  1. git-rev-list: fix --headerJohannes Schindelin, Apr 17, 2006
  2. Junio C HamanoApr 17, 2006
  3. Johannes SchindelinApr 17, 2006
  4. Junio C HamanoApr 17, 2006
  5. Johannes SchindelinApr 18, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.