Skip to content

Commit

Permalink
Sync with 1.8.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Junio C Hamano committed Mar 1, 2013
2 parents 443d803 + e6363a4 commit 06d67b8
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 deletions.
6 changes: 6 additions & 0 deletions Documentation/RelNotes/1.8.1.5.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ Fixes since v1.8.1.4
the command line where an option is expected, the option parser
used just one byte of the unknown letter when reporting an error.

* In v1.8.1, the attribute parser was tightened too restrictive to
error out upon seeing an entry that begins with an ! (exclamation),
which may confuse users to expect a "negative match", which does
not exist. This has been demoted to a warning; such an entry is
still ignored.

* "git apply --summary" has been taught to make sure the similarity
value shown in its output is sensible, even when the input had a
bogus value.
Expand Down
3 changes: 2 additions & 1 deletion Documentation/git.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ unreleased) version of Git, that is available from 'master'
branch of the `git.git` repository.
Documentation for older releases are available here:

* link:v1.8.1.4/git.html[documentation for release 1.8.1.4]
* link:v1.8.1.5/git.html[documentation for release 1.8.1.5]

* release notes for
link:RelNotes/1.8.1.5.txt[1.8.1.5],
link:RelNotes/1.8.1.4.txt[1.8.1.4],
link:RelNotes/1.8.1.3.txt[1.8.1.3],
link:RelNotes/1.8.1.2.txt[1.8.1.2],
Expand Down
2 changes: 1 addition & 1 deletion Documentation/githooks.txt
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ preceding SP is also omitted. Currently, no commands pass any
'extra-info'.

The hook always runs after the automatic note copying (see
"notes.rewrite.<command>" in linkgit:git-config.txt) has happened, and
"notes.rewrite.<command>" in linkgit:git-config.txt[1]) has happened, and
thus has access to these notes.

The following command-specific comments apply:
Expand Down
8 changes: 5 additions & 3 deletions attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,11 @@ static struct match_attr *parse_attr_line(const char *line, const char *src,
&res->u.pat.patternlen,
&res->u.pat.flags,
&res->u.pat.nowildcardlen);
if (res->u.pat.flags & EXC_FLAG_NEGATIVE)
die(_("Negative patterns are forbidden in git attributes\n"
"Use '\\!' for literal leading exclamation."));
if (res->u.pat.flags & EXC_FLAG_NEGATIVE) {
warning(_("Negative patterns are ignored in git attributes\n"
"Use '\\!' for literal leading exclamation."));
return NULL;
}
}
res->is_macro = is_macro;
res->num_attr = num_attr;
Expand Down
3 changes: 2 additions & 1 deletion t/t0003-attributes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ test_expect_success 'root subdir attribute test' '

test_expect_success 'negative patterns' '
echo "!f test=bar" >.gitattributes &&
test_must_fail git check-attr test -- f
git check-attr test -- '"'"'!f'"'"' 2>errors &&
test_i18ngrep "Negative patterns are ignored" errors
'

test_expect_success 'patterns starting with exclamation' '
Expand Down

0 comments on commit 06d67b8

Please sign in to comment.