git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Torek <chris.torek@gmail.com>
To: Eric Sunshine <sunshine@sunshineco.com>
Cc: Chris Torek via GitGitGadget <gitgitgadget@gmail.com>,
	Git List <git@vger.kernel.org>
Subject: Re: [PATCH] git-mv: improve error message for conflicted file
Date: Fri, 17 Jul 2020 18:35:09 -0700	[thread overview]
Message-ID: <CAPx1GvduDZw5pmfZHACDGZsMR5YYDowLw6+az+oL6oWLvDyCFA@mail.gmail.com> (raw)
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)`...)

> As for bikeshedding the message itself, perhaps:
>
>     _("conflicted");
>
> Though, perhaps that's too succinct.

Maybe.  Succinct is usually good though.

> > +       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.

> 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

  reply	other threads:[~2020-07-18  1:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-17 23:24 [PATCH] git-mv: improve error message for conflicted file Chris Torek via GitGitGadget
2020-07-17 23:47 ` Eric Sunshine
2020-07-18  1:35   ` Chris Torek [this message]
2020-07-18  6:55     ` Eric Sunshine
2020-07-18  0:07 ` Junio C Hamano
2020-07-18  2:00   ` Elijah Newren
2020-07-18 17:46     ` Junio C Hamano
2020-07-19  1:48       ` Elijah Newren
2020-07-19  6:16         ` Junio C Hamano
2020-07-20  6:17 ` [PATCH v2] " Chris Torek via GitGitGadget
2020-07-20 18:28   ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPx1GvduDZw5pmfZHACDGZsMR5YYDowLw6+az+oL6oWLvDyCFA@mail.gmail.com \
    --to=chris.torek@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=sunshine@sunshineco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).