Re: [WIP v1 3/4] mv: add advise_to_reapply hint for moving file into cone
- From
Shaoxuan Yuan <shaoxuan.yuan02@gmail.com>
- Date
- Apr 1, 2022, 04:00 UTC
- Message-ID
- <CAJyCBORNQEN4WNfuYbO264qz0W6d-rbT6z=T_-AZF5jY36c1yQ@mail.gmail.com>
- In-Reply-To
- <220331.86ilruqup6.gmgdl@evledraar.gmail.com>
On Thu, Mar 31, 2022 at 6:31 PM Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
> > More odd indentation, and the braces aren't needed.
Got me again :-( Will make a change.
Show 15 quoted lines
> > }
> >
> > if (gitmodules_modified)
> > @@ -392,6 +398,9 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
> > COMMIT_LOCK | SKIP_IF_UNCHANGED))
> > die(_("Unable to write new index file"));
> >
> > + if (advise_to_reapply)
> > + printf(_("Please use \"git sparse-checkout reapply\" to reapply the sparsity.\n"));
> > +
>
> Please see 93026558512 (tracking branches: add advice to ambiguous
> refspec error, 2022-03-28) (the OID may change after I send this, as
> it's in "seen") for how to add new advise, i.e. we use advise(), add an
> enum field, config var etc.I actually did use advise(), but I noticed that it prints to stderr and ... nevermind, I realized that printing to stderr is OK. But can I print to stdout since I think users should be "reminded" instead of "warned"?
Anyway, I think using advice() is probably better.
-- Thanks & Regards, Shaoxuan