git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Luc Pionchon <pionchon.luc@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] pretty: add '*' modifier to add LF after non-empty
Date: Thu, 23 Feb 2012 11:53:24 -0800	[thread overview]
Message-ID: <7v7gzd498r.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <1330002637-9347-1-git-send-email-pionchon.luc@gmail.com> (Luc Pionchon's message of "Thu, 23 Feb 2012 15:10:37 +0200")

Luc Pionchon <pionchon.luc@gmail.com> writes:

> Add the '*' modifier, similar to the '+' modifier,
> to add a line-feed after a non-empty placeholder.

Hrm, I thought I designed the plus and minus fairly carefully so that
nobody needs to add this later.

Wouldn't it be sufficient to write

        Foo%n%-d

that says "We usually have LF after Foo, and write %d after that, but we
might not have anything interesting in %d at all, in which case we don't
add that %n"?

> +test_expect_success 'add LF after non-empty (1) (empty)' '
> +	git show -s --pretty=format:"%*d%s%nfoo%n" HEAD^^ >actual &&

Shouldn't this be equivalent to "%n%-d%s%nfoo%n", which in turn is covered
by one of the previous tests (del LF before empty)?

  reply	other threads:[~2012-02-23 19:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-23 13:10 [PATCH] pretty: add '*' modifier to add LF after non-empty Luc Pionchon
2012-02-23 19:53 ` Junio C Hamano [this message]
2012-02-24 10:58   ` Luc Pionchon
2012-04-14 20:01   ` Felipe Contreras

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=7v7gzd498r.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=pionchon.luc@gmail.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).