Git development
 help / color / mirror / Atom feed
* Conditional newline in pretty format
@ 2020-03-17 15:28 Robert Dailey
  2020-03-17 15:37 ` Robert Dailey
  0 siblings, 1 reply; 5+ messages in thread
From: Robert Dailey @ 2020-03-17 15:28 UTC (permalink / raw)
  To: Git

I have the following alias:

```
[alias]
    release-notes = log --no-merges --pretty=format:'* %s%n%n%w(100,2,2)%b'
```

With a branch `topic` checked out, I run it like so:

    $ git release-notes origin..

This gives me the "release notes" on my branch. The goal is to have it
formatted as a bullet-point list in markdown format so I can just copy
& paste this output into Github, Bitbucket, or other sites and have it
already set up for render correctly.

It works perfectly right now except for the case where `%b` is empty.
In that case, I just want one newline after `%s` instead of 2. Is
there a way to make my second `%n` conditional on `%b` having a value?

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-03-17 17:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-17 15:28 Conditional newline in pretty format Robert Dailey
2020-03-17 15:37 ` Robert Dailey
2020-03-17 17:18   ` Jeff King
2020-03-17 17:27     ` Robert Dailey
2020-03-17 17:55       ` Jeff King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox