Merge branch 'br/blame-ignore'

"git blame" learned to "ignore" commits in the history, whose
effects (as well as their presence) get ignored.

* br/blame-ignore:
  t8014: remove unnecessary braces
  blame: drop some unused function parameters
  blame: add a test to cover blame_coalesce()
  blame: use the fingerprint heuristic to match ignored lines
  blame: add a fingerprint heuristic to match ignored lines
  blame: optionally track line fingerprints during fill_blame_origin()
  blame: add config options for the output of ignored or unblamable lines
  blame: add the ability to ignore commits and their changes
  blame: use a helper function in blame_chunk()
  Move oidset_parse_file() to oidset.c
  fsck: rename and touch up init_skiplist()
This commit is contained in:
Junio C Hamano
2019-07-19 11:30:20 -07:00
13 changed files with 1855 additions and 99 deletions

37
fsck.c
View File

@ -181,41 +181,6 @@ static int fsck_msg_type(enum fsck_msg_id msg_id,
return msg_type;
}
static void init_skiplist(struct fsck_options *options, const char *path)
{
FILE *fp;
struct strbuf sb = STRBUF_INIT;
struct object_id oid;
fp = fopen(path, "r");
if (!fp)
die("Could not open skip list: %s", path);
while (!strbuf_getline(&sb, fp)) {
const char *p;
const char *hash;
/*
* Allow trailing comments, leading whitespace
* (including before commits), and empty or whitespace
* only lines.
*/
hash = strchr(sb.buf, '#');
if (hash)
strbuf_setlen(&sb, hash - sb.buf);
strbuf_trim(&sb);
if (!sb.len)
continue;
if (parse_oid_hex(sb.buf, &oid, &p) || *p != '\0')
die("Invalid SHA-1: %s", sb.buf);
oidset_insert(&options->skiplist, &oid);
}
if (ferror(fp))
die_errno("Could not read '%s'", path);
fclose(fp);
strbuf_release(&sb);
}
static int parse_msg_type(const char *str)
{
if (!strcmp(str, "error"))
@ -284,7 +249,7 @@ void fsck_set_msg_types(struct fsck_options *options, const char *values)
if (!strcmp(buf, "skiplist")) {
if (equal == len)
die("skiplist requires a path");
init_skiplist(options, buf + equal + 1);
oidset_parse_file(&options->skiplist, buf + equal + 1);
buf += len + 1;
continue;
}