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

Re: [PATCH WIP 0/3] git log --exclude

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 7, 2011, 17:57 UTC
Message-ID
<7vaa9cwup2.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CACsJy8DJs_cmCZegyPk=tB-bxWp4izrsTn8T=xeV1sU4fS5oTQ@mail.gmail.com>
Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:
> There may be a solution to mix depth limit and negative pathspec. I
> haven't thought carefully about that because I lean towards a simpler
> behaviour that only allows one negation level: a file is in if it
> matches any positive pathspecs and none of negative ones.

I tend to think it probably is acceptable solution to define "struct pathspec" to have one positive and one negative set, traversing and declaring a match on what matches something from the positive set only if it does not match anything in the negative set.

That is similar to how we define revision ranges in the sense that the range notation to have two ranges (A..B C..D) does not mean union of two sets (A..B + C..D), but is difference between two unions ((B D)-(A C)).

> This is enough if narrow clones consist of positive pathspec only. I
> really doubt if users would want to make a narrow clone that "contains
> A but not A/B, storage-wise".

And if you define "struct pathspec" to have one positive and one negative set, you do not have to limit narrow clone only to positive. The repository specific narrow pathspec will have one such "struct pathspec", but the user may give us from the command line another "struct pathspec". At runtime, we would merge them to form into one negative and one positive set, and apply the same rule: nothing that matches any negative will appear in the traversal or in the output.

Previous: Nguyen Thai Ngoc Duy
Message 12 of 12 in “git log --exclude”
  1. 0/3 git log --excludeNguyễn Thái Ngọc Duy, Oct 5, 2011
  2. 1/3 diff-no-index: rename read_directory to avoid conflict from dir.hNguyễn Thái Ngọc Duy, Oct 5, 2011
  3. 2/3 tree-diff: teach it to understand exclude patternsNguyễn Thái Ngọc Duy, Oct 5, 2011
  4. 3/3 log: add --exclude optionNguyễn Thái Ngọc Duy, Oct 5, 2011
  5. Matthieu MoyOct 5, 2011
  6. Nguyen Thai Ngoc DuyOct 5, 2011
  7. Junio C HamanoOct 5, 2011
  8. Jeff KingOct 6, 2011
  9. Junio C HamanoOct 6, 2011
  10. Nguyen Thai Ngoc DuyOct 6, 2011
  11. Nguyen Thai Ngoc DuyOct 7, 2011
  12. Junio C HamanoOct 7, 2011

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.