Re: [PATCH v4] branch: support for shortcuts like @{-1}, completed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Oct 8, 2022 at 3:07 AM Rubén Justo <rjusto@xxxxxxxxx> wrote:
> On 8/10/22 5:17, Eric Sunshine wrote:
> > On Fri, Oct 7, 2022 at 9:36 PM Rubén Justo <rjusto@xxxxxxxxx> 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 description

    EOF



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux