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

Re: [WIP PATCH 0/5] support --exclude for diff/log commands

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
Mar 10, 2011, 07:03 UTC
Message-ID
<AANLkTimixVPGuZH9o6gkB7J=ZOmJ2PuitCH5HY8AnDe+@mail.gmail.com>
In-Reply-To
<7vmxl37bdp.fsf@alter.siamese.dyndns.org>
2011/3/10 Junio C Hamano <gitster@pobox.com>:
Show 13 quoted lines
> Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:
>
>> On the other hand, if we go with ':' as a mark of special pathspecs, then
>>
>>  - ":/" mark pathspecs relative to worktree root
>>  - ":!" may mark negative pathspecs
>
> I am still moderately negative on this "negative pathspec" stuff, as it
> will complicate the semantics (just one example: would a path that is
> covered by both positive and negative pathspecs included or excluded?
> would the last one win? would the more specific one win?) and makes the
> design harder to explain to the users. Depending on the semantics chosen,
> it may also make the implementation less efficient and more complex.

The semantics resembles .gitignore, or at least that's my intention. But yes, this kind of notion is more complex than simple '--exclude' option, which would suit 90% cases, I guess.

Show 9 quoted lines
> The two most important things to consider are to make sure that people
> with funny pathnames can work it around by quoting, and the prefixing
> scheme is extensible so that other types of magic can later be introduced
> with the same kind of escape hatch for people with funny pathnames that
> begin with or contain new magic characters used to trigger the new magic.
>
> I said "something along the lines" above because ":/ for root, :! for
> negative" does not yet specify how the scheme would satisfy the above
> two consideration very well.

The quoting part may go through another painful migration plan if you don't want to surprise users.

I have already suggested to reserve the next character after ':' (or any char chosen as the magic one) as control character, for this extensibility. Any unrecognized control character will be rejected. Even if we limit ourselves to punctuation letters only, there's still plenty room for future after '/' and '!' are taken.

-- 
Duy
Previous: Junio C HamanoNext: Junio C Hamano
Message 10 of 20 in “support --exclude for diff/log commands”
  1. 0/5 support --exclude for diff/log commandsNguyễn Thái Ngọc Duy, Mar 10, 2011
  2. 1/5 tree-walk: support negative pathspecNguyễn Thái Ngọc Duy, Mar 10, 2011
  3. 2/5 match_pathspec_depth: support negative pathspecNguyễn Thái Ngọc Duy, Mar 10, 2011
  4. 3/5 revision.c: get rid of struct rev_info.prune_dataNguyễn Thái Ngọc Duy, Mar 10, 2011
  5. Junio C HamanoMar 10, 2011
  6. Nguyen Thai Ngoc DuyMar 10, 2011
  7. 4/5 diff: refactor init/release APINguyễn Thái Ngọc Duy, Mar 10, 2011
  8. 5/5 diff: support --excludeNguyễn Thái Ngọc Duy, Mar 10, 2011
  9. Junio C HamanoMar 10, 2011
  10. Nguyen Thai Ngoc DuyMar 10, 2011
  11. Junio C HamanoMar 10, 2011
  12. Nguyen Thai Ngoc DuyMar 10, 2011
  13. Nguyen Thai Ngoc DuyMar 21, 2011
  14. Michael J GruberMar 21, 2011
  15. Nguyen Thai Ngoc DuyMar 21, 2011
  16. Junio C HamanoMar 22, 2011
  17. Nguyen Thai Ngoc DuyMar 23, 2011
  18. Nguyen Thai Ngoc DuyMar 23, 2011
  19. Michael J GruberMar 23, 2011
  20. Nguyen Thai Ngoc DuyMar 23, 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.