All of lore.kernel.org
 help / color / mirror / Atom feed
From: Harry Jeffery <harry@exec64.co.uk>
To: Jeff King <peff@peff.net>, Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] pretty-format: add append line-feed format specifier
Date: Tue, 09 Sep 2014 23:17:20 +0100	[thread overview]
Message-ID: <540F7C70.4010909@exec64.co.uk> (raw)
In-Reply-To: <20140909214520.GA13603@peff.net>

On 09/09/14 22:45, Jeff King wrote:
> Yeah, that was my thought on reading the initial patch, too. Why limit
> ourselves to newlines and spaces. I'd much rather have full conditional
> expansion, like "${foo:+prefix $foo suffix}" in the shell.
>
> Something like the patch below might work, but I didn't test it very
> thoroughly (and note the comments, which might need dealing with). Maybe
> it would make a sensible base for Harry to build on if he wants to
> pursue this.

I definitely prefer your more general solution to my 
bare-minimum-to-scratch-itch patch. I'd certainly be willing to take 
your patch and expand upon it (pun unintended) once Junio has weighed in 
on your suggestions.

> You could also make "%d" more flexible with it. We unconditionally
> include the " (...)" wrapper when expanding it. But assuming we
> introduced a "%D" that is _just_ the decoration names, you could do:
>
>    %if(%D, (%D))
>
> to get the same effect with much more flexibility.

Regardless of what happens with the conditional expansion I think it 
would definitely be a useful addition to be able to print the decorators 
without the " (...)" wrapper. I think it's general enough that it'd 
warrant its own separate patch rather than being part of a patch series 
for the conditional expansion.

  reply	other threads:[~2014-09-09 22:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-09 18:09 [PATCH] pretty-format: add append line-feed format specifier Harry Jeffery
2014-09-09 19:15 ` Junio C Hamano
2014-09-09 19:30   ` Harry Jeffery
2014-09-09 19:37     ` Junio C Hamano
2014-09-09 21:45       ` Jeff King
2014-09-09 22:17         ` Harry Jeffery [this message]
2014-09-09 22:31           ` Jeff King
2014-09-10 17:19         ` Junio C Hamano
2014-09-12  4:49           ` Jeff King
2014-09-12 16:36             ` 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=540F7C70.4010909@exec64.co.uk \
    --to=harry@exec64.co.uk \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.