{"thread":{"id":"17989","subject":"[PATCH 3/3] Add --oneline that is a synonym to \"--pretty=oneline --abbrev-commit\"","startedAt":"2009-02-24T09:59:13Z","lastAt":"2009-02-27T18:53:58Z","messageCount":17,"participants":["Nanako Shiraishi","Teemu Likonen","Shawn O. Pearce","Junio C Hamano","Felipe Contreras","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"106041","messageId":"20090224185913.6117@nanako3.lavabit.com","threadId":"17989","inReplyTo":"20090224054524.GE4615@coredump.intra.peff.net","subject":"[PATCH 0/3] --format, --pretty and --oneline","fromName":"Nanako Shiraishi","fromEmail":"nanako3@lavabit.com","sentAt":"2009-02-24T09:59:13Z","receivedAt":"2009-02-24T09:59:13Z","isPatch":true,"sender":{"key":"nanako3@lavabit.com","avatar":"https://gravatar.com/avatar/3777b9e201c5883a62b1a6fdf7c53f2d712d1d80989146063ea861e33aad72a8?d=mp&s=160"},"body":"As suggested by Jeff and Junio, this splits my patch into two and\nimplements --oneline as a synonym for --pretty=oneline --abbrev-commit.\n\n-- \nNanako Shiraishi\nhttp://ivory.ap.teacup.com/nanako3/\n"},{"id":"106042","messageId":"20090224185914.6117@nanako3.lavabit.com","threadId":"17989","inReplyTo":"20090224185913.6117@nanako3.lavabit.com","subject":"[PATCH 1/3] Add --format that is a synonym to --pretty","fromName":"Nanako Shiraishi","fromEmail":"nanako3@lavabit.com","sentAt":"2009-02-24T09:59:14Z","receivedAt":"2009-02-24T09:59:14Z","isPatch":true,"sender":{"key":"nanako3@lavabit.com","avatar":"https://gravatar.com/avatar/3777b9e201c5883a62b1a6fdf7c53f2d712d1d80989146063ea861e33aad72a8?d=mp&s=160"},"body":"Some people prefer to call the pretty-print styles \"format\", and get\nannoyed to see \"git log --format=short\" fail.  Introduce it as a synonym\nto --pretty so that both can be used.\n\nSigned-off-by: Nanako Shiraishi <nanako3@lavabit.com>\n---\n Documentation/pretty-options.txt |    1 +\n revision.c                       |    2 +-\n 2 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/pretty-options.txt b/Documentation/pretty-options.txt\nindex 5f21efe..6596019 100644\n--- a/Documentation/pretty-options.txt\n+++ b/Documentation/pretty-options.txt\n@@ -1,4 +1,5 @@\n --pretty[='<format>']::\n+--format[='<format>']::\n \n \tPretty-print the contents of the commit logs in a given format,\n \twhere '<format>' can be one of 'oneline', 'short', 'medium',\ndiff --git a/revision.c b/revision.c\nindex 286e416..556c319 100644\n--- a/revision.c\n+++ b/revision.c\n@@ -1144,7 +1144,7 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg\n \t} else if (!strcmp(arg, \"--pretty\")) {\n \t\trevs->verbose_header = 1;\n \t\tget_commit_format(arg+8, revs);\n-\t} else if (!prefixcmp(arg, \"--pretty=\")) {\n+\t} else if (!prefixcmp(arg, \"--pretty=\") || !prefixcmp(arg, \"--format=\")) {\n \t\trevs->verbose_header = 1;\n \t\tget_commit_format(arg+9, revs);\n \t} else if (!strcmp(arg, \"--graph\")) {\n-- \n1.6.2.rc1\n\n\n-- \nNanako Shiraishi\nhttp://ivory.ap.teacup.com/nanako3/\n"},{"id":"106043","messageId":"20090224185915.6117@nanako3.lavabit.com","threadId":"17989","inReplyTo":"20090224185913.6117@nanako3.lavabit.com","subject":"[PATCH 2/3] Give short-hands to --pretty=tformat:%formatstring","fromName":"Nanako Shiraishi","fromEmail":"nanako3@lavabit.com","sentAt":"2009-02-24T09:59:15Z","receivedAt":"2009-02-24T09:59:15Z","isPatch":true,"sender":{"key":"nanako3@lavabit.com","avatar":"https://gravatar.com/avatar/3777b9e201c5883a62b1a6fdf7c53f2d712d1d80989146063ea861e33aad72a8?d=mp&s=160"},"body":"Allow --pretty=\"%h %s\" (and --format=\"%h %s\") as shorthand for an often\nused option --pretty=tformat:\"%h %s\".\n\nSigned-off-by: Nanako Shiraishi <nanako3@lavabit.com>\n---\n Documentation/pretty-formats.txt |    9 +++++++++\n pretty.c                         |   20 ++++++++++++++------\n 2 files changed, 23 insertions(+), 6 deletions(-)\n\ndiff --git a/Documentation/pretty-formats.txt b/Documentation/pretty-formats.txt\nindex 159390c..5c6e678 100644\n--- a/Documentation/pretty-formats.txt\n+++ b/Documentation/pretty-formats.txt\n@@ -152,3 +152,12 @@ $ git log -2 --pretty=tformat:%h 4da45bef \\\n 4da45be\n 7134973\n ---------------------\n++\n+In addition, any unrecognized string that has a `%` in it is interpreted\n+as if it has `tformat:` in front of it.  For example, these two are\n+equivalent:\n++\n+---------------------\n+$ git log -2 --pretty=tformat:%h 4da45bef\n+$ git log -2 --pretty=%h 4da45bef\n+---------------------\ndiff --git a/pretty.c b/pretty.c\nindex 6cd9149..d739f6d 100644\n--- a/pretty.c\n+++ b/pretty.c\n@@ -10,6 +10,15 @@\n \n static char *user_format;\n \n+static void save_user_format(struct rev_info *rev, const char *cp, int is_tformat)\n+{\n+\tfree(user_format);\n+\tuser_format = xstrdup(cp);\n+\tif (is_tformat)\n+\t\trev->use_terminator = 1;\n+\trev->commit_format = CMIT_FMT_USERFORMAT;\n+}\n+\n void get_commit_format(const char *arg, struct rev_info *rev)\n {\n \tint i;\n@@ -33,12 +42,7 @@ void get_commit_format(const char *arg, struct rev_info *rev)\n \t\treturn;\n \t}\n \tif (!prefixcmp(arg, \"format:\") || !prefixcmp(arg, \"tformat:\")) {\n-\t\tconst char *cp = strchr(arg, ':') + 1;\n-\t\tfree(user_format);\n-\t\tuser_format = xstrdup(cp);\n-\t\tif (arg[0] == 't')\n-\t\t\trev->use_terminator = 1;\n-\t\trev->commit_format = CMIT_FMT_USERFORMAT;\n+\t\tsave_user_format(rev, strchr(arg, ':') + 1, arg[0] == 't');\n \t\treturn;\n \t}\n \tfor (i = 0; i < ARRAY_SIZE(cmt_fmts); i++) {\n@@ -50,6 +54,10 @@ void get_commit_format(const char *arg, struct rev_info *rev)\n \t\t\treturn;\n \t\t}\n \t}\n+\tif (strchr(arg, '%')) {\n+\t\tsave_user_format(rev, arg, 1);\n+\t\treturn;\n+\t}\n \n \tdie(\"invalid --pretty format: %s\", arg);\n }\n-- \n1.6.2.rc1\n\n-- \nNanako Shiraishi\nhttp://ivory.ap.teacup.com/nanako3/\n"},{"id":"106040","messageId":"20090224185916.6117@nanako3.lavabit.com","threadId":"17989","inReplyTo":"20090224185913.6117@nanako3.lavabit.com","subject":"[PATCH 3/3] Add --oneline that is a synonym to \"--pretty=oneline --abbrev-commit\"","fromName":"Nanako Shiraishi","fromEmail":"nanako3@lavabit.com","sentAt":"2009-02-24T09:59:16Z","receivedAt":"2009-02-24T09:59:16Z","isPatch":true,"sender":{"key":"nanako3@lavabit.com","avatar":"https://gravatar.com/avatar/3777b9e201c5883a62b1a6fdf7c53f2d712d1d80989146063ea861e33aad72a8?d=mp&s=160"},"body":"These two are often used together but are too long to type.\n\nSigned-off-by: Nanako Shiraishi <nanako3@lavabit.com>\n---\n Documentation/pretty-options.txt |    4 ++++\n revision.c                       |    4 ++++\n 2 files changed, 8 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/pretty-options.txt b/Documentation/pretty-options.txt\nindex 6596019..b0ea68a 100644\n--- a/Documentation/pretty-options.txt\n+++ b/Documentation/pretty-options.txt\n@@ -18,6 +18,10 @@ configuration (see linkgit:git-config[1]).\n This should make \"--pretty=oneline\" a whole lot more readable for\n people using 80-column terminals.\n \n+--oneline::\n+\tThis is a shorthand for \"--pretty=oneline --abbrev-commit\"\n+\tused together.\n+\n --encoding[=<encoding>]::\n \tThe commit objects record the encoding used for the log message\n \tin their encoding header; this option can be used to tell the\ndiff --git a/revision.c b/revision.c\nindex 556c319..c4efe5b 100644\n--- a/revision.c\n+++ b/revision.c\n@@ -1147,6 +1147,10 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg\n \t} else if (!prefixcmp(arg, \"--pretty=\") || !prefixcmp(arg, \"--format=\")) {\n \t\trevs->verbose_header = 1;\n \t\tget_commit_format(arg+9, revs);\n+\t} else if (!strcmp(arg, \"--oneline\")) {\n+\t\trevs->verbose_header = 1;\n+\t\tget_commit_format(\"oneline\", revs);\n+\t\trevs->abbrev_commit = 1;\n \t} else if (!strcmp(arg, \"--graph\")) {\n \t\trevs->topo_order = 1;\n \t\trevs->rewrite_parents = 1;\n-- \n1.6.2.rc1\n\n-- \nNanako Shiraishi\nhttp://ivory.ap.teacup.com/nanako3/\n"},{"id":"106046","messageId":"871vtonlmv.fsf_-_@iki.fi","threadId":"17989","inReplyTo":"20090224185913.6117@nanako3.lavabit.com","subject":"[PATCH] bash completion: add --format= and --oneline options for \"git log\"","fromName":"Teemu Likonen","fromEmail":"tlikonen@iki.fi","sentAt":"2009-02-24T11:02:16Z","receivedAt":"2009-02-24T11:02:16Z","isPatch":true,"sender":{"key":"tlikonen@iki.fi","avatar":null},"body":"Signed-off-by: Teemu Likonen <tlikonen@iki.fi>\n---\n\nI like this change and would immediately switch to using --format= and\n--oneline instead of --pretty=. I think we should add these bash\ncompletions too.\n\n\n contrib/completion/git-completion.bash |    7 +++++++\n 1 files changed, 7 insertions(+), 0 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 0a3092f..34396c2 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -1012,10 +1012,15 @@ _git_log ()\n \t--pretty=*)\n \t\t__gitcomp \"$__git_log_pretty_formats\n \t\t\t\" \"\" \"${cur##--pretty=}\"\n \t\treturn\n \t\t;;\n+\t--format=*)\n+\t\t__gitcomp \"$__git_log_pretty_formats\n+\t\t\t\" \"\" \"${cur##--format=}\"\n+\t\treturn\n+\t\t;;\n \t--date=*)\n \t\t__gitcomp \"\n \t\t\trelative iso8601 rfc2822 short local default\n \t\t\" \"\" \"${cur##--date=}\"\n \t\treturn\n@@ -1028,10 +1033,12 @@ _git_log ()\n \t\t\t--root --topo-order --date-order --reverse\n \t\t\t--follow\n \t\t\t--abbrev-commit --abbrev=\n \t\t\t--relative-date --date=\n \t\t\t--pretty=\n+\t\t\t--format=\n+\t\t\t--oneline\n \t\t\t--cherry-pick\n \t\t\t--graph\n \t\t\t--decorate\n \t\t\t--walk-reflogs\n \t\t\t--parents --children\n-- \n1.6.2.rc1.29.g79ccf\n"},{"id":"106049","messageId":"87zlgcq7rq.fsf_-_@iki.fi","threadId":"17989","inReplyTo":"871vtonlmv.fsf_-_@iki.fi","subject":"[PATCH v2] bash completion: add --format= and --oneline options for \"git log\"","fromName":"Teemu Likonen","fromEmail":"tlikonen@iki.fi","sentAt":"2009-02-24T13:33:29Z","receivedAt":"2009-02-24T13:33:29Z","isPatch":true,"sender":{"key":"tlikonen@iki.fi","avatar":null},"body":"We also add --format= completion for \"git show\".\n\nSigned-off-by: Teemu Likonen <tlikonen@iki.fi>\n---\n\nOn 2009-02-24 13:02 (+0200), Teemu Likonen wrote:\n\n> I like this change and would immediately switch to using --format= and\n> --oneline instead of --pretty=. I think we should add these bash\n> completions too.\n\nAnd let's add --format= completion for \"git show\" too. I think --oneline\ncompletion is not needed with \"git show\" even though it works.\n\nThis patch replaces my previous one.\n\n\n\n contrib/completion/git-completion.bash |   14 ++++++++++++--\n 1 files changed, 12 insertions(+), 2 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 0a3092f..31608cb 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -1012,10 +1012,15 @@ _git_log ()\n \t--pretty=*)\n \t\t__gitcomp \"$__git_log_pretty_formats\n \t\t\t\" \"\" \"${cur##--pretty=}\"\n \t\treturn\n \t\t;;\n+\t--format=*)\n+\t\t__gitcomp \"$__git_log_pretty_formats\n+\t\t\t\" \"\" \"${cur##--format=}\"\n+\t\treturn\n+\t\t;;\n \t--date=*)\n \t\t__gitcomp \"\n \t\t\trelative iso8601 rfc2822 short local default\n \t\t\" \"\" \"${cur##--date=}\"\n \t\treturn\n@@ -1027,11 +1032,11 @@ _git_log ()\n \t\t\t$__git_log_gitk_options\n \t\t\t--root --topo-order --date-order --reverse\n \t\t\t--follow\n \t\t\t--abbrev-commit --abbrev=\n \t\t\t--relative-date --date=\n-\t\t\t--pretty=\n+\t\t\t--pretty= --format= --oneline\n \t\t\t--cherry-pick\n \t\t\t--graph\n \t\t\t--decorate\n \t\t\t--walk-reflogs\n \t\t\t--parents --children\n@@ -1539,12 +1544,17 @@ _git_show ()\n \t--pretty=*)\n \t\t__gitcomp \"$__git_log_pretty_formats\n \t\t\t\" \"\" \"${cur##--pretty=}\"\n \t\treturn\n \t\t;;\n+\t--format=*)\n+\t\t__gitcomp \"$__git_log_pretty_formats\n+\t\t\t\" \"\" \"${cur##--format=}\"\n+\t\treturn\n+\t\t;;\n \t--*)\n-\t\t__gitcomp \"--pretty=\n+\t\t__gitcomp \"--pretty= --format=\n \t\t\t$__git_diff_common_options\n \t\t\t\"\n \t\treturn\n \t\t;;\n \tesac\n-- \n1.6.2.rc1.29.g79ccf\n"},{"id":"106063","messageId":"20090224153913.GT22848@spearce.org","threadId":"17989","inReplyTo":"87zlgcq7rq.fsf_-_@iki.fi","subject":"Re: [PATCH v2] bash completion: add --format= and --oneline options for \"git log\"","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2009-02-24T15:39:13Z","receivedAt":"2009-02-24T15:39:13Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Teemu Likonen <tlikonen@iki.fi> wrote:\n> We also add --format= completion for \"git show\".\n> \n> Signed-off-by: Teemu Likonen <tlikonen@iki.fi>\n> ---\n> \n> On 2009-02-24 13:02 (+0200), Teemu Likonen wrote:\n> \n> > I like this change and would immediately switch to using --format= and\n> > --oneline instead of --pretty=. I think we should add these bash\n> > completions too.\n> \n> And let's add --format= completion for \"git show\" too. I think --oneline\n> completion is not needed with \"git show\" even though it works.\n\nWhat version of git supports \"git log --format\" ?\n\n'cause I can't find evidence that it is implemented in any current\nversion that Junio would apply this patch to.\n \n-- \nShawn.\n"},{"id":"106066","messageId":"878wnvbzvd.fsf@iki.fi","threadId":"17989","inReplyTo":"20090224153913.GT22848@spearce.org","subject":"Re: [PATCH v2] bash completion: add --format= and --oneline options for \"git log\"","fromName":"Teemu Likonen","fromEmail":"tlikonen@iki.fi","sentAt":"2009-02-24T15:47:50Z","receivedAt":"2009-02-24T15:47:50Z","isPatch":true,"sender":{"key":"tlikonen@iki.fi","avatar":null},"body":"On 2009-02-24 07:39 (-0800), Shawn O. Pearce wrote:\n\n> Teemu Likonen <tlikonen@iki.fi> wrote:\n>> On 2009-02-24 13:02 (+0200), Teemu Likonen wrote:\n>> \n>> > I like this change and would immediately switch to using --format= and\n>> > --oneline instead of --pretty=. I think we should add these bash\n>> > completions too.\n>> \n>> And let's add --format= completion for \"git show\" too. I think --oneline\n>> completion is not needed with \"git show\" even though it works.\n>\n> What version of git supports \"git log --format\" ?\n>\n> 'cause I can't find evidence that it is implemented in any current\n> version that Junio would apply this patch to.\n\nThis is meant to be a part of Nanako's patch series:\n\n    http://thread.gmane.org/gmane.comp.version-control.git/111278\n"},{"id":"106068","messageId":"20090224155724.GV22848@spearce.org","threadId":"17989","inReplyTo":"878wnvbzvd.fsf@iki.fi","subject":"Re: [PATCH v2] bash completion: add --format= and --oneline options for \"git log\"","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2009-02-24T15:57:24Z","receivedAt":"2009-02-24T15:57:24Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Teemu Likonen <tlikonen@iki.fi> wrote:\n> On 2009-02-24 07:39 (-0800), Shawn O. Pearce wrote:\n> >\n> > What version of git supports \"git log --format\" ?\n> >\n> > 'cause I can't find evidence that it is implemented in any current\n> > version that Junio would apply this patch to.\n> \n> This is meant to be a part of Nanako's patch series:\n> \n>     http://thread.gmane.org/gmane.comp.version-control.git/111278\n\nOh, sorry.  I don't use a threaded client so I missed the\nfact this was attached to her series.\n\nLooks good to me.\n\nAcked-by: Shawn O. Pearce <spearce@spearce.org>\n\n-- \nShawn.\n"},{"id":"106073","messageId":"874oyjbymx.fsf@iki.fi","threadId":"17989","inReplyTo":"20090224155724.GV22848@spearce.org","subject":"Re: [PATCH v2] bash completion: add --format= and --oneline options for \"git log\"","fromName":"Teemu Likonen","fromEmail":"tlikonen@iki.fi","sentAt":"2009-02-24T16:14:30Z","receivedAt":"2009-02-24T16:14:30Z","isPatch":true,"sender":{"key":"tlikonen@iki.fi","avatar":null},"body":"On 2009-02-24 07:57 (-0800), Shawn O. Pearce wrote:\n\n> Teemu Likonen <tlikonen@iki.fi> wrote:\n>> This is meant to be a part of Nanako's patch series:\n>> \n>>     http://thread.gmane.org/gmane.comp.version-control.git/111278\n>\n> Oh, sorry.  I don't use a threaded client so I missed the\n> fact this was attached to her series.\n\nI'm sorry too. That was a good lesson why I should provide enough\ncontext (Gmane link for example) when adding CCs.\n"},{"id":"106084","messageId":"7vljrvhh13.fsf@gitster.siamese.dyndns.org","threadId":"17989","inReplyTo":"20090224185916.6117@nanako3.lavabit.com","subject":"Re: [PATCH 3/3] Add --oneline that is a synonym to \"--pretty=oneline --abbrev-commit\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-02-24T17:38:16Z","receivedAt":"2009-02-24T17:38:16Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nanako Shiraishi <nanako3@lavabit.com> writes:\n\n> These two are often used together but are too long to type.\n>\n> Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>\n> ---\n>  Documentation/pretty-options.txt |    4 ++++\n>  revision.c                       |    4 ++++\n>  2 files changed, 8 insertions(+), 0 deletions(-)\n>\n> diff --git a/Documentation/pretty-options.txt b/Documentation/pretty-options.txt\n> index 6596019..b0ea68a 100644\n> --- a/Documentation/pretty-options.txt\n> +++ b/Documentation/pretty-options.txt\n> @@ -18,6 +18,10 @@ configuration (see linkgit:git-config[1]).\n>  This should make \"--pretty=oneline\" a whole lot more readable for\n>  people using 80-column terminals.\n>  \n> +--oneline::\n> +\tThis is a shorthand for \"--pretty=oneline --abbrev-commit\"\n> +\tused together.\n> +\n>  --encoding[=<encoding>]::\n\nThe --pretty=oneline was one of the things I found that orthogonality\nharmed usability in a big way.  Very nice.\n\nI see Teemu already did bash completion for this series, and I'll take it\nas an Aye.  Any volunteer who wants to add a few tests?\n\nThanks.\n"},{"id":"106102","messageId":"1235509597-18336-1-git-send-email-felipe.contreras@gmail.com","threadId":"17989","inReplyTo":"7vljrvhh13.fsf@gitster.siamese.dyndns.org","subject":"[PATCH] Add tests for git log --pretty, --format and --oneline.","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2009-02-24T21:06:37Z","receivedAt":"2009-02-24T21:06:37Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"More specifically; --pretty=format, tformat and new %foo shortcut.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n t/t4202-log.sh |   40 ++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 40 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t4202-log.sh b/t/t4202-log.sh\nindex 7b976ee..f1287fe 100755\n--- a/t/t4202-log.sh\n+++ b/t/t4202-log.sh\n@@ -37,6 +37,46 @@ test_expect_success setup '\n \n '\n \n+echo -ne \"sixth\\nfifth\\nfourth\\nthird\\nsecond\\ninitial\" > expect\n+test_expect_success 'pretty' '\n+\n+\tgit log --pretty=\"format:%s\" > actual &&\n+\ttest_cmp expect actual\n+'\n+\n+echo -ne \"sixth\\nfifth\\nfourth\\nthird\\nsecond\\ninitial\\n\" > expect\n+test_expect_success 'pretty (tformat)' '\n+\n+\tgit log --pretty=\"tformat:%s\" > actual &&\n+\ttest_cmp expect actual\n+'\n+\n+test_expect_success 'pretty (shortcut)' '\n+\n+\tgit log --pretty=\"%s\" > actual &&\n+\ttest_cmp expect actual\n+'\n+\n+test_expect_success 'format' '\n+\n+\tgit log --format=\"%s\" > actual &&\n+\ttest_cmp expect actual\n+'\n+\n+cat > expect << EOF\n+804a787 sixth\n+394ef78 fifth\n+5d31159 fourth\n+2fbe8c0 third\n+f7dab8e second\n+3a2fdcb initial\n+EOF\n+test_expect_success 'oneline' '\n+\n+\tgit log --oneline > actual &&\n+\ttest_cmp expect actual\n+'\n+\n test_expect_success 'diff-filter=A' '\n \n \tactual=$(git log --pretty=\"format:%s\" --diff-filter=A HEAD) &&\n-- \n1.6.1.3\n"},{"id":"106194","messageId":"7vtz6i4zah.fsf@gitster.siamese.dyndns.org","threadId":"17989","inReplyTo":"1235509597-18336-1-git-send-email-felipe.contreras@gmail.com","subject":"Re: [PATCH] Add tests for git log --pretty, --format and --oneline.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-02-25T09:54:30Z","receivedAt":"2009-02-25T09:54:30Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Felipe Contreras <felipe.contreras@gmail.com> writes:\n\n> More specifically; --pretty=format, tformat and new %foo shortcut.\n>\n> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n> ---\n>  t/t4202-log.sh |   40 ++++++++++++++++++++++++++++++++++++++++\n>  1 files changed, 40 insertions(+), 0 deletions(-)\n\nBecause 4202 seems to be about testing the log functionality and they rely\non correctly working format output to verify other aspects of the\noperation of \"git log\", I initially was not sure if this is the right\nplace to add these new tests.  After looking around I didn't find any\nexisting test that checks the various --pretty output formats that the new\ntests can be added, so this probably is as good a place as any.\n\n> diff --git a/t/t4202-log.sh b/t/t4202-log.sh\n> index 7b976ee..f1287fe 100755\n> --- a/t/t4202-log.sh\n> +++ b/t/t4202-log.sh\n> @@ -37,6 +37,46 @@ test_expect_success setup '\n>  \n>  '\n>  \n> +echo -ne \"sixth\\nfifth\\nfourth\\nthird\\nsecond\\ninitial\" > expect\n> +test_expect_success 'pretty' '\n> +\n> +\tgit log --pretty=\"format:%s\" > actual &&\n> +\ttest_cmp expect actual\n> +'\n> +\n> +echo -ne \"sixth\\nfifth\\nfourth\\nthird\\nsecond\\ninitial\\n\" > expect\n\nWe avoid \"echo -e\" to cater to people whose echo does not like it and\ninstead use printf for things like this.\n\nOther than that, the patch looked Ok.  I queued it with a minor fixup.\n\nThanks.\n"},{"id":"106195","messageId":"20090225095741.GB16357@coredump.intra.peff.net","threadId":"17989","inReplyTo":"7vtz6i4zah.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Add tests for git log --pretty, --format and --oneline.","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-02-25T09:57:41Z","receivedAt":"2009-02-25T09:57:41Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Feb 25, 2009 at 01:54:30AM -0800, Junio C Hamano wrote:\n\n> Because 4202 seems to be about testing the log functionality and they rely\n> on correctly working format output to verify other aspects of the\n> operation of \"git log\", I initially was not sure if this is the right\n> place to add these new tests.  After looking around I didn't find any\n> existing test that checks the various --pretty output formats that the new\n> tests can be added, so this probably is as good a place as any.\n\nt6006?\n\n-Peff\n"},{"id":"106200","messageId":"7vljru4y9j.fsf@gitster.siamese.dyndns.org","threadId":"17989","inReplyTo":"20090225095741.GB16357@coredump.intra.peff.net","subject":"Re: [PATCH] Add tests for git log --pretty, --format and --oneline.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-02-25T10:16:40Z","receivedAt":"2009-02-25T10:16:40Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> On Wed, Feb 25, 2009 at 01:54:30AM -0800, Junio C Hamano wrote:\n>\n>> Because 4202 seems to be about testing the log functionality and they rely\n>> on correctly working format output to verify other aspects of the\n>> operation of \"git log\", I initially was not sure if this is the right\n>> place to add these new tests.  After looking around I didn't find any\n>> existing test that checks the various --pretty output formats that the new\n>> tests can be added, so this probably is as good a place as any.\n>\n> t6006?\n\nGood eyes.  But sorry I've already queued the four patches to 'next' and\npushed the result out.  It probably is not worth moving the tests between\ntwo files as a follow-up patch.\n"},{"id":"106201","messageId":"20090225102024.GA16894@coredump.intra.peff.net","threadId":"17989","inReplyTo":"7vljru4y9j.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Add tests for git log --pretty, --format and --oneline.","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-02-25T10:20:25Z","receivedAt":"2009-02-25T10:20:25Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Feb 25, 2009 at 02:16:40AM -0800, Junio C Hamano wrote:\n\n> >> Because 4202 seems to be about testing the log functionality and they rely\n> >> on correctly working format output to verify other aspects of the\n> >> operation of \"git log\", I initially was not sure if this is the right\n> >> place to add these new tests.  After looking around I didn't find any\n> >> existing test that checks the various --pretty output formats that the new\n> >> tests can be added, so this probably is as good a place as any.\n> >\n> > t6006?\n> \n> Good eyes.  But sorry I've already queued the four patches to 'next' and\n> pushed the result out.  It probably is not worth moving the tests between\n> two files as a follow-up patch.\n\nGood memory; I wrote t6006. ;)\n\nI don't think it is a big deal. I actually thought of it when I read the\noriginal patch but decided not to say anything. t6006 is really about\nexercising the formats themselves, so you could argue that the new tests\ngo just as well in either spot.\n\n-Peff\n"},{"id":"106457","messageId":"87y6vrvhh5.fsf@iki.fi","threadId":"17989","inReplyTo":"87zlgcq7rq.fsf_-_@iki.fi","subject":"Re: [PATCH v2] bash completion: add --format= and --oneline options for \"git log\"","fromName":"Teemu Likonen","fromEmail":"tlikonen@iki.fi","sentAt":"2009-02-27T18:53:58Z","receivedAt":"2009-02-27T18:53:58Z","isPatch":true,"sender":{"key":"tlikonen@iki.fi","avatar":null},"body":"On 2009-02-24 15:33 (+0200), Teemu Likonen wrote:\n\n> We also add --format= completion for \"git show\".\n>\n> Signed-off-by: Teemu Likonen <tlikonen@iki.fi>\n> ---\n\n>  contrib/completion/git-completion.bash |   14 ++++++++++++--\n>  1 files changed, 12 insertions(+), 2 deletions(-)\n\nns/pretty-format topic got merged to \"next\" (e7a7e8a) but my bash\ncompletion patch didn't go there. Is there a specific reason for that?\nThe patch was acked by Shawn.\n\nThe thread is here:\n\nhttp://thread.gmane.org/gmane.comp.version-control.git/110962/focus=111286\n"}]}