git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC v2 1/1] refspec: add support for negative refspecs

From
Jacob Keller <jacob.keller@gmail.com>
Date
Sep 24, 2020, 23:42 UTC
Message-ID
<CA+P7+xqJis+DA=ZZ0Qphf0P8RGVbXyvHUHaqo30LQDytxAvs-w@mail.gmail.com>
In-Reply-To
<xmqqzh5onea1.fsf@gitster.c.googlers.com>
On Thu, Sep 17, 2020 at 5:02 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 17 quoted lines
>
> Jacob Keller <jacob.e.keller@intel.com> writes:
>
> > @@ -1441,6 +1559,8 @@ int match_push_refs(struct ref *src, struct ref **dst,
> >               string_list_clear(&src_ref_index, 0);
> >       }
> >
> > +     *dst = apply_negative_refspecs(*dst, rs);
> > +
> >       if (errs)
> >               return -1;
> >       return 0;
>
> And after grabbing all the candidate refs to be updated via this
> push, we filter out the ones that match negative pattern.  Can it
> also produce an error, or it can never fail (to udpate errs)?
>

It can't fail. Either refs match a negative refspec and will get excluded, or they do not match a negative refspec and will be kept. We already validate the negative refspecs earlier.

Thanks, Jake

Previous: Jacob Keller
Message 10 of 10 in “[RFC v2 0/1] implement support for negative refspecs”
  1. Jacob KellerAug 21, 2020
  2. 1/1 refspec: add support for negative refspecsJacob Keller, Aug 21, 2020
  3. Johannes SchindelinAug 22, 2020
  4. Jacob KellerAug 24, 2020
  5. Junio C HamanoAug 24, 2020
  6. Jacob KellerAug 24, 2020
  7. Junio C HamanoSep 17, 2020
  8. Junio C HamanoSep 18, 2020
  9. Jacob KellerSep 24, 2020
  10. Jacob KellerSep 24, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.