Re: [PATCH] git-mv: improve error message for conflicted file
- From
Chris Torek <chris.torek@gmail.com>
- Date
- Jul 18, 2020, 01:35 UTC
- Message-ID
- <CAPx1GvduDZw5pmfZHACDGZsMR5YYDowLw6+az+oL6oWLvDyCFA@mail.gmail.com>
- In-Reply-To
- <CAPig+cQaqg7MbyNZakuWVzezhPCXu=LonCVAw_p13c=0YNBdPw@mail.gmail.com>
On Fri, Jul 17, 2020 at 4:47 PM Eric Sunshine <sunshine@sunshineco.com> wrote:
> Style: write `!ce` rather than `ce == NULL`:
OK, but I'll go with Junio's suggestion of getting `ce` once and then checking `ce_staged` anyway. (I'm used to a different style guide that frowns on `if (ce)` and `if (!ce)`...)
Show 5 quoted lines
> As for bikeshedding the message itself, perhaps:
>
> _("conflicted");
>
> Though, perhaps that's too succinct.Maybe. Succinct is usually good though.
Show 6 quoted lines
> > + touch conflicted && > > If the timestamp of the file is not relevant to the test -- as is the > case here -- then we avoid using `touch`. Instead: > > >conflicted &&
OK.
> ... use literal TABs and let the here-doc provide the newlines.
I personally hate depending on literal tabs, as they're really hard to see. If q_to_tab() is OK I'll use that.
Show 11 quoted lines
> I realize that this test script is already filled with this sort of > thing where actions are performed outside of tests, however, these > days we frown upon that, and there really isn't a good reason to avoid > taking care of this clean up via the modern idiom of using > test_when_finished(), which you would call immediately after creating > the file in the test. So: > > ... > >conflicted && > test_when_finished "rm -f conflicted" && > ...
Indeed, that's where I copied it from.
Should I clean up other instances of separated-out `rm -f`s in this file in a separate commit?
Chris