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

Re: [PATCH] remote: handle negative refspecs in git remote show

From
Jacob Keller <jacob.keller@gmail.com>
Date
Jun 16, 2022, 20:48 UTC
Message-ID
<CA+P7+xpzH_PiTKk4wb25pBJOCXwTE6_RYKhpRQj84gknNqV0Kg@mail.gmail.com>
In-Reply-To
<Yqfx3P8qUpQ7Y0ux@nand.local>
On Mon, Jun 13, 2022 at 7:26 PM Taylor Blau <me@ttaylorr.com> wrote:
Show 20 quoted lines
>
> On Mon, Jun 13, 2022 at 06:56:55PM -0700, Jacob Keller wrote:
> > > > +test_expect_success 'show with negative refspecs' '
> > > > +     test_when_finished "git -C test config --fixed-value --unset remote.origin.fetch ^refs/heads/main" &&
> > > > +     (
> > > > +             cd test &&
> > > > +             git config --add remote.origin.fetch ^refs/heads/main &&
> > >
> > > Doing "git config --unset" outside of the subshell could be avoided by
> > > ditching the subshell altogether, perhaps with something like:
> > >
> > >     test_config -C test remote.origin.fetch ^refs/heads/main &&
> >
> > We need "--add" semantics here which test_config doesn't seem to
> > support at the moment.
>
> Makes sense, thanks for explaining. This patch looks good to me.
>
> Thanks,
> Taylor

I ended up digging into this, and have now additionally added some patches to clean these tests up:

1) drop all the subshells in t5505 where possible
2) modify test_config and test_unconfig to handle options, including
--global, --add, and --fixed-value
3) make test_config use --fixed-value with test_unconfig so that only
the keys with the exact value are removed
4) use test_config more so that we don't have config values from
previous tests kept around
Previous: Taylor BlauNext: Jacob Keller
Message 5 of 11 in “remote: handle negative refspecs in git remote show”
  1. remote: handle negative refspecs in git remote showJacob Keller, Jun 14, 2022
  2. Taylor BlauJun 14, 2022
  3. Jacob KellerJun 14, 2022
  4. Taylor BlauJun 14, 2022
  5. Jacob KellerJun 16, 2022
  6. Jacob KellerJun 14, 2022
  7. Junio C HamanoJun 15, 2022
  8. Jacob KellerJun 16, 2022
  9. Junio C HamanoJun 16, 2022
  10. Jacob KellerJun 16, 2022
  11. Jacob KellerJun 16, 2022

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.