{"thread":{"id":"3899","subject":"[PATCH] git-rev-list: fix --header","startedAt":"2006-04-17T12:51:39Z","lastAt":"2006-04-18T14:50:22Z","messageCount":5,"participants":["Johannes Schindelin","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"18769","messageId":"Pine.LNX.4.63.0604171443300.18017@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"3899","inReplyTo":null,"subject":"[PATCH] git-rev-list: fix --header","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-04-17T12:51:39Z","receivedAt":"2006-04-17T12:51:39Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\ngitk expects raw verbose headers limited by \\0. Meet these expectations.\n\nSigned-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>\n\n---\n\n\tThis fixes the \"clock format\" bug I mentioned in another thread: \n\tgit-rev-list printed non-raw headers (lacking \"author\", \n\t\"committer\", and the other lines), and thus, the author date was\n\tempty.\n\n rev-list.c |    8 +++++++-\n 1 files changed, 7 insertions(+), 1 deletions(-)\n\n18f897509cd95b7e55c63e75fa40655c532507f6\ndiff --git a/rev-list.c b/rev-list.c\nindex 9d8db25..54e92f7 100644\n--- a/rev-list.c\n+++ b/rev-list.c\n@@ -293,6 +293,7 @@ int main(int argc, const char **argv)\n {\n \tstruct commit_list *list;\n \tint i;\n+\tint header = 0;\n \n \tinit_revisions(&revs);\n \trevs.abbrev = 0;\n@@ -303,7 +304,8 @@ int main(int argc, const char **argv)\n \t\tconst char *arg = argv[i];\n \n \t\tif (!strcmp(arg, \"--header\")) {\n-\t\t\trevs.verbose_header = 1;\n+\t\t\theader = 1;\n+\t\t\trevs.commit_format = CMIT_FMT_UNSPECIFIED;\n \t\t\tcontinue;\n \t\t}\n \t\tif (!strcmp(arg, \"--timestamp\")) {\n@@ -324,6 +326,10 @@ int main(int argc, const char **argv)\n \t\t\trevs.header_prefix = \"\";\n \t\telse\n \t\t\trevs.header_prefix = \"commit \";\n+\t} else if (header) {\n+\t\trevs.verbose_header = 1;\n+\t\trevs.commit_format = CMIT_FMT_RAW;\n+\t\thdr_termination = 0;\n \t}\n \n \tlist = revs.commits;\n-- \n1.2.0.ga8a6\n"},{"id":"18783","messageId":"7vwtdom1t9.fsf@assigned-by-dhcp.cox.net","threadId":"3899","inReplyTo":"Pine.LNX.4.63.0604171443300.18017@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] git-rev-list: fix --header","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-04-17T19:36:50Z","receivedAt":"2006-04-17T19:36:50Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> gitk expects raw verbose headers limited by \\0. Meet these expectations.\n>\n> Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>\n\nThanks.\n\nWouldn't this be simpler and do the same thing, I wonder?  The\npoint being that \"--pretty --header\" and \"--header --pretty\"\ntraditionally did not make --header to override --pretty.\n\ndiff --git a/rev-list.c b/rev-list.c\nindex 000f27a..d3c0dd9 100644\n--- a/rev-list.c\n+++ b/rev-list.c\n@@ -326,6 +326,9 @@ int main(int argc, const char **argv)\n \t\telse\n \t\t\trevs.header_prefix = \"commit \";\n \t}\n+\telse if (revs.verbose_header)\n+\t\t/* Only --header was specified */\n+\t\trevs.commit_format = CMIT_FMT_RAW;\n \n \tlist = revs.commits;\n \n"},{"id":"18784","messageId":"Pine.LNX.4.63.0604172222390.19593@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"3899","inReplyTo":"7vwtdom1t9.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] git-rev-list: fix --header","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-04-17T20:24:01Z","receivedAt":"2006-04-17T20:24:01Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 17 Apr 2006, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> > gitk expects raw verbose headers limited by \\0. Meet these expectations.\n> >\n> > Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>\n> \n> Thanks.\n> \n> Wouldn't this be simpler and do the same thing, I wonder?  The\n> point being that \"--pretty --header\" and \"--header --pretty\"\n> traditionally did not make --header to override --pretty.\n\nI thought, why not fix that bug, too? After all, it is counterintuitive \nwhat \"--header --pretty\" does, and it was easy to fix.\n\nCiao,\nDscho\n"},{"id":"18786","messageId":"7vhd4rlw0m.fsf@assigned-by-dhcp.cox.net","threadId":"3899","inReplyTo":"Pine.LNX.4.63.0604172222390.19593@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] git-rev-list: fix --header","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-04-17T21:42:01Z","receivedAt":"2006-04-17T21:42:01Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n>> Wouldn't this be simpler and do the same thing, I wonder?  The\n>> point being that \"--pretty --header\" and \"--header --pretty\"\n>> traditionally did not make --header to override --pretty.\n>\n> I thought, why not fix that bug, too? After all, it is counterintuitive \n> what \"--header --pretty\" does, and it was easy to fix.\n\nI checked with 0.99.9m and both \"--pretty --header\" and\n\"--header --pretty\" gives preference to --pretty.  I think your\npatch changes it to favor whichever comes later.\n\nI thought it could be considered a bug to accept --header and\n--pretty at the same time without complaining, but if you want\nto forbid it, you could error out.  However, that might break\nexisting Porcelains, and that's why I suggested to keep the\ntraditional \"--pretty wins over --header\" behaviour.\n\nIf gitk were the only Porcelain we care about that uses\n--header, it would make more sense to change the rule to\n\"--header trumps --pretty\" and \"gitk --pretty\" would magically\nstart working.\n\nStill undecided.  As you say it is an easy change, so I'd rather\nleave the behaviour as before for now.\n"},{"id":"18806","messageId":"Pine.LNX.4.63.0604181649510.2140@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"3899","inReplyTo":"7vhd4rlw0m.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] git-rev-list: fix --header","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-04-18T14:50:22Z","receivedAt":"2006-04-18T14:50:22Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 17 Apr 2006, Junio C Hamano wrote:\n\n> Still undecided.  As you say it is an easy change, so I'd rather\n> leave the behaviour as before for now.\n\nOkay, I'd say go with the shorter (your) solution.\n\nCiao,\nDscho\n"}]}