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

Re: [PATCH 1/2] pathspec magic: add '^' as alias for '!'

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 8, 2017, 23:05 UTC
Message-ID
<xmqq37fouvu3.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20170208223532.GB108686@google.com>
Brandon Williams <bmwill@google.com> writes:
Show 7 quoted lines
> git cmd -- :^dir
>
> would produce some output which says:
> ':^dir': pathspec magic not supported by this command: 'exclude' (mnemonic: '!')
>
> And the user may scratch their head for a second since they didn't
> supply the '!' character, but rather '^'.

Yup, I am tempted to tweak Cornelius's glossary fixup and squash this into the series, for two purposes.

 - it makes it clear that '^' and '!' mean the same thing (and
   clearer than Cornelius's original, "! or ^", which could leave
   the reader wondering "ok there are two ways to say negative; do
   they subtly mean different things?").
 - it hints that '!' is the more official spelling, making the
   output you showed above acceptable.
diff --git a/Documentation/glossary-content.txt b/Documentation/glossary-content.txt
index 8ad29e61a9..822ca83264 100644
--- a/Documentation/glossary-content.txt
+++ b/Documentation/glossary-content.txt
@@ -386,8 +386,8 @@ Glob magic is incompatible with literal magic.
 
 exclude;;
 	After a path matches any non-exclude pathspec, it will be run
-	through all exclude pathspec (magic signature: `!`). If it
-	matches, the path is ignored.
+	through all exclude pathspec (magic signature: `!` or its
+	synonym `^`). If it matches, the path is ignored.
 --
 
 [[def_parent]]parent::
Previous: Brandon WilliamsNext: Stefan Beller
Message 4 of 5 in “pathspec magic: add '^' as alias for '!'”
  1. 1/2 pathspec magic: add '^' as alias for '!'Linus Torvalds, Feb 8, 2017
  2. Cornelius WeigFeb 8, 2017
  3. Brandon WilliamsFeb 8, 2017
  4. Junio C HamanoFeb 8, 2017
  5. Stefan BellerFeb 8, 2017

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.