git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "René Scharfe" <rene.scharfe@lsrfire.ath.cx>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: git@vger.kernel.org, gitster@pobox.com
Subject: Re: [PATCH 2/2] pretty=format: Add %d to show decoration
Date: Wed, 09 Apr 2008 23:40:38 +0200	[thread overview]
Message-ID: <47FD37D6.2030506@lsrfire.ath.cx> (raw)
In-Reply-To: <alpine.DEB.1.00.0804071441040.430@eeepc-johanness>

Johannes Schindelin schrieb:
> With this patch, "git log --decorate --pretty=format:%d", shows the 
> name decoration (i.e. whenever a commit matches a ref, that ref's 
> name is shown).

Cute idea. :)

What about objects with multiple decoration?  How about producing a
comma-separated list like git-log does?

How about making %d imply --decorate?  You could load the decorations
lazily when it's first encountered.

> Maybe %d should expand to " (<name decoration>)" instead of "<name 
> decoration>"?

foobar2000 (http://foobar2000.org/) has a kind of music tagging
language, and one of its features might be interesting for us here: you
can group a placeholder and other stuff inside brackets.  The construct
resolves to an empty string if the placeholder is NULL, i.e. in your
example "[ (%d)]" would resolve to either " (the decoration)" or "",
depending on the object having a decoration or not.  (It might be a
better fit for --pretty=format: to use %[ and %].)

By the way, your patch reminds me that I wanted to add a placeholder for
git-describe's output.  I doubt I'll find time for that in the near
future, though..

René

  reply	other threads:[~2008-04-09 21:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-07 13:40 [PATCH 1/2] decorate: use "const struct object" Johannes Schindelin
2008-04-07 13:41 ` [PATCH 2/2] pretty=format: Add %d to show decoration Johannes Schindelin
2008-04-09 21:40   ` René Scharfe [this message]
2008-04-10  8:39   ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47FD37D6.2030506@lsrfire.ath.cx \
    --to=rene.scharfe@lsrfire.ath.cx \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).