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

Re: Should `git remote show` display excluded branches as to-be-fetched?

From
Jacob Keller <jacob.keller@gmail.com>
Date
Jun 12, 2022, 06:36 UTC
Message-ID
<CA+P7+xqfthRZkn76FxG8xuGU670k0zyCCTe0d26_pe1HVTkXpQ@mail.gmail.com>
In-Reply-To
<xmqq1qvwfntm.fsf@gitster.g>
On Fri, Jun 10, 2022 at 10:08 AM Junio C Hamano <gitster@pobox.com> wrote:
Show 41 quoted lines
>
> Pavel Rappo <pavel.rappo@gmail.com> writes:
>
> > Here's a console session:
> >
> >   % git config --get-all remote.jdk19.fetch
> >   +refs/heads/*:refs/remotes/jdk19/*
> >   ^refs/heads/pr/*
>
> Thanks
>
> "Negative refspecs" is relatively new feature introduced in c0192df6
> (refspec: add support for negative refspecs, 2020-09-30), so it
> would not be so surprising if it still had some surprising behaviour
> ;-)
>
> Jacob, care to take a look?
>
> >   % git remote show jdk19
> >
> >   * remote jdk19
> >     Fetch URL: git@github.com:openjdk/jdk19.git
> >     Push  URL: git@github.com:openjdk/jdk19.git
> >     HEAD branch: master
> >     Remote branches:
> >       master tracked
> >       pr/1   new (next fetch will store in remotes/jdk19)
> >       pr/2   new (next fetch will store in remotes/jdk19)
> >       pr/3   new (next fetch will store in remotes/jdk19)
> >     Local ref configured for 'git push':
> >       master pushes to master (fast-forwardable)
> >
> > I would naively expect the pr/1, pr/2, and pr/3 branches to be either:
> >
> > - not displayed, or better
> > - displayed with a hint that they won't be fetched (since they match a
> > _negative_ refspec, which is the second line in the `git config`
> > output above)
> >
> > Thanks,
> > -Pavel

This is almost certainly an oversight in that the particular code path does not process negative refspecs. I can hopefully take a closer look at this next week.

Previous: Junio C HamanoNext: Jacob Keller
Message 3 of 6 in “Should `git remote show` display excluded branches as to-be-fetched?”
  1. Pavel RappoJun 10, 2022
  2. Junio C HamanoJun 10, 2022
  3. Jacob KellerJun 12, 2022
  4. Jacob KellerJun 13, 2022
  5. Jacob KellerJun 14, 2022
  6. Pavel RappoJun 25, 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.