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

Re: [RFC/PATCH] completion: complete pretty format placeholders

From
Shawn O. Pearce <spearce@spearce.org>
Date
May 20, 2009, 22:52 UTC
Message-ID
<20090520225258.GT30527@spearce.org>
In-Reply-To
<1242468449-3364-1-git-send-email-bebarino@gmail.com>
Stephen Boyd <bebarino@gmail.com> wrote:
Show 13 quoted lines
>  This seems to work most of the time.
> 
>  This
>     git log --pretty=format:%ad:%<TAB>
>  becomes
>     git log --pretty=format:%ad:%ad:% 
>  which is wrong.
> 
>  But in quotes
>     git log --pretty=format:"%ad:%<TAB>
>  works.
> 
>  I'm not sure why.
bash oddity?  Back when I started the completion I had a lot
of trouble with stuff like --pretty=<TAB>, or foo:<TAB> because
bash more often than not tried to second guess what I was doing.
I wonder if you are running against that here.
  
Show 11 quoted lines
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index ad26b7c..3819c73 100755
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -1117,6 +1117,9 @@ __git_log_shortlog_options="
>  
>  __git_log_pretty_formats="oneline short medium full fuller email raw format:"
>  __git_log_date_formats="relative iso8601 rfc2822 short local default raw"
> +__git_log_format_placeholders="ad aD ae aE ai an aN ar at b Cblue cd cD ce cE
> +Cgreen ci cn cN cr Cred Creset ct d e f h H m n p P s t T x
> +"
To be honest, I'm not sure what value this provides.  Its just as
many characters to type, isn't it, and it doesn't offer me any help
as to which placeholder should be inserted to get the value I want.
"Was it ae or aE that I wanted here?  WTF, manpage time!".
  
-- 
Shawn.
Previous: Stephen BoydNext: Stephen Boyd
Message 2 of 3 in “completion: complete pretty format placeholders”
  1. completion: complete pretty format placeholdersStephen Boyd, May 16, 2009
  2. Shawn O. PearceMay 20, 2009
  3. Stephen BoydMay 21, 2009

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

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