pathspec magic: add '^' as alias for '!'
The choice of '!' for a negative pathspec ends up not only not matching what we do for revisions, it's also a horrible character for shell expansion since it needs quoting. So add '^' as an alternative alias for an excluding pathspec entry. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
6e3a7b3398
commit
42ebeb9d07
@ -224,6 +224,12 @@ static const char *parse_short_magic(unsigned *magic, const char *elem)
|
||||
char ch = *pos;
|
||||
int i;
|
||||
|
||||
/* Special case alias for '!' */
|
||||
if (ch == '^') {
|
||||
*magic |= PATHSPEC_EXCLUDE;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!is_pathspec_magic(ch))
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user