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

Re: RFC: git bisect should accept "paths-to-be-excluded"

From
Duy Nguyen <pclouds@gmail.com>
Date
Sep 18, 2013, 02:22 UTC
Message-ID
<CACsJy8CwtiJPLoFxts2NANH+i0ZoXcWSyS2qZC_zOx=WME2FkQ@mail.gmail.com>
In-Reply-To
<xmqqsix3z8ie.fsf@gitster.dls.corp.google.com>
On Wed, Sep 18, 2013 at 12:02 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 14 quoted lines
>> Interaction with "git grep --depth"
>
> I am not sure how that affects anything.  Conceptually, isn't
> "--depth" an independent axis to filter out paths that have too many
> components after given positive pathspec elements?  E.g. given
>
>         git grep --depth=2 pattern -- A B/C
>
> we will grab paths from two levels starting at A and B/C (so A/1/2
> and B/C/1/2 may hit but not A/1/2/3 nor B/C/1/2/3).  Shouldn't
> negative pathspecs just filter that depth filtering, i.e. if you
> have ":(exclude)*/1/*", even though both "A/1/2" and "A/a/b" may
> pass the --depth=2 filter, the former is excluded while the latter
> is not.

Implementation details leaked into the design thoughts. I was worried that the qsort() in pathspec() might make it incompatible with the :(exclude). Or I was thinking that --depth should be part of this new filter.. Never mind.

Show 8 quoted lines
>> Syntax. I guess --ignore (or --exclude) is more intuitive than
>> ":(exclude)something" but then it might collide with existing options
>> (I did not check if --ignore or --exclude is used anywhere though).
>> The latter also enables combining with other filters, such as
>> case-insensitive matching..
>
> I do not think it is an option to do this with any mechanism other
> than negative pathspecs.

Under the hood, a new pathspec magic must be introduced (else we can't pass them from "git add -u" to git-add--interactive then some other commands that take pathspec). So --exclude would be transformed to the pathspec magic, similar to "git grep --depth". But we could add that later if :(exclude)something is too long to type.

-- 
Duy
Previous: Junio C HamanoNext: Nguyễn Thái Ngọc Duy
Message 11 of 16 in “RFC: git bisect should accept "paths-to-be-excluded"”
  1. Toralf FörsterSep 16, 2013
  2. Christian CouderSep 17, 2013
  3. Matthieu MoySep 17, 2013
  4. Christian CouderSep 17, 2013
  5. Duy NguyenSep 17, 2013
  6. Junio C HamanoSep 17, 2013
  7. Piotr KrukowieckiSep 17, 2013
  8. Junio C HamanoSep 17, 2013
  9. Piotr KrukowieckiSep 17, 2013
  10. Junio C HamanoSep 17, 2013
  11. Duy NguyenSep 18, 2013
  12. Support pathspec magic :(exclude) and its short form :-Nguyễn Thái Ngọc Duy, Nov 20, 2013
  13. Junio C HamanoNov 20, 2013
  14. Duy NguyenNov 21, 2013
  15. Junio C HamanoNov 21, 2013
  16. Toralf FörsterSep 17, 2013

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.