X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=advice.c;h=0be4b5f008e1646946ba12fa5e51aa0830911ece;hb=c7934306d1504325d26950f35759ad478772e9c3;hp=cb666acc3cf8fdda777febbefac455f3667759f1;hpb=7b576f9910a2945688f04f6ff9d03771f2956618;p=git.git diff --git a/advice.c b/advice.c index cb666acc3..0be4b5f00 100644 --- a/advice.c +++ b/advice.c @@ -3,6 +3,9 @@ int advice_push_nonfastforward = 1; int advice_status_hints = 1; int advice_commit_before_merge = 1; +int advice_resolve_conflict = 1; +int advice_implicit_identity = 1; +int advice_detached_head = 1; static struct { const char *name; @@ -11,6 +14,9 @@ static struct { { "pushnonfastforward", &advice_push_nonfastforward }, { "statushints", &advice_status_hints }, { "commitbeforemerge", &advice_commit_before_merge }, + { "resolveconflict", &advice_resolve_conflict }, + { "implicitidentity", &advice_implicit_identity }, + { "detachedhead", &advice_detached_head }, }; int git_default_advice_config(const char *var, const char *value) @@ -27,3 +33,17 @@ int git_default_advice_config(const char *var, const char *value) return 0; } + +void NORETURN die_resolve_conflict(const char *me) +{ + if (advice_resolve_conflict) + /* + * Message used both when 'git commit' fails and when + * other commands doing a merge do. + */ + die("'%s' is not possible because you have unmerged files.\n" + "Please, fix them up in the work tree, and then use 'git add/rm ' as\n" + "appropriate to mark resolution and make a commit, or use 'git commit -a'.", me); + else + die("'%s' is not possible because you have unmerged files.", me); +}