mirror of
https://github.com/git/git.git
synced 2024-11-27 03:53:55 +08:00
Merge branch 'fc/advice-diverged-history'
After "git pull" that is configured with pull.rebase=false merge.ff=only fails due to our end having our own development, give advice messages to get out of the "Not possible to fast-forward" state. * fc/advice-diverged-history: advice: add diverging advice for novices
This commit is contained in:
commit
9de14c71f7
@ -136,4 +136,6 @@ advice.*::
|
||||
Advice shown when either linkgit:git-add[1] or linkgit:git-rm[1]
|
||||
is asked to update index entries outside the current sparse
|
||||
checkout.
|
||||
diverging::
|
||||
Advice shown when a fast-forward is not possible.
|
||||
--
|
||||
|
9
advice.c
9
advice.c
@ -46,6 +46,7 @@ static struct {
|
||||
[ADVICE_COMMIT_BEFORE_MERGE] = { "commitBeforeMerge", 1 },
|
||||
[ADVICE_DETACHED_HEAD] = { "detachedHead", 1 },
|
||||
[ADVICE_SUGGEST_DETACHING_HEAD] = { "suggestDetachingHead", 1 },
|
||||
[ADVICE_DIVERGING] = { "diverging", 1 },
|
||||
[ADVICE_FETCH_SHOW_FORCED_UPDATES] = { "fetchShowForcedUpdates", 1 },
|
||||
[ADVICE_GRAFT_FILE_DEPRECATED] = { "graftFileDeprecated", 1 },
|
||||
[ADVICE_IGNORED_HOOK] = { "ignoredHook", 1 },
|
||||
@ -219,6 +220,14 @@ void NORETURN die_conclude_merge(void)
|
||||
|
||||
void NORETURN die_ff_impossible(void)
|
||||
{
|
||||
advise_if_enabled(ADVICE_DIVERGING,
|
||||
_("Diverging branches can't be fast-forwarded, you need to either:\n"
|
||||
"\n"
|
||||
"\tgit merge --no-ff\n"
|
||||
"\n"
|
||||
"or:\n"
|
||||
"\n"
|
||||
"\tgit rebase\n"));
|
||||
die(_("Not possible to fast-forward, aborting."));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user