{"thread":{"id":"6994","subject":"[PATCH] Add --pretty=changelog","startedAt":"2007-02-27T15:21:27Z","lastAt":"2007-03-03T20:07:11Z","messageCount":24,"participants":["Johannes Schindelin","Nicolas Pitre","Eric Wong","Junio C Hamano","Simon Josefsson","Shawn O. Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"35625","messageId":"Pine.LNX.4.63.0702271621120.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6994","inReplyTo":null,"subject":"[PATCH] Add --pretty=changelog","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-02-27T15:21:27Z","receivedAt":"2007-02-27T15:21:27Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nThis outputs the log in GNU ChangeLog format.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n commit.c   |   18 +++++++++++---\n commit.h   |    1 +\n diff.c     |   77 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n diff.h     |    1 +\n log-tree.c |   17 ++++++++++++-\n revision.c |    6 ++++\n 6 files changed, 115 insertions(+), 5 deletions(-)\n\ndiff --git a/commit.c b/commit.c\nindex fb75ae5..64ddb56 100644\n--- a/commit.c\n+++ b/commit.c\n@@ -38,6 +38,7 @@ struct cmt_fmt_map {\n \t{ \"fuller\",\t5,\tCMIT_FMT_FULLER },\n \t{ \"oneline\",\t1,\tCMIT_FMT_ONELINE },\n \t{ \"format:\",\t7,\tCMIT_FMT_USERFORMAT},\n+\t{ \"changelog\",\t9,\tCMIT_FMT_CHANGELOG}\n };\n \n static char *user_format;\n@@ -563,6 +564,8 @@ static int add_user_info(const char *what, enum cmit_fmt fmt, char *buf,\n \t\tret += namelen - display_name_length;\n \t\tbuf[ret++] = '\\n';\n \t}\n+\telse if (fmt == CMIT_FMT_CHANGELOG)\n+\t\tret = 0;\n \telse {\n \t\tret = sprintf(buf, \"%s: %.*s%.*s\\n\", what,\n \t\t\t      (fmt == CMIT_FMT_FULLER) ? 4 : 0,\n@@ -581,6 +584,11 @@ static int add_user_info(const char *what, enum cmit_fmt fmt, char *buf,\n \t\tret += sprintf(buf + ret, \"%sDate: %s\\n\", what,\n \t\t\t       show_date(time, tz, relative_date));\n \t\tbreak;\n+\tcase CMIT_FMT_CHANGELOG:\n+\t\tret += sprintf(buf + ret, \"%s  %.*s\\n\",\n+\t\t\t\tshow_date(time, tz, DATE_SHORT),\n+\t\t\t\tnamelen, line);\n+\t\tbreak;\n \tdefault:\n \t\t/* notin' */\n \t\tbreak;\n@@ -603,7 +611,7 @@ static int add_merge_info(enum cmit_fmt fmt, char *buf, const struct commit *com\n \tint offset;\n \n \tif ((fmt == CMIT_FMT_ONELINE) || (fmt == CMIT_FMT_EMAIL) ||\n-\t    !parent || !parent->next)\n+\t    fmt == CMIT_FMT_CHANGELOG || !parent || !parent->next)\n \t\treturn 0;\n \n \toffset = sprintf(buf, \"Merge:\");\n@@ -931,7 +939,8 @@ unsigned long pretty_print_commit(enum cmit_fmt fmt,\n \tif (reencoded)\n \t\tmsg = reencoded;\n \n-\tif (fmt == CMIT_FMT_ONELINE || fmt == CMIT_FMT_EMAIL)\n+\tif (fmt == CMIT_FMT_ONELINE || fmt == CMIT_FMT_EMAIL ||\n+\t    fmt == CMIT_FMT_CHANGELOG)\n \t\tindent = 0;\n \n \t/* After-subject is used to pass in Content-Type: multipart\n@@ -982,7 +991,8 @@ unsigned long pretty_print_commit(enum cmit_fmt fmt,\n \t\tif (hdr) {\n \t\t\tif (linelen == 1) {\n \t\t\t\thdr = 0;\n-\t\t\t\tif ((fmt != CMIT_FMT_ONELINE) && !subject)\n+\t\t\t\tif (fmt != CMIT_FMT_ONELINE &&\n+\t\t\t\t    fmt != CMIT_FMT_CHANGELOG && !subject)\n \t\t\t\t\tbuf[offset++] = '\\n';\n \t\t\t\tcontinue;\n \t\t\t}\n@@ -1052,7 +1062,7 @@ unsigned long pretty_print_commit(enum cmit_fmt fmt,\n \t\t\toffset += linelen + indent;\n \t\t}\n \t\tbuf[offset++] = '\\n';\n-\t\tif (fmt == CMIT_FMT_ONELINE)\n+\t\tif (fmt == CMIT_FMT_ONELINE || fmt == CMIT_FMT_CHANGELOG)\n \t\t\tbreak;\n \t\tif (subject && plain_non_ascii) {\n \t\t\tint sz;\ndiff --git a/commit.h b/commit.h\nindex 83507a0..9d59e0f 100644\n--- a/commit.h\n+++ b/commit.h\n@@ -48,6 +48,7 @@ enum cmit_fmt {\n \tCMIT_FMT_ONELINE,\n \tCMIT_FMT_EMAIL,\n \tCMIT_FMT_USERFORMAT,\n+\tCMIT_FMT_CHANGELOG,\n \n \tCMIT_FMT_UNSPECIFIED,\n };\ndiff --git a/diff.c b/diff.c\nindex 5651152..aed5388 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -8,6 +8,7 @@\n #include \"delta.h\"\n #include \"xdiff-interface.h\"\n #include \"color.h\"\n+#include \"utf8.h\"\n \n #ifdef NO_FAST_WORKING_DIRECTORY\n #define FAST_WORKING_DIRECTORY 0\n@@ -1845,6 +1846,59 @@ static void run_checkdiff(struct diff_filepair *p, struct diff_options *o)\n \tbuiltin_checkdiff(name, other, p->one, p->two, o);\n }\n \n+#define CHANGELOG_TAB_SIZE 8\n+#define CHANGELOG_WIDTH 76\n+\n+struct changelog_t {\n+\tint offset, seen_first;\n+};\n+\n+static void run_changelog(struct diff_filepair *p, struct diff_options *o,\n+\tstruct changelog_t *changelog)\n+{\n+\tconst char *name;\n+\tconst char *other;\n+\tstatic char buffer[1024];\n+\n+\tif (DIFF_PAIR_UNMERGED(p)) {\n+\t\t/* unmerged */\n+\t\treturn;\n+\t}\n+\n+\tif (changelog->seen_first)\n+\t\tbuffer[0] = ',';\n+\telse {\n+\t\tbuffer[0] = '*';\n+\t\tchangelog->offset = -CHANGELOG_TAB_SIZE;\n+\t\tchangelog->seen_first = 1;\n+\t}\n+\n+\tname = p->one->path;\n+\tother = p->two->path;\n+\n+\tif (!name) {\n+\t\tif (!other)\n+\t\t\treturn;\n+\t\tsnprintf(buffer + 1, sizeof(buffer) - 1, \" %s\", other);\n+\t} else if (!other || !strcmp(name, other))\n+\t\tsnprintf(buffer + 1, sizeof(buffer) - 1, \" %s\", name);\n+\telse\n+\t\tsnprintf(buffer + 1, sizeof(buffer) - 1, \" %s => %s\",\n+\t\t\t\tname, other);\n+\tchangelog->offset = print_wrapped_text(buffer, -changelog->offset,\n+\t\tCHANGELOG_TAB_SIZE + 2, CHANGELOG_WIDTH);\n+}\n+\n+static void finalize_changelog(struct diff_options *options,\n+\t\tstruct changelog_t *changelog)\n+{\n+\tchangelog->offset = print_wrapped_text(\": \", -changelog->offset,\n+\t\tCHANGELOG_TAB_SIZE + 2, CHANGELOG_WIDTH);\n+\tchangelog->offset = print_wrapped_text(options->stat_sep,\n+\t\t\t-changelog->offset,\n+\t\t\tCHANGELOG_TAB_SIZE + 2, CHANGELOG_WIDTH);\n+}\n+\n void diff_setup(struct diff_options *options)\n {\n \tmemset(options, 0, sizeof(*options));\n@@ -2366,6 +2420,19 @@ static void diff_flush_checkdiff(struct diff_filepair *p,\n \trun_checkdiff(p, o);\n }\n \n+static void diff_flush_changelog(struct diff_filepair *p,\n+\t\tstruct diff_options *o, struct changelog_t *changelog)\n+{\n+\tif (diff_unmodified_pair(p))\n+\t\treturn;\n+\n+\tif ((DIFF_FILE_VALID(p->one) && S_ISDIR(p->one->mode)) ||\n+\t    (DIFF_FILE_VALID(p->two) && S_ISDIR(p->two->mode)))\n+\t\treturn; /* no tree diffs in patch format */\n+\n+\trun_changelog(p, o, changelog);\n+}\n+\n int diff_queue_is_empty(void)\n {\n \tstruct diff_queue_struct *q = &diff_queued_diff;\n@@ -2752,6 +2819,16 @@ void diff_flush(struct diff_options *options)\n \t\tseparator++;\n \t}\n \n+\tif (output_format & DIFF_FORMAT_CHANGELOG) {\n+\t\tstruct changelog_t changelog;\n+\t\tmemset(&changelog, 0, sizeof(struct changelog_t));\n+\t\tfor (i = 0; i < q->nr; i++) {\n+\t\t\tstruct diff_filepair *p = q->queue[i];\n+\t\t\tif (check_pair_status(p))\n+\t\t\t\tdiff_flush_changelog(p, options, &changelog);\n+\t\t}\n+\t\tfinalize_changelog(options, &changelog);\n+\t}\n \tif (output_format & (DIFF_FORMAT_DIFFSTAT|DIFF_FORMAT_SHORTSTAT|DIFF_FORMAT_NUMSTAT)) {\n \t\tstruct diffstat_t diffstat;\n \ndiff --git a/diff.h b/diff.h\nindex 4043cec..df3b512 100644\n--- a/diff.h\n+++ b/diff.h\n@@ -30,6 +30,7 @@ typedef void (*diff_format_fn_t)(struct diff_queue_struct *q,\n #define DIFF_FORMAT_SUMMARY\t0x0008\n #define DIFF_FORMAT_PATCH\t0x0010\n #define DIFF_FORMAT_SHORTSTAT\t0x0020\n+#define DIFF_FORMAT_CHANGELOG\t0x0040\n \n /* These override all above */\n #define DIFF_FORMAT_NAME\t0x0100\ndiff --git a/log-tree.c b/log-tree.c\nindex 6ce239d..b7006bf 100644\n--- a/log-tree.c\n+++ b/log-tree.c\n@@ -211,7 +211,8 @@ void show_log(struct rev_info *opt, const char *sep)\n \t\t\t\t sha1, sha1);\n \t\t\topt->diffopt.stat_sep = buffer;\n \t\t}\n-\t} else if (opt->commit_format != CMIT_FMT_USERFORMAT) {\n+\t} else if (opt->commit_format != CMIT_FMT_USERFORMAT &&\n+\t\t\topt->commit_format != CMIT_FMT_CHANGELOG) {\n \t\tfputs(diff_get_color(opt->diffopt.color_diff, DIFF_COMMIT),\n \t\t      stdout);\n \t\tif (opt->commit_format != CMIT_FMT_ONELINE)\n@@ -253,6 +254,20 @@ void show_log(struct rev_info *opt, const char *sep)\n \t\t\t\t  sizeof(this_header), abbrev, subject,\n \t\t\t\t  extra_headers, opt->relative_date);\n \n+\tif (opt->commit_format == CMIT_FMT_CHANGELOG) {\n+\t\tstatic char *oneline = NULL;\n+\t\tchar *eol = strchr(this_header, '\\n');\n+\n+\t\tif (oneline)\n+\t\t\tfree(oneline);\n+\t\tif (eol) {\n+\t\t\toneline = xstrdup(eol + 1);\n+\t\t\teol[1] = '\\0';\n+\t\t} else\n+\t\t\toneline = NULL;\n+\t\topt->diffopt.stat_sep = oneline;\n+\t}\n+\n \tif (opt->add_signoff)\n \t\tlen = append_signoff(this_header, sizeof(this_header), len,\n \t\t\t\t     opt->add_signoff);\ndiff --git a/revision.c b/revision.c\nindex 823bbd1..5bdc1fc 100644\n--- a/revision.c\n+++ b/revision.c\n@@ -1119,6 +1119,12 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch\n \t\tif (revs->dense_combined_merges && !revs->diffopt.output_format)\n \t\t\trevs->diffopt.output_format = DIFF_FORMAT_PATCH;\n \t}\n+\tif (revs->commit_format == CMIT_FMT_CHANGELOG) {\n+\t\trevs->diffopt.output_format |= DIFF_FORMAT_CHANGELOG;\n+\t\trevs->diff = 1;\n+\t\trevs->diffopt.recursive = 1;\n+\t\trevs->no_merges = 1;\n+\t}\n \trevs->diffopt.abbrev = revs->abbrev;\n \tif (diff_setup_done(&revs->diffopt) < 0)\n \t\tdie(\"diff_setup_done failed\");\n-- \n1.5.0.2.2410.g737b\n"},{"id":"35629","messageId":"alpine.LRH.0.82.0702271036010.29426@xanadu.home","threadId":"6994","inReplyTo":"Pine.LNX.4.63.0702271621120.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] Add --pretty=changelog","fromName":"Nicolas Pitre","fromEmail":"nico@cam.org","sentAt":"2007-02-27T15:38:09Z","receivedAt":"2007-02-27T15:38:09Z","isPatch":true,"sender":{"key":"nico@fluxnic.net","avatar":"https://avatars.githubusercontent.com/u/702790?v=4"},"body":"On Tue, 27 Feb 2007, Johannes Schindelin wrote:\n\n> \n> This outputs the log in GNU ChangeLog format.\n\nPlease don't call it \"changelog\".  I personally find this format horrid \nand \"changelog\" is too generic for such a specific format.  \n\"gnu_changelog\" maybe...\n\n\nNicolas\n"},{"id":"35632","messageId":"Pine.LNX.4.63.0702271656540.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6994","inReplyTo":"alpine.LRH.0.82.0702271036010.29426@xanadu.home","subject":"Re: [PATCH] Add --pretty=changelog","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-02-27T15:57:17Z","receivedAt":"2007-02-27T15:57:17Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 27 Feb 2007, Nicolas Pitre wrote:\n\n> On Tue, 27 Feb 2007, Johannes Schindelin wrote:\n> \n> > \n> > This outputs the log in GNU ChangeLog format.\n> \n> Please don't call it \"changelog\".  I personally find this format horrid \n> and \"changelog\" is too generic for such a specific format.  \n> \"gnu_changelog\" maybe...\n\nFair enough. Maybe with a dash, so it is easier to type?\n\nCiao,\nDscho\n"},{"id":"35718","messageId":"20070227231100.GA25782@localdomain","threadId":"6994","inReplyTo":"Pine.LNX.4.63.0702271656540.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] Add --pretty=changelog","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2007-02-27T23:11:00Z","receivedAt":"2007-02-27T23:11:00Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> Hi,\n> \n> On Tue, 27 Feb 2007, Nicolas Pitre wrote:\n> \n> > On Tue, 27 Feb 2007, Johannes Schindelin wrote:\n> > \n> > > \n> > > This outputs the log in GNU ChangeLog format.\n> > \n> > Please don't call it \"changelog\".  I personally find this format horrid \n> > and \"changelog\" is too generic for such a specific format.  \n> > \"gnu_changelog\" maybe...\n> \n> Fair enough. Maybe with a dash, so it is easier to type?\n\n> --- a/commit.c\n> +++ b/commit.c\n> @@ -38,6 +38,7 @@ struct cmt_fmt_map {\n>  \t{ \"fuller\",\t5,\tCMIT_FMT_FULLER },\n>  \t{ \"oneline\",\t1,\tCMIT_FMT_ONELINE },\n>  \t{ \"format:\",\t7,\tCMIT_FMT_USERFORMAT},\n> +\t{ \"changelog\",\t9,\tCMIT_FMT_CHANGELOG}\n                        ^- that should be a 1\n\n'gnu[_-]changelog' or 'changelog' would all uniquely abbreviate to a\nsingle character.\n\n--pretty=gnu sounds nice, however :)\n\n-- \nEric Wong\n"},{"id":"35723","messageId":"7vodnfb2y9.fsf@assigned-by-dhcp.cox.net","threadId":"6994","inReplyTo":"20070227231100.GA25782@localdomain","subject":"Re: [PATCH] Add --pretty=changelog","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-02-27T23:22:54Z","receivedAt":"2007-02-27T23:22:54Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Wong <normalperson@yhbt.net> writes:\n\n> --pretty=gnu sounds nice, however :)\n\nHuh?  It has the same problem as the earlier one suggested by\nHPA: --pretty=rpm ;-)\n"},{"id":"35753","messageId":"Pine.LNX.4.63.0702280258200.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6994","inReplyTo":"Pine.LNX.4.63.0702271621120.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"[PATCH 4/3] Rename --pretty=changelog to --pretty=gnucl, and fix a bug","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-02-28T01:58:43Z","receivedAt":"2007-02-28T01:58:43Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nIt was pointed out that this format is rather specific. So, rename it\nto \"gnucl\".\n\nAlso fix a bug where it would crash with an empty commit message.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n Documentation/pretty-formats.txt |   10 ++++++++++\n commit.c                         |    2 +-\n diff.c                           |    2 ++\n 3 files changed, 13 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/pretty-formats.txt b/Documentation/pretty-formats.txt\nindex 2fe6c31..f9ce4fb 100644\n--- a/Documentation/pretty-formats.txt\n+++ b/Documentation/pretty-formats.txt\n@@ -77,6 +77,16 @@ displayed in full, regardless of whether --abbrev or\n true parent commits, without taking grafts nor history\n simplification into account.\n \n+\t* 'gnucl'\n++\n+--------------------------------------------------------------\n+2007-02-22  Simon Josefsson <simon@josefsson.org>\n+\n+    * link-warning.h, gl/getaddrinfo.c, gl/gnulib.mk,\n+         gl/string_.h, lgl/m4/unistd_h.m4: Update.\n+--------------------------------------------------------------\n+\n+\n \t* 'format:'\n +\n The 'format:' format allows you to specify which information\ndiff --git a/commit.c b/commit.c\nindex 64ddb56..abd84a8 100644\n--- a/commit.c\n+++ b/commit.c\n@@ -38,7 +38,7 @@ struct cmt_fmt_map {\n \t{ \"fuller\",\t5,\tCMIT_FMT_FULLER },\n \t{ \"oneline\",\t1,\tCMIT_FMT_ONELINE },\n \t{ \"format:\",\t7,\tCMIT_FMT_USERFORMAT},\n-\t{ \"changelog\",\t9,\tCMIT_FMT_CHANGELOG}\n+\t{ \"gnucl\",\t1,\tCMIT_FMT_CHANGELOG}\n };\n \n static char *user_format;\ndiff --git a/diff.c b/diff.c\nindex aed5388..f2d162f 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -1892,6 +1892,8 @@ static void run_changelog(struct diff_filepair *p, struct diff_options *o,\n static void finalize_changelog(struct diff_options *options,\n \t\tstruct changelog_t *changelog)\n {\n+\tif (!options->stat_sep)\n+\t\treturn;\n \tchangelog->offset = print_wrapped_text(\": \", -changelog->offset,\n \t\tCHANGELOG_TAB_SIZE + 2, CHANGELOG_WIDTH);\n \tchangelog->offset = print_wrapped_text(options->stat_sep,\n-- \n1.5.0.2.778.g534f-dirty\n"},{"id":"35758","messageId":"alpine.LRH.0.82.0702272147590.29426@xanadu.home","threadId":"6994","inReplyTo":"Pine.LNX.4.63.0702280258200.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH 4/3] Rename --pretty=changelog to --pretty=gnucl, and fix a bug","fromName":"Nicolas Pitre","fromEmail":"nico@cam.org","sentAt":"2007-02-28T02:52:03Z","receivedAt":"2007-02-28T02:52:03Z","isPatch":true,"sender":{"key":"nico@fluxnic.net","avatar":"https://avatars.githubusercontent.com/u/702790?v=4"},"body":"On Wed, 28 Feb 2007, Johannes Schindelin wrote:\n\n> It was pointed out that this format is rather specific. So, rename it\n> to \"gnucl\".\n[...]\n> +\t{ \"gnucl\",\t1,\tCMIT_FMT_CHANGELOG}\n\nShouldn't it be CMIT_FMT_GNUCL as well to be consistent?\n\nThis is nitpicking but I don't see why those GNU abominations should \nbe assigned generic terms, even in this particular name space.\n\n\nNicolas\n"},{"id":"35798","messageId":"Pine.LNX.4.63.0702281343200.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6994","inReplyTo":"alpine.LRH.0.82.0702272147590.29426@xanadu.home","subject":"[PATCH] --amend Rename --pretty=changelog to --pretty=gnucl","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-02-28T12:44:46Z","receivedAt":"2007-02-28T12:44:46Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nAlso rename {CMIT_FMT_,DIFF_FORMAT_}{CHANGELOG=>GNUCL}.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n\n\tOn Tue, 27 Feb 2007, Nicolas Pitre wrote:\n\n\t> Shouldn't it be CMIT_FMT_GNUCL as well to be consistent?\n\t> \n\t> This is nitpicking but I don't see why those GNU abominations \n\t> should be assigned generic terms, even in this particular name \n\t> space.\n\n\tI agree.\n\n commit.c   |   14 +++++++-------\n commit.h   |    2 +-\n diff.c     |    2 +-\n diff.h     |    2 +-\n log-tree.c |    4 ++--\n revision.c |    4 ++--\n 6 files changed, 14 insertions(+), 14 deletions(-)\n\ndiff --git a/commit.c b/commit.c\nindex abd84a8..3cb7e1c 100644\n--- a/commit.c\n+++ b/commit.c\n@@ -38,7 +38,7 @@ struct cmt_fmt_map {\n \t{ \"fuller\",\t5,\tCMIT_FMT_FULLER },\n \t{ \"oneline\",\t1,\tCMIT_FMT_ONELINE },\n \t{ \"format:\",\t7,\tCMIT_FMT_USERFORMAT},\n-\t{ \"gnucl\",\t1,\tCMIT_FMT_CHANGELOG}\n+\t{ \"gnucl\",\t1,\tCMIT_FMT_GNUCL}\n };\n \n static char *user_format;\n@@ -564,7 +564,7 @@ static int add_user_info(const char *what, enum cmit_fmt fmt, char *buf,\n \t\tret += namelen - display_name_length;\n \t\tbuf[ret++] = '\\n';\n \t}\n-\telse if (fmt == CMIT_FMT_CHANGELOG)\n+\telse if (fmt == CMIT_FMT_GNUCL)\n \t\tret = 0;\n \telse {\n \t\tret = sprintf(buf, \"%s: %.*s%.*s\\n\", what,\n@@ -584,7 +584,7 @@ static int add_user_info(const char *what, enum cmit_fmt fmt, char *buf,\n \t\tret += sprintf(buf + ret, \"%sDate: %s\\n\", what,\n \t\t\t       show_date(time, tz, relative_date));\n \t\tbreak;\n-\tcase CMIT_FMT_CHANGELOG:\n+\tcase CMIT_FMT_GNUCL:\n \t\tret += sprintf(buf + ret, \"%s  %.*s\\n\",\n \t\t\t\tshow_date(time, tz, DATE_SHORT),\n \t\t\t\tnamelen, line);\n@@ -611,7 +611,7 @@ static int add_merge_info(enum cmit_fmt fmt, char *buf, const struct commit *com\n \tint offset;\n \n \tif ((fmt == CMIT_FMT_ONELINE) || (fmt == CMIT_FMT_EMAIL) ||\n-\t    fmt == CMIT_FMT_CHANGELOG || !parent || !parent->next)\n+\t    fmt == CMIT_FMT_GNUCL || !parent || !parent->next)\n \t\treturn 0;\n \n \toffset = sprintf(buf, \"Merge:\");\n@@ -940,7 +940,7 @@ unsigned long pretty_print_commit(enum cmit_fmt fmt,\n \t\tmsg = reencoded;\n \n \tif (fmt == CMIT_FMT_ONELINE || fmt == CMIT_FMT_EMAIL ||\n-\t    fmt == CMIT_FMT_CHANGELOG)\n+\t    fmt == CMIT_FMT_GNUCL)\n \t\tindent = 0;\n \n \t/* After-subject is used to pass in Content-Type: multipart\n@@ -992,7 +992,7 @@ unsigned long pretty_print_commit(enum cmit_fmt fmt,\n \t\t\tif (linelen == 1) {\n \t\t\t\thdr = 0;\n \t\t\t\tif (fmt != CMIT_FMT_ONELINE &&\n-\t\t\t\t    fmt != CMIT_FMT_CHANGELOG && !subject)\n+\t\t\t\t    fmt != CMIT_FMT_GNUCL && !subject)\n \t\t\t\t\tbuf[offset++] = '\\n';\n \t\t\t\tcontinue;\n \t\t\t}\n@@ -1062,7 +1062,7 @@ unsigned long pretty_print_commit(enum cmit_fmt fmt,\n \t\t\toffset += linelen + indent;\n \t\t}\n \t\tbuf[offset++] = '\\n';\n-\t\tif (fmt == CMIT_FMT_ONELINE || fmt == CMIT_FMT_CHANGELOG)\n+\t\tif (fmt == CMIT_FMT_ONELINE || fmt == CMIT_FMT_GNUCL)\n \t\t\tbreak;\n \t\tif (subject && plain_non_ascii) {\n \t\t\tint sz;\ndiff --git a/commit.h b/commit.h\nindex 9d59e0f..2425f7b 100644\n--- a/commit.h\n+++ b/commit.h\n@@ -48,7 +48,7 @@ enum cmit_fmt {\n \tCMIT_FMT_ONELINE,\n \tCMIT_FMT_EMAIL,\n \tCMIT_FMT_USERFORMAT,\n-\tCMIT_FMT_CHANGELOG,\n+\tCMIT_FMT_GNUCL,\n \n \tCMIT_FMT_UNSPECIFIED,\n };\ndiff --git a/diff.c b/diff.c\nindex f2d162f..9f9cb34 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -2821,7 +2821,7 @@ void diff_flush(struct diff_options *options)\n \t\tseparator++;\n \t}\n \n-\tif (output_format & DIFF_FORMAT_CHANGELOG) {\n+\tif (output_format & DIFF_FORMAT_GNUCL) {\n \t\tstruct changelog_t changelog;\n \t\tmemset(&changelog, 0, sizeof(struct changelog_t));\n \t\tfor (i = 0; i < q->nr; i++) {\ndiff --git a/diff.h b/diff.h\nindex df3b512..1c52851 100644\n--- a/diff.h\n+++ b/diff.h\n@@ -30,7 +30,7 @@ typedef void (*diff_format_fn_t)(struct diff_queue_struct *q,\n #define DIFF_FORMAT_SUMMARY\t0x0008\n #define DIFF_FORMAT_PATCH\t0x0010\n #define DIFF_FORMAT_SHORTSTAT\t0x0020\n-#define DIFF_FORMAT_CHANGELOG\t0x0040\n+#define DIFF_FORMAT_GNUCL\t0x0040\n \n /* These override all above */\n #define DIFF_FORMAT_NAME\t0x0100\ndiff --git a/log-tree.c b/log-tree.c\nindex b7006bf..dd49154 100644\n--- a/log-tree.c\n+++ b/log-tree.c\n@@ -212,7 +212,7 @@ void show_log(struct rev_info *opt, const char *sep)\n \t\t\topt->diffopt.stat_sep = buffer;\n \t\t}\n \t} else if (opt->commit_format != CMIT_FMT_USERFORMAT &&\n-\t\t\topt->commit_format != CMIT_FMT_CHANGELOG) {\n+\t\t\topt->commit_format != CMIT_FMT_GNUCL) {\n \t\tfputs(diff_get_color(opt->diffopt.color_diff, DIFF_COMMIT),\n \t\t      stdout);\n \t\tif (opt->commit_format != CMIT_FMT_ONELINE)\n@@ -254,7 +254,7 @@ void show_log(struct rev_info *opt, const char *sep)\n \t\t\t\t  sizeof(this_header), abbrev, subject,\n \t\t\t\t  extra_headers, opt->relative_date);\n \n-\tif (opt->commit_format == CMIT_FMT_CHANGELOG) {\n+\tif (opt->commit_format == CMIT_FMT_GNUCL) {\n \t\tstatic char *oneline = NULL;\n \t\tchar *eol = strchr(this_header, '\\n');\n \ndiff --git a/revision.c b/revision.c\nindex 5bdc1fc..d7b9d2d 100644\n--- a/revision.c\n+++ b/revision.c\n@@ -1119,8 +1119,8 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch\n \t\tif (revs->dense_combined_merges && !revs->diffopt.output_format)\n \t\t\trevs->diffopt.output_format = DIFF_FORMAT_PATCH;\n \t}\n-\tif (revs->commit_format == CMIT_FMT_CHANGELOG) {\n-\t\trevs->diffopt.output_format |= DIFF_FORMAT_CHANGELOG;\n+\tif (revs->commit_format == CMIT_FMT_GNUCL) {\n+\t\trevs->diffopt.output_format |= DIFF_FORMAT_GNUCL;\n \t\trevs->diff = 1;\n \t\trevs->diffopt.recursive = 1;\n \t\trevs->no_merges = 1;\n-- \n1.5.0.2.778.g534f-dirty\n"},{"id":"35980","messageId":"87y7mhrnrc.fsf@latte.josefsson.org","threadId":"6994","inReplyTo":"Pine.LNX.4.63.0702271621120.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] Add --pretty=changelog","fromName":"Simon Josefsson","fromEmail":"simon@josefsson.org","sentAt":"2007-03-01T15:23:35Z","receivedAt":"2007-03-01T15:23:35Z","isPatch":true,"sender":{"key":"simon@josefsson.org","avatar":"https://gravatar.com/avatar/bbcf4eaca84bcb1c3d191a2d8868291127d072e3ed2cc92e8b835d8a009020d8?d=mp&s=160"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> This outputs the log in GNU ChangeLog format.\n\nMany thanks!  I ran this in my cvs->git repository for libtasn1, and\nthen did a diff against the output from cvs2cl in the old repository.\nHere are some categories of differences:\n\n1) Indentation should be under the '*'.  Compare (wrong):\n\n        * src/asn1Coding.c, src/asn1Decoding.c, src/asn1Parser.c: Improve\n          --help output.  Assume getopt_long, since gnulib provides it.\n\nwith (correct):\n\n        * src/asn1Coding.c, src/asn1Decoding.c, src/asn1Parser.c: Improve\n        --help output.  Assume getopt_long, since gnulib provides it.\n\n2) Don't log anything for empty messages:\n\n        * gl/.cvsignore: *** empty log message ***\n\nPossibly, this should be an option.\n\n3) Possible charset problem?  Compare this (correct):\n\n        * configure.in: Fix -Wno-pointer-sign test to respect user-defined\n        CFLAGS.  Reported by \"Diego 'Flameeyes' Pettenò\"\n        <flameeyes@gentoo.org>.\n\nwith (wrong):\n\n        * configure.in: Fix -Wno-pointer-sign test to respect user-defined\n          CFLAGS.  Reported\n\nThe git log do seem to contain the correct data, though, from git-log:\n\n    Fix -Wno-pointer-sign test to respect user-defined CFLAGS.  Reported\n    by \"Diego 'Flameeyes' Pettenò\" <flameeyes@gentoo.org>.\n\n4) Weird error, compare (correct):\n\n        * lib/coding.c:\n        (asn1_der_coding): For TYPE_NULL, increment counter even if we don't\n        write any output.  Reported by Stephen Wrobleski\n        <steve@localtoast.org>.\n\nwith (wrong):\n\n        * lib/coding.c: (asn1_der_coding): For TYPE_NULL, increment counter\n          even if we don't\n\nMaybe this is related to the last one, and the problem really is '<' or '>'?\n\nHere is another one, compare (correct):\n\n        * lib/coding.c:\n        (asn1_octet_der): Work even if str_len is 0, i.e., write an ASN.1\n        length of zero.  Otherwise encodings became garbled on 64-bit\n        platforms, detected while running the Shishi self-tests on the\n        Debian build robots.  A self test to reproduce this is in Test_tree.\n\nwith (wrong):\n\n        * lib/coding.c: (asn1_octet_der): Work even if str_len is 0, i.e.,\n          write an ASN.1\n\nI'll let you fix these and resume the diff later. :)\n\nCan I pull your git tree from somewhere?  Applying patches from e-mail\nis kind of boring.\n\n/Simon\n"},{"id":"35990","messageId":"Pine.LNX.4.63.0703011912090.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6994","inReplyTo":"87y7mhrnrc.fsf@latte.josefsson.org","subject":"Re: [PATCH] Add --pretty=changelog","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-03-01T18:15:50Z","receivedAt":"2007-03-01T18:15:50Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 1 Mar 2007, Simon Josefsson wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> > This outputs the log in GNU ChangeLog format.\n> \n> Many thanks!  I ran this in my cvs->git repository for libtasn1, and \n> then did a diff against the output from cvs2cl in the old repository. \n> Here are some categories of differences:\n\nNo good deed goes unpunished, they say...\n\n> 1) Indentation should be under the '*'.  Compare (wrong):\n> \n>         * src/asn1Coding.c, src/asn1Decoding.c, src/asn1Parser.c: Improve\n>           --help output.  Assume getopt_long, since gnulib provides it.\n\nI saw that in your mail already, and I find the style cvs2cl outputs ugly.\n\n> 2) Don't log anything for empty messages:\n> \n>         * gl/.cvsignore: *** empty log message ***\n> \n> Possibly, this should be an option.\n\nIt does not log anything for empty messages. Not even a colon.\n\n> 3) Possible charset problem?  Compare this (correct):\n> \n>         * configure.in: Fix -Wno-pointer-sign test to respect user-defined\n>         CFLAGS.  Reported by \"Diego 'Flameeyes' Pettenò\"\n>         <flameeyes@gentoo.org>.\n> \n> with (wrong):\n> \n>         * configure.in: Fix -Wno-pointer-sign test to respect user-defined\n>           CFLAGS.  Reported\n> \n> The git log do seem to contain the correct data, though, from git-log:\n> \n>     Fix -Wno-pointer-sign test to respect user-defined CFLAGS.  Reported\n>     by \"Diego 'Flameeyes' Pettenò\" <flameeyes@gentoo.org>.\n\nNo charset problem. In Git commit messages, the first line is special. It \nis the so called \"oneline\" description. If you wrap the oneline, it's your \nfault, not Git's.\n\n> 4) Weird error, compare (correct):\n\nThis is exactly the same as 3).\n\n> I'll let you fix these and resume the diff later. :)\n\nAs far as I am concerned, I don't think there is anything to fix. Except \nmaybe the wrapping of your commit messages, but I guess it is too late now \nto change them?\n\n> Can I pull your git tree from somewhere?  Applying patches from e-mail \n> is kind of boring.\n\nNo, I don't have a public Git tree.\n\nCiao,\nDscho\n"},{"id":"35991","messageId":"20070301182710.GA8858@spearce.org","threadId":"6994","inReplyTo":"Pine.LNX.4.63.0703011912090.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] Add --pretty=changelog","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-03-01T18:27:10Z","receivedAt":"2007-03-01T18:27:10Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> No, I don't have a public Git tree.\n\nShame on you Dscho!  Even Junio has a public git tree!  ;-)\n\n-- \nShawn.\n"},{"id":"35995","messageId":"Pine.LNX.4.63.0703011940000.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6994","inReplyTo":"20070301182710.GA8858@spearce.org","subject":"Re: [PATCH] Add --pretty=changelog","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-03-01T18:40:31Z","receivedAt":"2007-03-01T18:40:31Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 1 Mar 2007, Shawn O. Pearce wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> > No, I don't have a public Git tree.\n> \n> Shame on you Dscho!  Even Junio has a public git tree!  ;-)\n\nWhat would I do with a public git tree? It would only attract the svn \ndogs, who would cvs piss on it...\n\nCiao,\nDscho\n"},{"id":"36036","messageId":"7v8xegntro.fsf@assigned-by-dhcp.cox.net","threadId":"6994","inReplyTo":"Pine.LNX.4.63.0703011912090.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] Add --pretty=changelog","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-03-02T04:39:39Z","receivedAt":"2007-03-02T04:39:39Z","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>> 3) Possible charset problem?  Compare this (correct):\n>> \n>>         * configure.in: Fix -Wno-pointer-sign test to respect user-defined\n>>         CFLAGS.  Reported by \"Diego 'Flameeyes' Pettenò\"\n>>         <flameeyes@gentoo.org>.\n>> \n>> with (wrong):\n>> \n>>         * configure.in: Fix -Wno-pointer-sign test to respect user-defined\n>>           CFLAGS.  Reported\n>> \n>> The git log do seem to contain the correct data, though, from git-log:\n>> \n>>     Fix -Wno-pointer-sign test to respect user-defined CFLAGS.  Reported\n>>     by \"Diego 'Flameeyes' Pettenò\" <flameeyes@gentoo.org>.\n>\n> No charset problem. In Git commit messages, the first line is special. It \n> is the so called \"oneline\" description. If you wrap the oneline, it's your \n> fault, not Git's.\n\nI suspect that oneline mode in pretty_print_commit() _could_\ntreat the first line specially, by grabbing the first paragraph\nand squashing LF into SP.  Commit messages that follow the\nkernel convention (which matches well with what applymbox and am\ncreates) would always have a single line in the first paragraph,\nso there is no change in behaviour, while commits that lack the\nempty line on the second line, most often seen in cvsimport,\nwould get something a bit more readable than the status quo.\n\nNot that I care too deeply about it.\n"},{"id":"36048","messageId":"7vslcoghcd.fsf@assigned-by-dhcp.cox.net","threadId":"6994","inReplyTo":"Pine.LNX.4.63.0702281343200.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] --amend Rename --pretty=changelog to --pretty=gnucl","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-03-02T08:49:54Z","receivedAt":"2007-03-02T08:49:54Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Is it just me or is your word wrapper misbehaving?  Notice the\nline that ends with read-cache.c, and the line the comes after\nit, in the sample output.\n\n$ ./git show -s --pretty=gnucl ':/convert object type h'\n2007-02-26  Nicolas Pitre <nico@cam.org>\n\n        * archive-tar.c, archive-zip.c, blob.c, builtin-apply.c,\n          builtin-blame.c, builtin-cat-file.c, builtin-commit-tree.c,\n          builtin-for-each-ref.c, builtin-grep.c, builtin-log.c,\n          builtin-pack-objects.c, builtin-prune.c, builtin-reflog.c,\n          builtin-unpack-objects.c, cache.h, combine-diff.c, commit.c,\n          convert-objects.c, diff.c, entry.c, fast-import.c, http-push.c,\n          index-pack.c, merge-file.c, merge-recursive.c, merge-tree.c,\n          mktag.c, mktree.c, object.c, object.h, pack-check.c, read-cache.c\n           sha1_file.c, tag.c, tree-diff.c, tree.c, unpack-file.c: convert\n          object type handling from a string to a number\n"},{"id":"36053","messageId":"87hct4roqa.fsf@latte.josefsson.org","threadId":"6994","inReplyTo":"Pine.LNX.4.63.0703011912090.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] Add --pretty=changelog","fromName":"Simon Josefsson","fromEmail":"simon@josefsson.org","sentAt":"2007-03-02T09:14:53Z","receivedAt":"2007-03-02T09:14:53Z","isPatch":true,"sender":{"key":"simon@josefsson.org","avatar":"https://gravatar.com/avatar/bbcf4eaca84bcb1c3d191a2d8868291127d072e3ed2cc92e8b835d8a009020d8?d=mp&s=160"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n>> 1) Indentation should be under the '*'.  Compare (wrong):\n>> \n>>         * src/asn1Coding.c, src/asn1Decoding.c, src/asn1Parser.c: Improve\n>>           --help output.  Assume getopt_long, since gnulib provides it.\n>\n> I saw that in your mail already, and I find the style cvs2cl outputs ugly.\n\nWell, if you don't follow the GNU ChangeLog format, then please call\nit something else.  The format is well documented.\n\n>> 2) Don't log anything for empty messages:\n>> \n>>         * gl/.cvsignore: *** empty log message ***\n>> \n>> Possibly, this should be an option.\n>\n> It does not log anything for empty messages. Not even a colon.\n\nThe problem here is that CVS insert '*** empty log message ***' when\nyou didn't supply a log message, and doing something intelligent with\nsuch logs would be useful.  Plenty of projects that needs cvs2cl\nfunctionality will be coming from the cvs world.\n\nThere is plenty of functionality in cvs2cl that I believe a proper\ngit2cl should support, handling empty CVS commit messages is one,\nothers would include ignoring files based on a regexp, output in XML\nformat, put ChangeLog's in sub-directories, show branches and tags.\n\n>> 3) Possible charset problem?  Compare this (correct):\n>> \n>>         * configure.in: Fix -Wno-pointer-sign test to respect user-defined\n>>         CFLAGS.  Reported by \"Diego 'Flameeyes' Pettenò\"\n>>         <flameeyes@gentoo.org>.\n>> \n>> with (wrong):\n>> \n>>         * configure.in: Fix -Wno-pointer-sign test to respect user-defined\n>>           CFLAGS.  Reported\n>> \n>> The git log do seem to contain the correct data, though, from git-log:\n>> \n>>     Fix -Wno-pointer-sign test to respect user-defined CFLAGS.  Reported\n>>     by \"Diego 'Flameeyes' Pettenò\" <flameeyes@gentoo.org>.\n>\n> No charset problem. In Git commit messages, the first line is special. It \n> is the so called \"oneline\" description. If you wrap the oneline, it's your \n> fault, not Git's.\n\nBut I want more than the oneline comment in the ChangeLog?  There is\nno size limit on ChangeLog messages, and having as much information as\npossible available is better.\n\nAnyway, for now I'll be settling with the (just announced) git2cl\nsince it gives me the most flexibility.  If/when git core includes\nyour patch later on, and some of my pet problems are fixed, and my\ndistribution catches up, I'll be back.\n\n/Simon\n"},{"id":"36058","messageId":"7vejo8ezde.fsf@assigned-by-dhcp.cox.net","threadId":"6994","inReplyTo":"87hct4roqa.fsf@latte.josefsson.org","subject":"Re: [PATCH] Add --pretty=changelog","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-03-02T10:03:25Z","receivedAt":"2007-03-02T10:03:25Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Simon Josefsson <simon@josefsson.org> writes:\n\n> The problem here is that CVS insert '*** empty log message ***' when\n> you didn't supply a log message, and doing something intelligent with\n> such logs would be useful.\n\nIf that is indeed the case then I suspect that cvs-to-git\nconversion should know about it and strip the artificial\nstring.\n\nIn any case, as I already said a few times in this thread, I\nthink what you did is the right approach --- to read from \"git\nlog --numstat\" output and format the output to match the precise\ndetail of your project's liking with an external script.\n\n> But I want more than the oneline comment in the ChangeLog?  There is\n> no size limit on ChangeLog messages, and having as much information as\n> possible available is better.\n\nI think this was purely underspecification when your request was\npassed to Johannes.\n\nI've merged Johannes's gnucl series to 'next' but haven't pushed\nout, so I'll revert it.\n"},{"id":"36060","messageId":"87abywrly0.fsf@latte.josefsson.org","threadId":"6994","inReplyTo":"7vejo8ezde.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Add --pretty=changelog","fromName":"Simon Josefsson","fromEmail":"simon@josefsson.org","sentAt":"2007-03-02T10:15:03Z","receivedAt":"2007-03-02T10:15:03Z","isPatch":true,"sender":{"key":"simon@josefsson.org","avatar":"https://gravatar.com/avatar/bbcf4eaca84bcb1c3d191a2d8868291127d072e3ed2cc92e8b835d8a009020d8?d=mp&s=160"},"body":"Junio C Hamano <junkio@cox.net> writes:\n\n> Simon Josefsson <simon@josefsson.org> writes:\n>\n>> The problem here is that CVS insert '*** empty log message ***' when\n>> you didn't supply a log message, and doing something intelligent with\n>> such logs would be useful.\n>\n> If that is indeed the case then I suspect that cvs-to-git\n> conversion should know about it and strip the artificial\n> string.\n\nYes, actually, that seems like a better solution.\n\nBtw, there is a custom to work around cvs translating empty log\nmessages into '*** empty log message ***' strings, and that is to\ncommit a log consisting of '.'.  Translating both of those cvs log\nmessages into a '' git log message, during cvs-import, seems like a\nuseful change.\n\n>> But I want more than the oneline comment in the ChangeLog?  There is\n>> no size limit on ChangeLog messages, and having as much information as\n>> possible available is better.\n>\n> I think this was purely underspecification when your request was\n> passed to Johannes.\n>\n> I've merged Johannes's gnucl series to 'next' but haven't pushed\n> out, so I'll revert it.\n\nSorry for the trouble!\n\nAlso thanks, Johannes, for working so quickly on this.  Seeing the\nfirst version of the ChangeLog output from your patched git allowed me\nto realize that the imported cvs history seemed ok.  After replacing\n'cvs2cl' and 'cvsco' I couldn't find any other more cvs-specific\nfeatures in the project.  I have just released the first version of\nlibtasn1 from git instead of cvs.  More projects will follow...\n\n/Simon\n"},{"id":"36088","messageId":"Pine.LNX.4.63.0703021419520.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6994","inReplyTo":"87hct4roqa.fsf@latte.josefsson.org","subject":"Re: [PATCH] Add --pretty=changelog","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-03-02T14:09:49Z","receivedAt":"2007-03-02T14:09:49Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Fri, 2 Mar 2007, Simon Josefsson wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> > I saw that in your mail already, and I find the style cvs2cl outputs \n> > ugly.\n> \n> Well, if you don't follow the GNU ChangeLog format, then please call it \n> something else.  The format is well documented.\n\nWell, it is still ugly. I mean, really ugly. Like in \"it's easier to \nscript, therefore I don't fix it\" ugly.\n\nAnd yes, the format is well documented. For example, it includes the \nfunction names in brackets, which both my patch and cvs2cl do not do. \nThese function names actually got me interested, and I would have tried to \ngenerate them automatically, too.\n\n> > No charset problem. In Git commit messages, the first line is special. \n> > It is the so called \"oneline\" description. If you wrap the oneline, \n> > it's your fault, not Git's.\n> \n> But I want more than the oneline comment in the ChangeLog?  There is no \n> size limit on ChangeLog messages, and having as much information as \n> possible available is better.\n\nWith Git, it is encouraged that you write useful commit messages. There \nare commits where the patch consists of just a line change, and the \nmessage of a really long text. For a good example, look at commit \nv1.4.0-rc1~50: the commit message has 49 lines of text, but the patch only \nchanges 5 lines.\n\nIf you are serious about \"having as much information\", include the \n_complete_ commit message.\n\n> Anyway, for now I'll be settling with the (just announced) git2cl since \n> it gives me the most flexibility.\n\nIn hindsight I agree with Junio that a script is better for this purpose. \nAt least I tricked you into writing it yourself.\n\n> If/when git core includes your patch later on, and some of my pet \n> problems are fixed, and my distribution catches up, I'll be back.\n\nFWIW I am now opposed to inclusion of --pretty=gnucl.\n\nCiao,\nDscho\n"},{"id":"36089","messageId":"Pine.LNX.4.63.0703021526210.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6994","inReplyTo":"7vslcoghcd.fsf@assigned-by-dhcp.cox.net","subject":"[PATCH] print_wrapped_text: fix output for negative indent","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-03-02T14:28:00Z","receivedAt":"2007-03-02T14:28:00Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nWhen providing a negative indent, it means that -indent columns were\nalready printed. Fix a bug where the function ate the first character\nif already the first word did not fit into the first line.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n\tOn Fri, 2 Mar 2007, Junio C Hamano wrote:\n\n\t> Is it just me or is your word wrapper misbehaving?\n\n\tIt was. It separated printing of the file name and of the comma. \n\tThis is fixed with my next reply, but it triggered this small\n\tbug.\n\n utf8.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/utf8.c b/utf8.c\nindex ea23a6e..9e1a6d4 100644\n--- a/utf8.c\n+++ b/utf8.c\n@@ -268,7 +268,7 @@ int print_wrapped_text(const char *text, int indent, int indent2, int width)\n \t\t\t}\n \t\t\telse {\n \t\t\t\tputchar('\\n');\n-\t\t\t\ttext = bol = space + 1;\n+\t\t\t\ttext = bol = space + isspace(*space);\n \t\t\t\tspace = NULL;\n \t\t\t\tw = indent = indent2;\n \t\t\t}\n-- \n1.5.0.2.780.g57e5-dirty\n"},{"id":"36090","messageId":"Pine.LNX.4.63.0703021528590.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6994","inReplyTo":"7vslcoghcd.fsf@assigned-by-dhcp.cox.net","subject":"[PATCH] --pretty=gnucl: avoid line wrapping before the comma","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-03-02T14:29:08Z","receivedAt":"2007-03-02T14:29:08Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nEarlier, this code played dumb by outputting the file name and the comma\nseparately (to make it easier to determine when to output a colon\ninstead of the comma). This misguided code is fixed by this patch.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n\n\tI know that this is a dead topic branch, but I did not want\n\tto leave buggy code behind for future reference.\n\n diff.c |   60 ++++++++++++++++++++++++++++++++++++------------------------\n 1 files changed, 36 insertions(+), 24 deletions(-)\n\ndiff --git a/diff.c b/diff.c\nindex 9f9cb34..d33242a 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -1851,52 +1851,64 @@ static void run_checkdiff(struct diff_filepair *p, struct diff_options *o)\n \n struct changelog_t {\n \tint offset, seen_first;\n+\tchar buffer[1024];\n };\n \n+static void flush_changelog_file_entry(struct changelog_t *log, char delim) {\n+\tif (!log->seen_first) {\n+\t\tlog->offset = print_wrapped_text(\"* \", -CHANGELOG_TAB_SIZE,\n+\t\t\t\tCHANGELOG_TAB_SIZE + 2, CHANGELOG_WIDTH);\n+\t\tlog->seen_first = 1;\n+\t}\n+\n+\tif (log->buffer[0]) {\n+\t\tint len = strlen(log->buffer);\n+\t\tif (len + 3 < sizeof(log->buffer)) {\n+\t\t\tlog->buffer[len++] = delim;\n+\t\t\tlog->buffer[len++] = ' ';\n+\t\t\tlog->buffer[len++] = '\\0';\n+\t\t} else\n+\t\t\twarn(\"Line too long: skipping delimiter\");\n+\n+\t\tlog->offset = print_wrapped_text(log->buffer, -log->offset,\n+\t\t\t\tCHANGELOG_TAB_SIZE + 2, CHANGELOG_WIDTH);\n+\t\tlog->buffer[0] = '\\0';\n+\t}\n+}\n+\n static void run_changelog(struct diff_filepair *p, struct diff_options *o,\n-\tstruct changelog_t *changelog)\n+\tstruct changelog_t *log)\n {\n \tconst char *name;\n \tconst char *other;\n-\tstatic char buffer[1024];\n \n \tif (DIFF_PAIR_UNMERGED(p)) {\n \t\t/* unmerged */\n \t\treturn;\n \t}\n \n-\tif (changelog->seen_first)\n-\t\tbuffer[0] = ',';\n-\telse {\n-\t\tbuffer[0] = '*';\n-\t\tchangelog->offset = -CHANGELOG_TAB_SIZE;\n-\t\tchangelog->seen_first = 1;\n-\t}\n-\n \tname = p->one->path;\n \tother = p->two->path;\n \n-\tif (!name) {\n-\t\tif (!other)\n-\t\t\treturn;\n-\t\tsnprintf(buffer + 1, sizeof(buffer) - 1, \" %s\", other);\n-\t} else if (!other || !strcmp(name, other))\n-\t\tsnprintf(buffer + 1, sizeof(buffer) - 1, \" %s\", name);\n+\tif (!name && !other)\n+\t\treturn;\n+\n+\tflush_changelog_file_entry(log, ',');\n+\tif (!name)\n+\t\tsnprintf(log->buffer, sizeof(log->buffer), \"%s\", other);\n+\telse if (!other || !strcmp(name, other))\n+\t\tsnprintf(log->buffer, sizeof(log->buffer), \"%s\", name);\n \telse\n-\t\tsnprintf(buffer + 1, sizeof(buffer) - 1, \" %s => %s\",\n+\t\tsnprintf(log->buffer, sizeof(log->buffer), \"%s => %s\",\n \t\t\t\tname, other);\n-\tchangelog->offset = print_wrapped_text(buffer, -changelog->offset,\n-\t\tCHANGELOG_TAB_SIZE + 2, CHANGELOG_WIDTH);\n }\n \n static void finalize_changelog(struct diff_options *options,\n \t\tstruct changelog_t *changelog)\n {\n-\tif (!options->stat_sep)\n-\t\treturn;\n-\tchangelog->offset = print_wrapped_text(\": \", -changelog->offset,\n-\t\tCHANGELOG_TAB_SIZE + 2, CHANGELOG_WIDTH);\n-\tchangelog->offset = print_wrapped_text(options->stat_sep,\n+\tflush_changelog_file_entry(changelog, ':');\n+\tchangelog->offset = print_wrapped_text(options->stat_sep ?\n+\t\t\toptions->stat_sep : \"*** empty message ***\",\n \t\t\t-changelog->offset,\n \t\t\tCHANGELOG_TAB_SIZE + 2, CHANGELOG_WIDTH);\n }\n-- \n1.5.0.2.780.g57e5-dirty\n"},{"id":"36171","messageId":"7v649icxis.fsf@assigned-by-dhcp.cox.net","threadId":"6994","inReplyTo":"7vslcoghcd.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] --amend Rename --pretty=changelog to --pretty=gnucl","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-03-03T12:38:35Z","receivedAt":"2007-03-03T12:38:35Z","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> Earlier, this code played dumb by outputting the file name and the comma\n> separately (to make it easier to determine when to output a colon\n> instead of the comma). This misguided code is fixed by this patch.\n>\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n>\n> \tI know that this is a dead topic branch, but I did not want\n> \tto leave buggy code behind for future reference.\n\nHuh?  How did you measure bugginess before and after the change?\n\n$ ./git show -s --pretty=gnucl ':/convert object type h'\n2007-02-26  Nicolas Pitre <nico@cam.org>\n\n* archive-tar.c, archive-zip.c, blob.c, builtin-apply.c, \n          uiltin-blame.c, builtin-cat-file.c, builtin-commit-tree.c, \n          uiltin-for-each-ref.c, builtin-grep.c, builtin-log.c, \n          uiltin-pack-objects.c, builtin-prune.c, builtin-reflog.c, \n          uiltin-unpack-objects.c, cache.h, combine-diff.c, commit.c, \n          onvert-objects.c, diff.c, entry.c, fast-import.c, http-push.c, \n          ndex-pack.c, merge-file.c, merge-recursive.c, merge-tree.c, \n          ktag.c, mktree.c, object.c, object.h, pack-check.c, read-cache.c,\n          sha1_file.c, tag.c, tree-diff.c, tree.c, unpack-file.c: convert\n          object type handling from a string to a number\n\n\nPerhaps you would want something like this...\n\ndiff --git a/utf8.c b/utf8.c\nindex ea23a6e..3a7b923 100644\n--- a/utf8.c\n+++ b/utf8.c\n@@ -268,7 +268,9 @@ int print_wrapped_text(const char *text, int indent, int indent2, int width)\n \t\t\t}\n \t\t\telse {\n \t\t\t\tputchar('\\n');\n-\t\t\t\ttext = bol = space + 1;\n+\t\t\t\tif (isspace(*space))\n+\t\t\t\t\tspace++;\n+\t\t\t\ttext = bol = space;\n \t\t\t\tspace = NULL;\n \t\t\t\tw = indent = indent2;\n \t\t\t}\n"},{"id":"36178","messageId":"877ityquud.fsf@latte.josefsson.org","threadId":"6994","inReplyTo":"Pine.LNX.4.63.0703021419520.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] Add --pretty=changelog","fromName":"Simon Josefsson","fromEmail":"simon@josefsson.org","sentAt":"2007-03-03T14:12:42Z","receivedAt":"2007-03-03T14:12:42Z","isPatch":true,"sender":{"key":"simon@josefsson.org","avatar":"https://gravatar.com/avatar/bbcf4eaca84bcb1c3d191a2d8868291127d072e3ed2cc92e8b835d8a009020d8?d=mp&s=160"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> Hi,\n>\n> On Fri, 2 Mar 2007, Simon Josefsson wrote:\n>\n>> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n>> \n>> > I saw that in your mail already, and I find the style cvs2cl outputs \n>> > ugly.\n>> \n>> Well, if you don't follow the GNU ChangeLog format, then please call it \n>> something else.  The format is well documented.\n>\n> Well, it is still ugly. I mean, really ugly. Like in \"it's easier to \n> script, therefore I don't fix it\" ugly.\n>\n> And yes, the format is well documented. For example, it includes the \n> function names in brackets, which both my patch and cvs2cl do not do. \n> These function names actually got me interested, and I would have tried to \n> generate them automatically, too.\n\nIncluding the function names in brackets is optional, but the wrap\nstyle is inherent in the format.\n\nHowever, it sounds like a nice idea to automatically add function\nnames when there aren't too many of them.  Possibly one should be able\nto use a regexp to restrict the set of function names (useful, e.g.,\nfor only having brackets for public API functions).  I recall that\n\"diff\" has an option to print C function names in patches, maybe that\ncould be used.\n\n>> > No charset problem. In Git commit messages, the first line is special. \n>> > It is the so called \"oneline\" description. If you wrap the oneline, \n>> > it's your fault, not Git's.\n>> \n>> But I want more than the oneline comment in the ChangeLog?  There is no \n>> size limit on ChangeLog messages, and having as much information as \n>> possible available is better.\n>\n> With Git, it is encouraged that you write useful commit messages. There \n> are commits where the patch consists of just a line change, and the \n> message of a really long text. For a good example, look at commit \n> v1.4.0-rc1~50: the commit message has 49 lines of text, but the patch only \n> changes 5 lines.\n>\n> If you are serious about \"having as much information\", include the \n> _complete_ commit message.\n\nYes, I do want the complete commit message.  While 49 lines of\nChangeLog entry is a lot, it is not completely unheard of.  Although\nthe recommendation in the GNU ChangeLog specification to move such\nlengthy discussions to manuals or source code comments is often good.\n\n>> Anyway, for now I'll be settling with the (just announced) git2cl since \n>> it gives me the most flexibility.\n>\n> In hindsight I agree with Junio that a script is better for this purpose. \n\nYup, I think it will be more flexible to keep it outside of git.  It\nmakes it easier to do some un-git-ish things (like handling those\n\"empty\" CVS log messages).\n\n/Simon\n"},{"id":"36179","messageId":"Pine.LNX.4.63.0703031511300.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6994","inReplyTo":"7v649icxis.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] --amend Rename --pretty=changelog to --pretty=gnucl","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-03-03T14:13:19Z","receivedAt":"2007-03-03T14:13:19Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sat, 3 Mar 2007, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> > Earlier, this code played dumb by outputting the file name and the comma\n> > separately (to make it easier to determine when to output a colon\n> > instead of the comma). This misguided code is fixed by this patch.\n> >\n> > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> > ---\n> >\n> > \tI know that this is a dead topic branch, but I did not want\n> > \tto leave buggy code behind for future reference.\n> \n> Huh?  How did you measure bugginess before and after the change?\n> \n> $ ./git show -s --pretty=gnucl ':/convert object type h'\n> 2007-02-26  Nicolas Pitre <nico@cam.org>\n> \n> * archive-tar.c, archive-zip.c, blob.c, builtin-apply.c, \n>           uiltin-blame.c, builtin-cat-file.c, builtin-commit-tree.c, \n>           uiltin-for-each-ref.c, builtin-grep.c, builtin-log.c, \n>           uiltin-pack-objects.c, builtin-prune.c, builtin-reflog.c, \n>           uiltin-unpack-objects.c, cache.h, combine-diff.c, commit.c, \n>           onvert-objects.c, diff.c, entry.c, fast-import.c, http-push.c, \n>           ndex-pack.c, merge-file.c, merge-recursive.c, merge-tree.c, \n>           ktag.c, mktree.c, object.c, object.h, pack-check.c, read-cache.c,\n>           sha1_file.c, tag.c, tree-diff.c, tree.c, unpack-file.c: convert\n>           object type handling from a string to a number\n\nFor me, it is\n\n$ ./git show -s --pretty=gnucl ':/convert object type h'\n2007-02-26  Nicolas Pitre <nico@cam.org>\n\n* archive-tar.c, archive-zip.c, blob.c, builtin-apply.c,\n          builtin-blame.c, builtin-cat-file.c, builtin-commit-tree.c,\n          builtin-for-each-ref.c, builtin-grep.c, builtin-log.c,\n          builtin-pack-objects.c, builtin-prune.c, builtin-reflog.c,\n          builtin-unpack-objects.c, cache.h, combine-diff.c, commit.c,\n          convert-objects.c, diff.c, entry.c, fast-import.c, http-push.c,\n          index-pack.c, merge-file.c, merge-recursive.c, merge-tree.c,\n          mktag.c, mktree.c, object.c, object.h, pack-check.c,\n          read-cache.c, sha1_file.c, tag.c, tree-diff.c, tree.c,\n          unpack-file.c: convert object type handling from a string to a\n          number\n\n> Perhaps you would want something like this...\n> \n> diff --git a/utf8.c b/utf8.c\n> index ea23a6e..3a7b923 100644\n> --- a/utf8.c\n> +++ b/utf8.c\n> @@ -268,7 +268,9 @@ int print_wrapped_text(const char *text, int indent, int indent2, int width)\n>  \t\t\t}\n>  \t\t\telse {\n>  \t\t\t\tputchar('\\n');\n> -\t\t\t\ttext = bol = space + 1;\n> +\t\t\t\tif (isspace(*space))\n> +\t\t\t\t\tspace++;\n> +\t\t\t\ttext = bol = space;\n>  \t\t\t\tspace = NULL;\n>  \t\t\t\tw = indent = indent2;\n>  \t\t\t}\n\n... or something like in\n\n$ git show ':/print_wrapped_text: fix output for negative indent'\n\n?\n\nCiao,\nDscho\n"},{"id":"36200","messageId":"7vlkie9jm8.fsf@assigned-by-dhcp.cox.net","threadId":"6994","inReplyTo":"Pine.LNX.4.63.0703031511300.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] --amend Rename --pretty=changelog to --pretty=gnucl","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-03-03T20:07:11Z","receivedAt":"2007-03-03T20:07:11Z","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> $ git show ':/print_wrapped_text: fix output for negative indent'\n\nI forgot that your patch is relative to 'next'.  Silly me.\n\nI cannot fork a topic directly from 'next', but I always test\ntopics in isolation first.  And I forgot that this topic\ndepended on that fix.\n"}]}