All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jacob Keller <jacob.keller@gmail.com>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>,
	Jacob Keller <jacob.keller@gmail.com>
Subject: [PATCH v3 0/6] remote: handle negative refspecs with show
Date: Thu, 16 Jun 2022 17:20:30 -0700	[thread overview]
Message-ID: <20220617002036.1577-1-jacob.keller@gmail.com> (raw)

The git remote show command does not handle negative refspecs. In fact, the
function will happily show that the refs will be fetched, even though they
won't be.

The first patch in this series fixes the show issue for new refs that should
be marked as skipped. The later patches do some cleanup on the
t5505-remote.sh script, improving the test file, along with some improved
test infrastructure.

Finally, I also noticed that git remote prune doesn't interact as expected
with negative refspecs either, so there is a patch to add an expected
failure for this as well.

I suspect we need to dig into get_stale_heads and make that handle negative
refspecs properly, but I wasn't able to figure that out in the time I have
today.

Changes since v2:
* re-ordered so that the fix is first
* cleaned up helper functions to honor -C instead of hard coding 'test'
* added expected failures for the short comings of this fix

Jacob Keller (6):
  remote: handle negative refspecs in git remote show
  t5505: remove sub shell use in favor of git -C
  tests: handle --global directly in test_config/test_unconfig
  tests: only automatically unset matching values from test_config
  t5505: use test_config where appropriate
  remote: add test for negative refspec with prune

 builtin/remote.c                        |   12 +-
 remote.c                                |    2 +-
 remote.h                                |    6 +
 t/lib-parallel-checkout.sh              |    4 +-
 t/lib-proto-disable.sh                  |   12 +-
 t/lib-submodule-update.sh               |    2 +-
 t/t0001-init.sh                         |   14 +-
 t/t0021-conversion.sh                   |   58 +-
 t/t0210-trace2-normal.sh                |   10 +-
 t/t0211-trace2-perf.sh                  |    4 +-
 t/t0212-trace2-event.sh                 |    2 +-
 t/t1309-early-config.sh                 |    2 +-
 t/t2081-parallel-checkout-collisions.sh |    2 +-
 t/t2082-parallel-checkout-attributes.sh |    4 +-
 t/t3431-rebase-fork-point.sh            |    2 +-
 t/t5505-remote.sh                       | 1132 ++++++++++-------------
 t/t5544-pack-objects-hook.sh            |    6 +-
 t/t5550-http-fetch-dumb.sh              |    8 +-
 t/t5573-pull-verify-signatures.sh       |    6 +-
 t/t5606-clone-options.sh                |   10 +-
 t/t5617-clone-submodules-remote.sh      |    4 +-
 t/t5702-protocol-v2.sh                  |    2 +-
 t/t7814-grep-recurse-submodules.sh      |   16 +-
 t/test-lib-functions.sh                 |  104 ++-
 24 files changed, 667 insertions(+), 757 deletions(-)

-- 
2.36.1


             reply	other threads:[~2022-06-17  0:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-17  0:20 Jacob Keller [this message]
2022-06-17  0:20 ` [PATCH v3 1/6] remote: handle negative refspecs in git remote show Jacob Keller
2022-06-17  0:20 ` [PATCH v3 2/6] t5505: remove sub shell use in favor of git -C Jacob Keller
2022-06-17  0:20 ` [PATCH v3 3/6] tests: handle --global directly in test_config/test_unconfig Jacob Keller
2022-06-17  0:20 ` [PATCH v3 4/6] tests: only automatically unset matching values from test_config Jacob Keller
2022-06-17  0:20 ` [PATCH v3 5/6] t5505: use test_config where appropriate Jacob Keller
2022-06-17  0:20 ` [PATCH v3 6/6] remote: add test for negative refspec with prune Jacob Keller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220617002036.1577-1-jacob.keller@gmail.com \
    --to=jacob.keller@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.