Merge branch 'pw/sparse-cache-tree-verify-fix'
[alt-git.git] / advice.h
blob601265fd1070da02246eae167a85e855b3979eae
1 #ifndef ADVICE_H
2 #define ADVICE_H
4 #include "git-compat-util.h"
6 struct string_list;
8 /*
9 * To add a new advice, you need to:
10 * Define a new advice_type.
11 * Add a new entry to advice_setting array.
12 * Add the new config variable to Documentation/config/advice.txt.
13 * Call advise_if_enabled to print your advice.
15 enum advice_type {
16 ADVICE_ADD_EMBEDDED_REPO,
17 ADVICE_ADD_EMPTY_PATHSPEC,
18 ADVICE_ADD_IGNORED_FILE,
19 ADVICE_AM_WORK_DIR,
20 ADVICE_CHECKOUT_AMBIGUOUS_REMOTE_BRANCH_NAME,
21 ADVICE_COMMIT_BEFORE_MERGE,
22 ADVICE_DETACHED_HEAD,
23 ADVICE_FETCH_SHOW_FORCED_UPDATES,
24 ADVICE_GRAFT_FILE_DEPRECATED,
25 ADVICE_IGNORED_HOOK,
26 ADVICE_IMPLICIT_IDENTITY,
27 ADVICE_NESTED_TAG,
28 ADVICE_OBJECT_NAME_WARNING,
29 ADVICE_PUSH_ALREADY_EXISTS,
30 ADVICE_PUSH_FETCH_FIRST,
31 ADVICE_PUSH_NEEDS_FORCE,
32 ADVICE_PUSH_NON_FF_CURRENT,
33 ADVICE_PUSH_NON_FF_MATCHING,
34 ADVICE_PUSH_UNQUALIFIED_REF_NAME,
35 ADVICE_PUSH_UPDATE_REJECTED_ALIAS,
36 ADVICE_PUSH_UPDATE_REJECTED,
37 ADVICE_PUSH_REF_NEEDS_UPDATE,
38 ADVICE_RESET_QUIET_WARNING,
39 ADVICE_RESOLVE_CONFLICT,
40 ADVICE_RM_HINTS,
41 ADVICE_SEQUENCER_IN_USE,
42 ADVICE_SET_UPSTREAM_FAILURE,
43 ADVICE_STATUS_AHEAD_BEHIND_WARNING,
44 ADVICE_STATUS_HINTS,
45 ADVICE_STATUS_U_OPTION,
46 ADVICE_SUBMODULE_ALTERNATE_ERROR_STRATEGY_DIE,
47 ADVICE_UPDATE_SPARSE_PATH,
48 ADVICE_WAITING_FOR_EDITOR,
49 ADVICE_SKIPPED_CHERRY_PICKS,
52 int git_default_advice_config(const char *var, const char *value);
53 __attribute__((format (printf, 1, 2)))
54 void advise(const char *advice, ...);
56 /**
57 * Checks if advice type is enabled (can be printed to the user).
58 * Should be called before advise().
60 int advice_enabled(enum advice_type type);
62 /**
63 * Checks the visibility of the advice before printing.
65 __attribute__((format (printf, 2, 3)))
66 void advise_if_enabled(enum advice_type type, const char *advice, ...);
68 int error_resolve_conflict(const char *me);
69 void NORETURN die_resolve_conflict(const char *me);
70 void NORETURN die_conclude_merge(void);
71 void NORETURN die_ff_impossible(void);
72 void advise_on_updating_sparse_paths(struct string_list *pathspec_list);
73 void detach_advice(const char *new_name);
75 #endif /* ADVICE_H */