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

Re: [PATCH 2/2] refs: support negative transfer.hideRefs

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Jul 30, 2015, 20:17 UTC
Message-ID
<CAPig+cTJuCWwhzrAt47yCEMv4yrTX-C1e9L_yBwyqJ-YbGfcuA@mail.gmail.com>
In-Reply-To
<20150728195934.GB13795@peff.net>
On Tue, Jul 28, 2015 at 3:59 PM, Jeff King <peff@peff.net> wrote:
Show 32 quoted lines
> If you hide a hierarchy of refs using the transfer.hideRefs
> config, there is no way to later override that config to
> "unhide" it. This patch implements a "negative" hide which
> causes matches to immediately be marked as unhidden, even if
> another match would hide it. We take care to apply the
> matches in reverse-order from how they are fed to us by the
> config machinery, as that lets our usual "last one wins"
> config precedence work (and entries in .git/config, for
> example, will override /etc/gitconfig).
>
> Signed-off-by: Jeff King <peff@peff.net>
> ---
> +test_expect_success 'set up some extra tags for ref hiding' '
> +       git tag magic/one &&
> +       git tag magic/two
> +'
> +
>  for configsection in transfer uploadpack
>  do
>         test_expect_success "Hide some refs with $configsection.hiderefs" '
> @@ -138,6 +143,16 @@ do
>                 sed -e "/       refs\/tags\//d" >expect &&
>                 test_cmp expect actual
>         '
> +
> +       test_expect_success "Override hiding of $configsection.hiderefs" '
> +               test_when_finished "test_unconfig $configsection.hiderefs" &&
> +               git config --add $configsection.hiderefs refs/tags &&
> +               git config --add $configsection.hiderefs "!refs/tags/magic" &&
> +               git config --add $configsection.hiderefs refs/tags/magic/one &&
> +               git ls-remote . >actual &&
> +               verbose grep refs/tags/magic/two actual
For completeness, do you also want to add
    !grep refs/tags/magic/one actual
to confirm that the third hideRefs did indeed override the second one?
Show 7 quoted lines
> +       '
> +
>  done
>
>  test_done
> --
> 2.5.0.rc3.557.g17a1555
Previous: Jeff KingNext: Jeff King
Message 6 of 7 in “negative hideRefs for overriding”
  1. 0/2 negative hideRefs for overridingJeff King, Jul 28, 2015
  2. 1/2 docs/config.txt: reorder hideRefs configJeff King, Jul 28, 2015
  3. 2/2 refs: support negative transfer.hideRefsJeff King, Jul 28, 2015
  4. Junio C HamanoJul 28, 2015
  5. Jeff KingJul 28, 2015
  6. Eric SunshineJul 30, 2015
  7. Jeff KingJul 30, 2015

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.