summaryrefslogtreecommitdiff
path: root/builtin/receive-pack.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-08-03 18:01:18 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-08-03 18:01:18 (GMT)
commitb2f44feba593ed0c4294a6f9933c8a1b6f190e04 (patch)
tree3b3d19bc7fd5883a4cdf6e0bbf8cf161a63eeab9 /builtin/receive-pack.c
parentbe9cb560e31c76c00760dadb151b5e3059970586 (diff)
parent1335f732892601368876e0e41c9ea288c2ab18f3 (diff)
downloadgit-b2f44feba593ed0c4294a6f9933c8a1b6f190e04.zip
git-b2f44feba593ed0c4294a6f9933c8a1b6f190e04.tar.gz
git-b2f44feba593ed0c4294a6f9933c8a1b6f190e04.tar.bz2
Merge branch 'js/fsck-opt'
Allow ignoring fsck errors on specific set of known-to-be-bad objects, and also tweaking warning level of various kinds of non critical breakages reported. * js/fsck-opt: fsck: support ignoring objects in `git fsck` via fsck.skiplist fsck: git receive-pack: support excluding objects from fsck'ing fsck: introduce `git fsck --connectivity-only` fsck: support demoting errors to warnings fsck: document the new receive.fsck.<msg-id> options fsck: allow upgrading fsck warnings to errors fsck: optionally ignore specific fsck issues completely fsck: disallow demoting grave fsck errors to warnings fsck: add a simple test for receive.fsck.<msg-id> fsck: make fsck_tag() warn-friendly fsck: handle multiple authors in commits specially fsck: make fsck_commit() warn-friendly fsck: make fsck_ident() warn-friendly fsck: report the ID of the error/warning fsck (receive-pack): allow demoting errors to warnings fsck: offer a function to demote fsck errors to warnings fsck: provide a function to parse fsck message IDs fsck: introduce identifiers for fsck messages fsck: introduce fsck options
Diffstat (limited to 'builtin/receive-pack.c')
-rw-r--r--builtin/receive-pack.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index 94d0571..4ced2eb 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -19,6 +19,7 @@
#include "tag.h"
#include "gpg-interface.h"
#include "sigchain.h"
+#include "fsck.h"
static const char receive_pack_usage[] = "git receive-pack <git-dir>";
@@ -36,6 +37,7 @@ static enum deny_action deny_current_branch = DENY_UNCONFIGURED;
static enum deny_action deny_delete_current = DENY_UNCONFIGURED;
static int receive_fsck_objects = -1;
static int transfer_fsck_objects = -1;
+static struct strbuf fsck_msg_types = STRBUF_INIT;
static int receive_unpack_limit = -1;
static int transfer_unpack_limit = -1;
static int advertise_atomic_push = 1;
@@ -115,6 +117,26 @@ static int receive_pack_config(const char *var, const char *value, void *cb)
return 0;
}
+ if (strcmp(var, "receive.fsck.skiplist") == 0) {
+ const char *path;
+
+ if (git_config_pathname(&path, var, value))
+ return 1;
+ strbuf_addf(&fsck_msg_types, "%cskiplist=%s",
+ fsck_msg_types.len ? ',' : '=', path);
+ free((char *)path);
+ return 0;
+ }
+
+ if (skip_prefix(var, "receive.fsck.", &var)) {
+ if (is_valid_msg_type(var, value))
+ strbuf_addf(&fsck_msg_types, "%c%s=%s",
+ fsck_msg_types.len ? ',' : '=', var, value);
+ else
+ warning("Skipping unknown msg id '%s'", var);
+ return 0;
+ }
+
if (strcmp(var, "receive.fsckobjects") == 0) {
receive_fsck_objects = git_config_bool(var, value);
return 0;
@@ -1490,7 +1512,8 @@ static const char *unpack(int err_fd, struct shallow_info *si)
if (quiet)
argv_array_push(&child.args, "-q");
if (fsck_objects)
- argv_array_push(&child.args, "--strict");
+ argv_array_pushf(&child.args, "--strict%s",
+ fsck_msg_types.buf);
child.no_stdout = 1;
child.err = err_fd;
child.git_cmd = 1;
@@ -1508,7 +1531,8 @@ static const char *unpack(int err_fd, struct shallow_info *si)
argv_array_pushl(&child.args, "index-pack",
"--stdin", hdr_arg, keep_arg, NULL);
if (fsck_objects)
- argv_array_push(&child.args, "--strict");
+ argv_array_pushf(&child.args, "--strict%s",
+ fsck_msg_types.buf);
if (fix_thin)
argv_array_push(&child.args, "--fix-thin");
child.out = -1;