Skip to content

Commit 3196029

Browse files
rjustogitster
authored andcommitted
advice: sort the advice related lists
Let's keep the advice related lists sorted to make them more digestible. A multi-line comment has also been changed; that produces the unexpected 'insertion != deletion' in this supposedly 'only sort lines' commit. Signed-off-by: Rubén Justo <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a54a84b commit 3196029

File tree

3 files changed

+88
-91
lines changed

3 files changed

+88
-91
lines changed

Documentation/config/advice.txt

Lines changed: 77 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,56 @@ advice.*::
44
can tell Git that you do not need help by setting these to 'false':
55
+
66
--
7+
addEmbeddedRepo::
8+
Advice on what to do when you've accidentally added one
9+
git repo inside of another.
10+
addEmptyPathspec::
11+
Advice shown if a user runs the add command without providing
12+
the pathspec parameter.
13+
addIgnoredFile::
14+
Advice shown if a user attempts to add an ignored file to
15+
the index.
16+
amWorkDir::
17+
Advice that shows the location of the patch file when
18+
linkgit:git-am[1] fails to apply it.
719
ambiguousFetchRefspec::
820
Advice shown when a fetch refspec for multiple remotes maps to
921
the same remote-tracking branch namespace and causes branch
1022
tracking set-up to fail.
23+
checkoutAmbiguousRemoteBranchName::
24+
Advice shown when the argument to
25+
linkgit:git-checkout[1] and linkgit:git-switch[1]
26+
ambiguously resolves to a
27+
remote tracking branch on more than one remote in
28+
situations where an unambiguous argument would have
29+
otherwise caused a remote-tracking branch to be
30+
checked out. See the `checkout.defaultRemote`
31+
configuration variable for how to set a given remote
32+
to be used by default in some situations where this
33+
advice would be printed.
34+
commitBeforeMerge::
35+
Advice shown when linkgit:git-merge[1] refuses to
36+
merge to avoid overwriting local changes.
37+
detachedHead::
38+
Advice shown when you used
39+
linkgit:git-switch[1] or linkgit:git-checkout[1]
40+
to move to the detached HEAD state, to instruct how to
41+
create a local branch after the fact.
42+
diverging::
43+
Advice shown when a fast-forward is not possible.
1144
fetchShowForcedUpdates::
1245
Advice shown when linkgit:git-fetch[1] takes a long time
1346
to calculate forced updates after ref updates, or to warn
1447
that the check is disabled.
15-
pushUpdateRejected::
16-
Set this variable to 'false' if you want to disable
17-
'pushNonFFCurrent', 'pushNonFFMatching', 'pushAlreadyExists',
18-
'pushFetchFirst', 'pushNeedsForce', and 'pushRefNeedsUpdate'
19-
simultaneously.
20-
pushNonFFCurrent::
21-
Advice shown when linkgit:git-push[1] fails due to a
22-
non-fast-forward update to the current branch.
23-
pushNonFFMatching::
24-
Advice shown when you ran linkgit:git-push[1] and pushed
25-
'matching refs' explicitly (i.e. you used ':', or
26-
specified a refspec that isn't your current branch) and
27-
it resulted in a non-fast-forward error.
48+
ignoredHook::
49+
Advice shown if a hook is ignored because the hook is not
50+
set as executable.
51+
implicitIdentity::
52+
Advice on how to set your identity configuration when
53+
your information is guessed from the system username and
54+
domain name.
55+
nestedTag::
56+
Advice shown if a user attempts to recursively tag a tag object.
2857
pushAlreadyExists::
2958
Shown when linkgit:git-push[1] rejects an update that
3059
does not qualify for fast-forwarding (e.g., a tag.)
@@ -37,17 +66,42 @@ advice.*::
3766
tries to overwrite a remote ref that points at an
3867
object that is not a commit-ish, or make the remote
3968
ref point at an object that is not a commit-ish.
69+
pushNonFFCurrent::
70+
Advice shown when linkgit:git-push[1] fails due to a
71+
non-fast-forward update to the current branch.
72+
pushNonFFMatching::
73+
Advice shown when you ran linkgit:git-push[1] and pushed
74+
'matching refs' explicitly (i.e. you used ':', or
75+
specified a refspec that isn't your current branch) and
76+
it resulted in a non-fast-forward error.
77+
pushRefNeedsUpdate::
78+
Shown when linkgit:git-push[1] rejects a forced update of
79+
a branch when its remote-tracking ref has updates that we
80+
do not have locally.
4081
pushUnqualifiedRefname::
4182
Shown when linkgit:git-push[1] gives up trying to
4283
guess based on the source and destination refs what
4384
remote ref namespace the source belongs in, but where
4485
we can still suggest that the user push to either
4586
refs/heads/* or refs/tags/* based on the type of the
4687
source object.
47-
pushRefNeedsUpdate::
48-
Shown when linkgit:git-push[1] rejects a forced update of
49-
a branch when its remote-tracking ref has updates that we
50-
do not have locally.
88+
pushUpdateRejected::
89+
Set this variable to 'false' if you want to disable
90+
'pushNonFFCurrent', 'pushNonFFMatching', 'pushAlreadyExists',
91+
'pushFetchFirst', 'pushNeedsForce', and 'pushRefNeedsUpdate'
92+
simultaneously.
93+
resetNoRefresh::
94+
Advice to consider using the `--no-refresh` option to
95+
linkgit:git-reset[1] when the command takes more than 2 seconds
96+
to refresh the index after reset.
97+
resolveConflict::
98+
Advice shown by various commands when conflicts
99+
prevent the operation from being performed.
100+
rmHints::
101+
In case of failure in the output of linkgit:git-rm[1],
102+
show directions on how to proceed from the current state.
103+
sequencerInUse::
104+
Advice shown when a sequencer command is already in progress.
51105
skippedCherryPicks::
52106
Shown when linkgit:git-rebase[1] skips a commit that has already
53107
been cherry-picked onto the upstream branch.
@@ -68,76 +122,22 @@ advice.*::
68122
Advise to consider using the `-u` option to linkgit:git-status[1]
69123
when the command takes more than 2 seconds to enumerate untracked
70124
files.
71-
commitBeforeMerge::
72-
Advice shown when linkgit:git-merge[1] refuses to
73-
merge to avoid overwriting local changes.
74-
resetNoRefresh::
75-
Advice to consider using the `--no-refresh` option to
76-
linkgit:git-reset[1] when the command takes more than 2 seconds
77-
to refresh the index after reset.
78-
resolveConflict::
79-
Advice shown by various commands when conflicts
80-
prevent the operation from being performed.
81-
sequencerInUse::
82-
Advice shown when a sequencer command is already in progress.
83-
implicitIdentity::
84-
Advice on how to set your identity configuration when
85-
your information is guessed from the system username and
86-
domain name.
87-
detachedHead::
88-
Advice shown when you used
89-
linkgit:git-switch[1] or linkgit:git-checkout[1]
90-
to move to the detached HEAD state, to instruct how to
91-
create a local branch after the fact.
92-
suggestDetachingHead::
93-
Advice shown when linkgit:git-switch[1] refuses to detach HEAD
94-
without the explicit `--detach` option.
95-
checkoutAmbiguousRemoteBranchName::
96-
Advice shown when the argument to
97-
linkgit:git-checkout[1] and linkgit:git-switch[1]
98-
ambiguously resolves to a
99-
remote tracking branch on more than one remote in
100-
situations where an unambiguous argument would have
101-
otherwise caused a remote-tracking branch to be
102-
checked out. See the `checkout.defaultRemote`
103-
configuration variable for how to set a given remote
104-
to be used by default in some situations where this
105-
advice would be printed.
106-
amWorkDir::
107-
Advice that shows the location of the patch file when
108-
linkgit:git-am[1] fails to apply it.
109-
rmHints::
110-
In case of failure in the output of linkgit:git-rm[1],
111-
show directions on how to proceed from the current state.
112-
addEmbeddedRepo::
113-
Advice on what to do when you've accidentally added one
114-
git repo inside of another.
115-
ignoredHook::
116-
Advice shown if a hook is ignored because the hook is not
117-
set as executable.
118-
waitingForEditor::
119-
Print a message to the terminal whenever Git is waiting for
120-
editor input from the user.
121-
nestedTag::
122-
Advice shown if a user attempts to recursively tag a tag object.
123125
submoduleAlternateErrorStrategyDie::
124126
Advice shown when a submodule.alternateErrorStrategy option
125127
configured to "die" causes a fatal error.
126128
submodulesNotUpdated::
127129
Advice shown when a user runs a submodule command that fails
128130
because `git submodule update --init` was not run.
129-
addIgnoredFile::
130-
Advice shown if a user attempts to add an ignored file to
131-
the index.
132-
addEmptyPathspec::
133-
Advice shown if a user runs the add command without providing
134-
the pathspec parameter.
131+
suggestDetachingHead::
132+
Advice shown when linkgit:git-switch[1] refuses to detach HEAD
133+
without the explicit `--detach` option.
135134
updateSparsePath::
136135
Advice shown when either linkgit:git-add[1] or linkgit:git-rm[1]
137136
is asked to update index entries outside the current sparse
138137
checkout.
139-
diverging::
140-
Advice shown when a fast-forward is not possible.
138+
waitingForEditor::
139+
Print a message to the terminal whenever Git is waiting for
140+
editor input from the user.
141141
worktreeAddOrphan::
142142
Advice shown when a user tries to create a worktree from an
143143
invalid reference, to instruct how to create a new unborn

advice.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,11 @@ static struct {
4040
[ADVICE_ADD_EMBEDDED_REPO] = { "addEmbeddedRepo", 1 },
4141
[ADVICE_ADD_EMPTY_PATHSPEC] = { "addEmptyPathspec", 1 },
4242
[ADVICE_ADD_IGNORED_FILE] = { "addIgnoredFile", 1 },
43-
[ADVICE_AM_WORK_DIR] = { "amWorkDir", 1 },
4443
[ADVICE_AMBIGUOUS_FETCH_REFSPEC] = { "ambiguousFetchRefspec", 1 },
44+
[ADVICE_AM_WORK_DIR] = { "amWorkDir", 1 },
4545
[ADVICE_CHECKOUT_AMBIGUOUS_REMOTE_BRANCH_NAME] = { "checkoutAmbiguousRemoteBranchName", 1 },
4646
[ADVICE_COMMIT_BEFORE_MERGE] = { "commitBeforeMerge", 1 },
4747
[ADVICE_DETACHED_HEAD] = { "detachedHead", 1 },
48-
[ADVICE_SUGGEST_DETACHING_HEAD] = { "suggestDetachingHead", 1 },
4948
[ADVICE_DIVERGING] = { "diverging", 1 },
5049
[ADVICE_FETCH_SHOW_FORCED_UPDATES] = { "fetchShowForcedUpdates", 1 },
5150
[ADVICE_GRAFT_FILE_DEPRECATED] = { "graftFileDeprecated", 1 },
@@ -56,15 +55,12 @@ static struct {
5655
[ADVICE_PUSH_ALREADY_EXISTS] = { "pushAlreadyExists", 1 },
5756
[ADVICE_PUSH_FETCH_FIRST] = { "pushFetchFirst", 1 },
5857
[ADVICE_PUSH_NEEDS_FORCE] = { "pushNeedsForce", 1 },
59-
[ADVICE_PUSH_REF_NEEDS_UPDATE] = { "pushRefNeedsUpdate", 1 },
60-
61-
/* make this an alias for backward compatibility */
62-
[ADVICE_PUSH_UPDATE_REJECTED_ALIAS] = { "pushNonFastForward", 1 },
63-
6458
[ADVICE_PUSH_NON_FF_CURRENT] = { "pushNonFFCurrent", 1 },
6559
[ADVICE_PUSH_NON_FF_MATCHING] = { "pushNonFFMatching", 1 },
60+
[ADVICE_PUSH_REF_NEEDS_UPDATE] = { "pushRefNeedsUpdate", 1 },
6661
[ADVICE_PUSH_UNQUALIFIED_REF_NAME] = { "pushUnqualifiedRefName", 1 },
6762
[ADVICE_PUSH_UPDATE_REJECTED] = { "pushUpdateRejected", 1 },
63+
[ADVICE_PUSH_UPDATE_REJECTED_ALIAS] = { "pushNonFastForward", 1 }, /* backwards compatibility */
6864
[ADVICE_RESET_NO_REFRESH_WARNING] = { "resetNoRefresh", 1 },
6965
[ADVICE_RESOLVE_CONFLICT] = { "resolveConflict", 1 },
7066
[ADVICE_RM_HINTS] = { "rmHints", 1 },
@@ -74,8 +70,9 @@ static struct {
7470
[ADVICE_STATUS_AHEAD_BEHIND_WARNING] = { "statusAheadBehindWarning", 1 },
7571
[ADVICE_STATUS_HINTS] = { "statusHints", 1 },
7672
[ADVICE_STATUS_U_OPTION] = { "statusUoption", 1 },
77-
[ADVICE_SUBMODULE_ALTERNATE_ERROR_STRATEGY_DIE] = { "submoduleAlternateErrorStrategyDie", 1 },
7873
[ADVICE_SUBMODULES_NOT_UPDATED] = { "submodulesNotUpdated", 1 },
74+
[ADVICE_SUBMODULE_ALTERNATE_ERROR_STRATEGY_DIE] = { "submoduleAlternateErrorStrategyDie", 1 },
75+
[ADVICE_SUGGEST_DETACHING_HEAD] = { "suggestDetachingHead", 1 },
7976
[ADVICE_UPDATE_SPARSE_PATH] = { "updateSparsePath", 1 },
8077
[ADVICE_WAITING_FOR_EDITOR] = { "waitingForEditor", 1 },
8178
[ADVICE_WORKTREE_ADD_ORPHAN] = { "worktreeAddOrphan", 1 },

advice.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,12 @@ struct string_list;
1414
ADVICE_ADD_EMBEDDED_REPO,
1515
ADVICE_ADD_EMPTY_PATHSPEC,
1616
ADVICE_ADD_IGNORED_FILE,
17-
ADVICE_AM_WORK_DIR,
1817
ADVICE_AMBIGUOUS_FETCH_REFSPEC,
18+
ADVICE_AM_WORK_DIR,
1919
ADVICE_CHECKOUT_AMBIGUOUS_REMOTE_BRANCH_NAME,
2020
ADVICE_COMMIT_BEFORE_MERGE,
2121
ADVICE_DETACHED_HEAD,
2222
ADVICE_DIVERGING,
23-
ADVICE_SUGGEST_DETACHING_HEAD,
2423
ADVICE_FETCH_SHOW_FORCED_UPDATES,
2524
ADVICE_GRAFT_FILE_DEPRECATED,
2625
ADVICE_IGNORED_HOOK,
@@ -32,23 +31,24 @@ struct string_list;
3231
ADVICE_PUSH_NEEDS_FORCE,
3332
ADVICE_PUSH_NON_FF_CURRENT,
3433
ADVICE_PUSH_NON_FF_MATCHING,
34+
ADVICE_PUSH_REF_NEEDS_UPDATE,
3535
ADVICE_PUSH_UNQUALIFIED_REF_NAME,
36-
ADVICE_PUSH_UPDATE_REJECTED_ALIAS,
3736
ADVICE_PUSH_UPDATE_REJECTED,
38-
ADVICE_PUSH_REF_NEEDS_UPDATE,
37+
ADVICE_PUSH_UPDATE_REJECTED_ALIAS,
3938
ADVICE_RESET_NO_REFRESH_WARNING,
4039
ADVICE_RESOLVE_CONFLICT,
4140
ADVICE_RM_HINTS,
4241
ADVICE_SEQUENCER_IN_USE,
4342
ADVICE_SET_UPSTREAM_FAILURE,
43+
ADVICE_SKIPPED_CHERRY_PICKS,
4444
ADVICE_STATUS_AHEAD_BEHIND_WARNING,
4545
ADVICE_STATUS_HINTS,
4646
ADVICE_STATUS_U_OPTION,
47-
ADVICE_SUBMODULE_ALTERNATE_ERROR_STRATEGY_DIE,
4847
ADVICE_SUBMODULES_NOT_UPDATED,
48+
ADVICE_SUBMODULE_ALTERNATE_ERROR_STRATEGY_DIE,
49+
ADVICE_SUGGEST_DETACHING_HEAD,
4950
ADVICE_UPDATE_SPARSE_PATH,
5051
ADVICE_WAITING_FOR_EDITOR,
51-
ADVICE_SKIPPED_CHERRY_PICKS,
5252
ADVICE_WORKTREE_ADD_ORPHAN,
5353
};
5454

0 commit comments

Comments
 (0)