diff options
authorRené Scharfe <>2020-11-10 11:38:27 (GMT)
committerJunio C Hamano <>2020-11-10 21:05:06 (GMT)
commitc714d0587567d67e1c3702e44221c1b46dc969ff (patch)
parent610e2b924020fe2d6a55e7ca6651f309b85c2d1d (diff)
blame: silently ignore invalid ignore file objects
Since 610e2b9240 (blame: validate and peel the object names on the ignore list, 2020-09-24) git blame reports checks if objects specified with --ignore-rev and in files loaded with --ignore-revs-file and config option blame.ignoreRevsFile are actual objects and dies if they aren't. The intent is to report typos to the user. This also breaks the ability to use a single ignore file for multiple repositories. Typos are presumably less likely in files than on the command line, so alerting is less useful here. Restore that feature by skipping non-commits without dying. Reported-by: Jean-Yves Avenard <> Signed-off-by: René Scharfe <> Reviewed-by: Barret Rhoden <> Signed-off-by: Junio C Hamano <>
2 files changed, 5 insertions, 4 deletions
diff --git a/oidset.c b/oidset.c
index 2d0ab76..5aac633 100644
--- a/oidset.c
+++ b/oidset.c
@@ -72,9 +72,10 @@ void oidset_parse_file_carefully(struct oidset *set, const char *path,
if (!sb.len)
- if (parse_oid_hex(sb.buf, &oid, &p) || *p != '\0' ||
- (fn && fn(&oid, cbdata)))
+ if (parse_oid_hex(sb.buf, &oid, &p) || *p != '\0')
die("invalid object name: %s", sb.buf);
+ if (fn && fn(&oid, cbdata))
+ continue;
oidset_insert(set, &oid);
if (ferror(fp))
diff --git a/t/ b/t/
index 24ae501..b18633d 100755
--- a/t/
+++ b/t/
@@ -39,10 +39,10 @@ test_expect_success 'validate --ignore-rev' '
test_must_fail git blame --ignore-rev X^{tree} file
-# Ensure bogus --ignore-revs-file requests are caught
+# Ensure bogus --ignore-revs-file requests are silently accepted
test_expect_success 'validate --ignore-revs-file' '
git rev-parse X^{tree} >ignore_x &&
- test_must_fail git blame --ignore-revs-file ignore_x file
+ git blame --ignore-revs-file ignore_x file
for I in X XT