Re: [PATCH v4] branch: support for shortcuts like @{-1}, completed
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Oct 8, 2022, 07:23 UTC
- Message-ID
- <CAPig+cSn29Fq4ywC9zXoJYRVG8KUEhHuDdwEUSioFMUVs+S-ow@mail.gmail.com>
- In-Reply-To
- <f24837e9-7873-c34c-bd78-8ae3be0fc97a@gmail.com>
On Sat, Oct 8, 2022 at 3:07 AM Rubén Justo <rjusto@gmail.com> wrote:
Show 9 quoted lines
> On 8/10/22 5:17, Eric Sunshine wrote: > > On Fri, Oct 7, 2022 at 9:36 PM Rubén Justo <rjusto@gmail.com> wrote: > >> + echo "Branch description\n" >expect && > > > > Is the intention here with the embedded "\n" that `echo` should emit > > two newlines? If so, interpreting "\n" specially is not POSIX behavior > > for `echo`, thus we probably don't want to rely upon it. > > Oops. Thank you! I'll reroll back to using "git stripspace".
`git stripspace` is perhaps unnecessarily heavyweight. Lightweight alternatives would include:
printf "Branch description\n\n" >expect &&
test_write_lines "Branch description" "" >expect &&
{ echo "Branch description" && echo; } >expect && cat >expect <<-\EOF &&
Branch descriptionEOF