-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* jk/unwanted-advices: status: make "how to stage" messages optional push: make non-fast-forward help message configurable
- Loading branch information
Showing
8 changed files
with
66 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#include "cache.h" | ||
|
||
int advice_push_nonfastforward = 1; | ||
int advice_status_hints = 1; | ||
|
||
static struct { | ||
const char *name; | ||
int *preference; | ||
} advice_config[] = { | ||
{ "pushnonfastforward", &advice_push_nonfastforward }, | ||
{ "statushints", &advice_status_hints }, | ||
}; | ||
|
||
int git_default_advice_config(const char *var, const char *value) | ||
{ | ||
const char *k = skip_prefix(var, "advice."); | ||
int i; | ||
|
||
for (i = 0; i < ARRAY_SIZE(advice_config); i++) { | ||
if (strcmp(k, advice_config[i].name)) | ||
continue; | ||
*advice_config[i].preference = git_config_bool(var, value); | ||
return 0; | ||
} | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#ifndef ADVICE_H | ||
#define ADVICE_H | ||
|
||
extern int advice_push_nonfastforward; | ||
extern int advice_status_hints; | ||
|
||
int git_default_advice_config(const char *var, const char *value); | ||
|
||
#endif /* ADVICE_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters