{"thread":{"id":"19381","subject":"[RFC/PATCH] completion: complete pretty format placeholders","startedAt":"2009-05-16T10:07:29Z","lastAt":"2009-05-21T03:59:00Z","messageCount":3,"participants":["Stephen Boyd","Shawn O. Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"114088","messageId":"1242468449-3364-1-git-send-email-bebarino@gmail.com","threadId":"19381","inReplyTo":null,"subject":"[RFC/PATCH] completion: complete pretty format placeholders","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2009-05-16T10:07:29Z","receivedAt":"2009-05-16T10:07:29Z","isPatch":true,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"---\n\n This seems to work most of the time.\n\n This\n    git log --pretty=format:%ad:%<TAB>\n becomes\n    git log --pretty=format:%ad:%ad:% \n which is wrong.\n\n But in quotes\n    git log --pretty=format:\"%ad:%<TAB>\n works.\n\n I'm not sure why.\n \n Also git log --pretty=%<TAB> doesn't work. I'm not sure how to support\n that without encountering the same breakage as above.\n\n contrib/completion/git-completion.bash |   25 +++++++++++++++++++++++++\n 1 files changed, 25 insertions(+), 0 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex ad26b7c..3819c73 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -1117,6 +1117,9 @@ __git_log_shortlog_options=\"\n \n __git_log_pretty_formats=\"oneline short medium full fuller email raw format:\"\n __git_log_date_formats=\"relative iso8601 rfc2822 short local default raw\"\n+__git_log_format_placeholders=\"ad aD ae aE ai an aN ar at b Cblue cd cD ce cE\n+Cgreen ci cn cN cr Cred Creset ct d e f h H m n p P s t T x\n+\"\n \n _git_log ()\n {\n@@ -1129,6 +1132,17 @@ _git_log ()\n \t\tmerge=\"--merge\"\n \tfi\n \tcase \"$cur\" in\n+\t--pretty=format:*%*|--format=format:*%*)\n+\t\tlocal pfx=\"${cur%\\%*}%\"\n+\t\tpfx=\"${pfx#*:}\"\n+\t\tcur=\"${cur##*%}\"\n+\t\t__gitcomp \"$__git_log_format_placeholders\n+\t\t\t\" \"$pfx\" \"$cur\"\n+\t\treturn\n+\t\t;;\n+\t--pretty=format:*|--format=format:*)\n+\t\treturn\n+\t\t;;\n \t--pretty=*)\n \t\t__gitcomp \"$__git_log_pretty_formats\n \t\t\t\" \"\" \"${cur##--pretty=}\"\n@@ -1814,6 +1828,17 @@ _git_show ()\n \n \tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\"\n \tcase \"$cur\" in\n+\t--pretty=format:*%*|--format=format:*%*)\n+\t\tlocal pfx=\"${cur%\\%*}%\"\n+\t\tpfx=\"${pfx#*:}\"\n+\t\tcur=\"${cur##*%}\"\n+\t\t__gitcomp \"$__git_log_format_placeholders\n+\t\t\t\" \"$pfx\" \"$cur\"\n+\t\treturn\n+\t\t;;\n+\t--pretty=format:*|--format=format:*)\n+\t\treturn\n+\t\t;;\n \t--pretty=*)\n \t\t__gitcomp \"$__git_log_pretty_formats\n \t\t\t\" \"\" \"${cur##--pretty=}\"\n-- \n1.6.3.1.9.g95405b\n"},{"id":"114375","messageId":"20090520225258.GT30527@spearce.org","threadId":"19381","inReplyTo":"1242468449-3364-1-git-send-email-bebarino@gmail.com","subject":"Re: [RFC/PATCH] completion: complete pretty format placeholders","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2009-05-20T22:52:58Z","receivedAt":"2009-05-20T22:52:58Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Stephen Boyd <bebarino@gmail.com> wrote:\n>  This seems to work most of the time.\n> \n>  This\n>     git log --pretty=format:%ad:%<TAB>\n>  becomes\n>     git log --pretty=format:%ad:%ad:% \n>  which is wrong.\n> \n>  But in quotes\n>     git log --pretty=format:\"%ad:%<TAB>\n>  works.\n> \n>  I'm not sure why.\n\nbash oddity?  Back when I started the completion I had a lot\nof trouble with stuff like --pretty=<TAB>, or foo:<TAB> because\nbash more often than not tried to second guess what I was doing.\nI wonder if you are running against that here.\n  \n> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\n> index ad26b7c..3819c73 100755\n> --- a/contrib/completion/git-completion.bash\n> +++ b/contrib/completion/git-completion.bash\n> @@ -1117,6 +1117,9 @@ __git_log_shortlog_options=\"\n>  \n>  __git_log_pretty_formats=\"oneline short medium full fuller email raw format:\"\n>  __git_log_date_formats=\"relative iso8601 rfc2822 short local default raw\"\n> +__git_log_format_placeholders=\"ad aD ae aE ai an aN ar at b Cblue cd cD ce cE\n> +Cgreen ci cn cN cr Cred Creset ct d e f h H m n p P s t T x\n> +\"\n\nTo be honest, I'm not sure what value this provides.  Its just as\nmany characters to type, isn't it, and it doesn't offer me any help\nas to which placeholder should be inserted to get the value I want.\n\"Was it ae or aE that I wanted here?  WTF, manpage time!\".\n  \n-- \nShawn.\n"},{"id":"114387","messageId":"4A14D184.8030301@gmail.com","threadId":"19381","inReplyTo":"20090520225258.GT30527@spearce.org","subject":"Re: [RFC/PATCH] completion: complete pretty format placeholders","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2009-05-21T03:59:00Z","receivedAt":"2009-05-21T03:59:00Z","isPatch":true,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"Shawn O. Pearce wrote:\n> bash oddity?  Back when I started the completion I had a lot\n> of trouble with stuff like --pretty=<TAB>, or foo:<TAB> because\n> bash more often than not tried to second guess what I was doing.\n> I wonder if you are running against that here.\n\nThanks for the heads up.\n\n> To be honest, I'm not sure what value this provides.  Its just as\n> many characters to type, isn't it, and it doesn't offer me any help\n> as to which placeholder should be inserted to get the value I want.\n> \"Was it ae or aE that I wanted here?  WTF, manpage time!\".\n\nYeah, you're probably right. Throw it on the dust pile ;-)\n"}]}