Thread (3 messages) flat view 3 messages, 3 authors, 2016-06-15

Re: [PATCH] pretty: add '*' modifier to add LF after non-empty

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:53:08

Luc Pionchon [off-list ref] 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)?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help