@@ -87,30 +87,6 @@ static int show_origin;
87
87
static int show_scope ;
88
88
static int fixed_value ;
89
89
90
- #define ACTION_GET (1<<0)
91
- #define ACTION_GET_ALL (1<<1)
92
- #define ACTION_GET_REGEXP (1<<2)
93
- #define ACTION_REPLACE_ALL (1<<3)
94
- #define ACTION_ADD (1<<4)
95
- #define ACTION_UNSET (1<<5)
96
- #define ACTION_UNSET_ALL (1<<6)
97
- #define ACTION_RENAME_SECTION (1<<7)
98
- #define ACTION_REMOVE_SECTION (1<<8)
99
- #define ACTION_LIST (1<<9)
100
- #define ACTION_EDIT (1<<10)
101
- #define ACTION_SET (1<<11)
102
- #define ACTION_SET_ALL (1<<12)
103
- #define ACTION_GET_COLOR (1<<13)
104
- #define ACTION_GET_COLORBOOL (1<<14)
105
- #define ACTION_GET_URLMATCH (1<<15)
106
-
107
- /*
108
- * The actions "ACTION_LIST | ACTION_GET_*" which may produce more than
109
- * one line of output and which should therefore be paged.
110
- */
111
- #define PAGING_ACTIONS (ACTION_LIST | ACTION_GET_ALL | \
112
- ACTION_GET_REGEXP | ACTION_GET_URLMATCH)
113
-
114
90
#define TYPE_BOOL 1
115
91
#define TYPE_INT 2
116
92
#define TYPE_BOOL_OR_INT 3
@@ -1031,6 +1007,24 @@ static int cmd_config_edit(int argc, const char **argv, const char *prefix)
1031
1007
1032
1008
static int cmd_config_actions (int argc , const char * * argv , const char * prefix )
1033
1009
{
1010
+ enum {
1011
+ ACTION_GET = (1 <<0 ),
1012
+ ACTION_GET_ALL = (1 <<1 ),
1013
+ ACTION_GET_REGEXP = (1 <<2 ),
1014
+ ACTION_REPLACE_ALL = (1 <<3 ),
1015
+ ACTION_ADD = (1 <<4 ),
1016
+ ACTION_UNSET = (1 <<5 ),
1017
+ ACTION_UNSET_ALL = (1 <<6 ),
1018
+ ACTION_RENAME_SECTION = (1 <<7 ),
1019
+ ACTION_REMOVE_SECTION = (1 <<8 ),
1020
+ ACTION_LIST = (1 <<9 ),
1021
+ ACTION_EDIT = (1 <<10 ),
1022
+ ACTION_SET = (1 <<11 ),
1023
+ ACTION_SET_ALL = (1 <<12 ),
1024
+ ACTION_GET_COLOR = (1 <<13 ),
1025
+ ACTION_GET_COLORBOOL = (1 <<14 ),
1026
+ ACTION_GET_URLMATCH = (1 <<15 ),
1027
+ };
1034
1028
const char * comment_arg = NULL ;
1035
1029
int actions = 0 ;
1036
1030
struct option opts [] = {
@@ -1147,7 +1141,11 @@ static int cmd_config_actions(int argc, const char **argv, const char *prefix)
1147
1141
1148
1142
comment = git_config_prepare_comment_string (comment_arg );
1149
1143
1150
- if (actions & PAGING_ACTIONS )
1144
+ /*
1145
+ * The following actions may produce more than one line of output and
1146
+ * should therefore be paged.
1147
+ */
1148
+ if (actions & (ACTION_LIST | ACTION_GET_ALL | ACTION_GET_REGEXP | ACTION_GET_URLMATCH ))
1151
1149
setup_auto_pager ("config" , 1 );
1152
1150
1153
1151
if (actions == ACTION_LIST ) {
0 commit comments