Re: [PATCH v5] tracking branches: add advice to ambiguous refspec error
- From
Tao Klerks <tao@klerks.biz>
- Date
- Mar 30, 2022, 15:18 UTC
- Message-ID
- <CAPMMpohJEbfA0_0qR8jqOAXgBuwo+Nf=BkVjr0UkjeMa+STHkw@mail.gmail.com>
- In-Reply-To
- <CAPMMpoiNZ8pvrZmMqJsRV2x+Fvq-=hpih1GGSLMe=KX785Dk0A@mail.gmail.com>
On Wed, Mar 30, 2022 at 4:23 PM Tao Klerks <tao@klerks.biz> wrote:
Show 19 quoted lines
>
> On Wed, Mar 30, 2022 at 3:27 PM Ævar Arnfjörð Bjarmason
> <avarab@gmail.com> wrote:
> >
> >
> > On Wed, Mar 30 2022, Tao Klerks via GitGitGadget wrote:
> >
> > > + if (tracking.matches > 1) {
> > > + int status = die_message(_("not tracking: ambiguous information for ref %s"),
> > > + orig_ref);
> >
> > This isn't per-se new, but I wonder if while we're at it we shold just
> > quote '%s' here, which we'd usually do. I.e. this message isn't new, but
> > referring again to "ref %s" (and not "ref '%s'") below is.
> >
>
> I will fix the below, but I would default to not changing the above
> unless someone thinks we should (not sure what the expectations are
> around changing error messages unnecessarily)I take this back. I will update both - the change is in a "variable" part of the message anyway, and it's hard to imagine any tool actively/purposefully parsing the ref out of the message and being caught out by the new quotes. Any coordinating tool would already know what ref was being branched / having its tracking remote info updated.
Show 9 quoted lines
>
> > > + * TRANSLATORS: This is a line listing a remote with duplicate
> > > + * refspecs in the advice message below. For RTL languages you'll
> > > + * probably want to swap the "%s" and leading " " space around.
> > > + */
> > > + strbuf_addf(&remotes_advice, _(" %s\n"), item->string);
> > > + }
> > > +
> >