# [RFC 0/3] support negative refspecs

2 messages from 2020-08-15 to 2020-08-15. Participants: Jacob Keller.
Thread: https://gitlist.dev/t/54050

## Jacob Keller, 2020-08-15 00:28

Subject: [RFC 0/3] support negative refspecs
Message-ID: <20200815002831.2468968-1-jacob.e.keller@intel.com>
URL: https://gitlist.dev/e/20200815002831.2468968-1-jacob.e.keller%40intel.com

```
From: Jacob Keller <jacob.keller@gmail.com>

This is more or less just a port of what Peff already had published a few
years ago at https://lore.kernel.org/git/20140125013433.GA22336@sigill.intra.peff.net/

I cleaned some things up and made sure the tests pass, but haven't yet added
any new tests.

I think the overal design makes sense: applying positive first and then
negative. This appears to be how negative pathspecs work at least as far as
I could tell with a few trials.

The first two patches are cleanup/fixups that I think could go separately if
everyone agrees. The third is the meat of the idea, and where most of the
work needs to be done.

Jacob Keller (3):
  refspec: fix documentation referring to refspec_item
  refspec: make sure stack refspec_item variables are zeroed
  refspec: add support for negative refspecs

 builtin/fetch.c  |  3 +++
 builtin/remote.c |  1 +
 refspec.c        | 30 +++++++++++++++++++++++++++++
 refspec.h        | 29 +++++++++++++++-------------
 remote.c         | 49 +++++++++++++++++++++++++++++++++++++++++++++++-
 remote.h         |  9 ++++++++-
 transport.c      |  1 +
 7 files changed, 107 insertions(+), 15 deletions(-)


base-commit: 878e727637ec5815ccb3301eb994a54df95b21b8
-- 
2.28.0.163.g6104cc2f0b60


```

## Jacob Keller, 2020-08-15 00:29

Subject: Re: [RFC 0/3] support negative refspecs
Message-ID: <CA+P7+xoDckBukFF9MnkhmWDdJxEcCZK5jg6HJcBbPcXB70xOUQ@mail.gmail.com>
URL: https://gitlist.dev/e/CA%2BP7%2BxoDckBukFF9MnkhmWDdJxEcCZK5jg6HJcBbPcXB70xOUQ%40mail.gmail.com
In-Reply-To: <20200815002831.2468968-1-jacob.e.keller@intel.com>

```
On Fri, Aug 14, 2020 at 5:28 PM Jacob Keller <jacob.e.keller@intel.com> wrote:
>
> From: Jacob Keller <jacob.keller@gmail.com>
>
> This is more or less just a port of what Peff already had published a few
> years ago at https://lore.kernel.org/git/20140125013433.GA22336@sigill.intra.peff.net/
>
> I cleaned some things up and made sure the tests pass, but haven't yet added
> any new tests.
>
> I think the overal design makes sense: applying positive first and then
> negative. This appears to be how negative pathspecs work at least as far as
> I could tell with a few trials.
>
> The first two patches are cleanup/fixups that I think could go separately if
> everyone agrees. The third is the meat of the idea, and where most of the
> work needs to be done.
>
> Jacob Keller (3):
>   refspec: fix documentation referring to refspec_item
>   refspec: make sure stack refspec_item variables are zeroed
>   refspec: add support for negative refspecs
>
>  builtin/fetch.c  |  3 +++
>  builtin/remote.c |  1 +
>  refspec.c        | 30 +++++++++++++++++++++++++++++
>  refspec.h        | 29 +++++++++++++++-------------
>  remote.c         | 49 +++++++++++++++++++++++++++++++++++++++++++++++-
>  remote.h         |  9 ++++++++-
>  transport.c      |  1 +
>  7 files changed, 107 insertions(+), 15 deletions(-)
>
>
> base-commit: 878e727637ec5815ccb3301eb994a54df95b21b8
> --
> 2.28.0.163.g6104cc2f0b60
>

This probably doesn't have the right reply headers, because I forgot
to send the cover letter along with the patches and realized it after
I hit send. Sorry!

Thanks,
Jake

```
