]> git.ipfire.org Git - thirdparty/git.git/blame - advice.h
advice: fix an unexpected leading space
[thirdparty/git.git] / advice.h
CommitLineData
75194438
JK
1#ifndef ADVICE_H
2#define ADVICE_H
3
a20f7047
MT
4struct string_list;
5
b3b18d16
HW
6/*
7 * To add a new advice, you need to:
8 * Define a new advice_type.
9 * Add a new entry to advice_setting array.
10 * Add the new config variable to Documentation/config/advice.txt.
11 * Call advise_if_enabled to print your advice.
12 */
eddd134c 13enum advice_type {
b3b18d16 14 ADVICE_ADD_EMBEDDED_REPO,
69290551
BB
15 ADVICE_ADD_EMPTY_PATHSPEC,
16 ADVICE_ADD_IGNORED_FILE,
e4921d87 17 ADVICE_AMBIGUOUS_FETCH_REFSPEC,
3196029b 18 ADVICE_AM_WORK_DIR,
b3b18d16
HW
19 ADVICE_CHECKOUT_AMBIGUOUS_REMOTE_BRANCH_NAME,
20 ADVICE_COMMIT_BEFORE_MERGE,
21 ADVICE_DETACHED_HEAD,
765071a8 22 ADVICE_DIVERGING,
b3b18d16
HW
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,
3196029b 34 ADVICE_PUSH_REF_NEEDS_UPDATE,
b3b18d16 35 ADVICE_PUSH_UNQUALIFIED_REF_NAME,
b3b18d16 36 ADVICE_PUSH_UPDATE_REJECTED,
3196029b 37 ADVICE_PUSH_UPDATE_REJECTED_ALIAS,
9396251b 38 ADVICE_RESET_NO_REFRESH_WARNING,
b3b18d16
HW
39 ADVICE_RESOLVE_CONFLICT,
40 ADVICE_RM_HINTS,
41 ADVICE_SEQUENCER_IN_USE,
42 ADVICE_SET_UPSTREAM_FAILURE,
3196029b 43 ADVICE_SKIPPED_CHERRY_PICKS,
b3b18d16
HW
44 ADVICE_STATUS_AHEAD_BEHIND_WARNING,
45 ADVICE_STATUS_HINTS,
46 ADVICE_STATUS_U_OPTION,
961b130d 47 ADVICE_SUBMODULES_NOT_UPDATED,
3196029b
RJ
48 ADVICE_SUBMODULE_ALTERNATE_ERROR_STRATEGY_DIE,
49 ADVICE_SUGGEST_DETACHING_HEAD,
a20f7047 50 ADVICE_UPDATE_SPARSE_PATH,
b3b18d16 51 ADVICE_WAITING_FOR_EDITOR,
35f0383c 52 ADVICE_WORKTREE_ADD_ORPHAN,
b3b18d16
HW
53};
54
75194438 55int git_default_advice_config(const char *var, const char *value);
4621085b 56__attribute__((format (printf, 1, 2)))
38ef61cf 57void advise(const char *advice, ...);
b3b18d16
HW
58
59/**
60 * Checks if advice type is enabled (can be printed to the user).
61 * Should be called before advise().
62 */
63int advice_enabled(enum advice_type type);
64
65/**
66 * Checks the visibility of the advice before printing.
67 */
927dc330 68__attribute__((format (printf, 2, 3)))
b3b18d16
HW
69void advise_if_enabled(enum advice_type type, const char *advice, ...);
70
38ef61cf 71int error_resolve_conflict(const char *me);
55454427 72void NORETURN die_resolve_conflict(const char *me);
4a4cf9e8 73void NORETURN die_conclude_merge(void);
3d5fc24d 74void NORETURN die_ff_impossible(void);
a20f7047 75void advise_on_updating_sparse_paths(struct string_list *pathspec_list);
2857093b 76void detach_advice(const char *new_name);
5efd533e 77void advise_on_moving_dirty_path(struct string_list *pathspec_list);
d38a30df 78
75194438 79#endif /* ADVICE_H */