Skip to content

Commit 1184564

Browse files
crorvickgitster
authored andcommitted
push: rename config variable for more general use
The 'pushNonFastForward' advice config can be used to squelch several instances of push-related advice. Rename it to 'pushUpdateRejected' to cover other reject scenarios that are unrelated to fast-forwarding. Retain the old name for compatibility. Signed-off-by: Chris Rorvick <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a272b28 commit 1184564

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

Documentation/config.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ advice.*::
140140
can tell Git that you do not need help by setting these to 'false':
141141
+
142142
--
143-
pushNonFastForward::
143+
pushUpdateRejected::
144144
Set this variable to 'false' if you want to disable
145145
'pushNonFFCurrent', 'pushNonFFDefault', and
146146
'pushNonFFMatching' simultaneously.

advice.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "cache.h"
22

3-
int advice_push_nonfastforward = 1;
3+
int advice_push_update_rejected = 1;
44
int advice_push_non_ff_current = 1;
55
int advice_push_non_ff_default = 1;
66
int advice_push_non_ff_matching = 1;
@@ -14,7 +14,7 @@ static struct {
1414
const char *name;
1515
int *preference;
1616
} advice_config[] = {
17-
{ "pushnonfastforward", &advice_push_nonfastforward },
17+
{ "pushupdaterejected", &advice_push_update_rejected },
1818
{ "pushnonffcurrent", &advice_push_non_ff_current },
1919
{ "pushnonffdefault", &advice_push_non_ff_default },
2020
{ "pushnonffmatching", &advice_push_non_ff_matching },
@@ -23,6 +23,9 @@ static struct {
2323
{ "resolveconflict", &advice_resolve_conflict },
2424
{ "implicitidentity", &advice_implicit_identity },
2525
{ "detachedhead", &advice_detached_head },
26+
27+
/* make this an alias for backward compatibility */
28+
{ "pushnonfastforward", &advice_push_update_rejected }
2629
};
2730

2831
void advise(const char *advice, ...)

advice.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#include "git-compat-util.h"
55

6-
extern int advice_push_nonfastforward;
6+
extern int advice_push_update_rejected;
77
extern int advice_push_non_ff_current;
88
extern int advice_push_non_ff_default;
99
extern int advice_push_non_ff_matching;

builtin/push.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,21 +226,21 @@ static const char message_advice_ref_already_exists[] =
226226

227227
static void advise_pull_before_push(void)
228228
{
229-
if (!advice_push_non_ff_current || !advice_push_nonfastforward)
229+
if (!advice_push_non_ff_current || !advice_push_update_rejected)
230230
return;
231231
advise(_(message_advice_pull_before_push));
232232
}
233233

234234
static void advise_use_upstream(void)
235235
{
236-
if (!advice_push_non_ff_default || !advice_push_nonfastforward)
236+
if (!advice_push_non_ff_default || !advice_push_update_rejected)
237237
return;
238238
advise(_(message_advice_use_upstream));
239239
}
240240

241241
static void advise_checkout_pull_push(void)
242242
{
243-
if (!advice_push_non_ff_matching || !advice_push_nonfastforward)
243+
if (!advice_push_non_ff_matching || !advice_push_update_rejected)
244244
return;
245245
advise(_(message_advice_checkout_pull_push));
246246
}

0 commit comments

Comments
 (0)