@@ -131,33 +131,33 @@ static void wt_status_print_unmerged_header(struct wt_status *s)
131
131
{
132
132
const char * c = color (WT_STATUS_HEADER , s );
133
133
134
- color_fprintf_ln ( s -> fp , c , "# Unmerged paths:" );
134
+ status_printf_ln ( s , c , "Unmerged paths:" );
135
135
if (!advice_status_hints )
136
136
return ;
137
137
if (s -> in_merge )
138
138
;
139
139
else if (!s -> is_initial )
140
- color_fprintf_ln ( s -> fp , c , "# (use \"git reset %s <file>...\" to unstage)" , s -> reference );
140
+ status_printf_ln ( s , c , " (use \"git reset %s <file>...\" to unstage)" , s -> reference );
141
141
else
142
- color_fprintf_ln ( s -> fp , c , "# (use \"git rm --cached <file>...\" to unstage)" );
143
- color_fprintf_ln ( s -> fp , c , "# (use \"git add/rm <file>...\" as appropriate to mark resolution)" );
144
- color_fprintf_ln ( s -> fp , c , "# " );
142
+ status_printf_ln ( s , c , " (use \"git rm --cached <file>...\" to unstage)" );
143
+ status_printf_ln ( s , c , " (use \"git add/rm <file>...\" as appropriate to mark resolution)" );
144
+ status_printf_ln ( s , c , "" );
145
145
}
146
146
147
147
static void wt_status_print_cached_header (struct wt_status * s )
148
148
{
149
149
const char * c = color (WT_STATUS_HEADER , s );
150
150
151
- color_fprintf_ln ( s -> fp , c , "# Changes to be committed:" );
151
+ status_printf_ln ( s , c , "Changes to be committed:" );
152
152
if (!advice_status_hints )
153
153
return ;
154
154
if (s -> in_merge )
155
155
; /* NEEDSWORK: use "git reset --unresolve"??? */
156
156
else if (!s -> is_initial )
157
- color_fprintf_ln ( s -> fp , c , "# (use \"git reset %s <file>...\" to unstage)" , s -> reference );
157
+ status_printf_ln ( s , c , " (use \"git reset %s <file>...\" to unstage)" , s -> reference );
158
158
else
159
- color_fprintf_ln ( s -> fp , c , "# (use \"git rm --cached <file>...\" to unstage)" );
160
- color_fprintf_ln ( s -> fp , c , "# " );
159
+ status_printf_ln ( s , c , " (use \"git rm --cached <file>...\" to unstage)" );
160
+ status_printf_ln ( s , c , "" );
161
161
}
162
162
163
163
static void wt_status_print_dirty_header (struct wt_status * s ,
@@ -166,34 +166,34 @@ static void wt_status_print_dirty_header(struct wt_status *s,
166
166
{
167
167
const char * c = color (WT_STATUS_HEADER , s );
168
168
169
- color_fprintf_ln ( s -> fp , c , "# Changes not staged for commit:" );
169
+ status_printf_ln ( s , c , "Changes not staged for commit:" );
170
170
if (!advice_status_hints )
171
171
return ;
172
172
if (!has_deleted )
173
- color_fprintf_ln ( s -> fp , c , "# (use \"git add <file>...\" to update what will be committed)" );
173
+ status_printf_ln ( s , c , " (use \"git add <file>...\" to update what will be committed)" );
174
174
else
175
- color_fprintf_ln ( s -> fp , c , "# (use \"git add/rm <file>...\" to update what will be committed)" );
176
- color_fprintf_ln ( s -> fp , c , "# (use \"git checkout -- <file>...\" to discard changes in working directory)" );
175
+ status_printf_ln ( s , c , " (use \"git add/rm <file>...\" to update what will be committed)" );
176
+ status_printf_ln ( s , c , " (use \"git checkout -- <file>...\" to discard changes in working directory)" );
177
177
if (has_dirty_submodules )
178
- color_fprintf_ln ( s -> fp , c , "# (commit or discard the untracked or modified content in submodules)" );
179
- color_fprintf_ln ( s -> fp , c , "# " );
178
+ status_printf_ln ( s , c , " (commit or discard the untracked or modified content in submodules)" );
179
+ status_printf_ln ( s , c , "" );
180
180
}
181
181
182
182
static void wt_status_print_other_header (struct wt_status * s ,
183
183
const char * what ,
184
184
const char * how )
185
185
{
186
186
const char * c = color (WT_STATUS_HEADER , s );
187
- color_fprintf_ln ( s -> fp , c , "# %s files:" , what );
187
+ status_printf_ln ( s , c , "%s files:" , what );
188
188
if (!advice_status_hints )
189
189
return ;
190
- color_fprintf_ln ( s -> fp , c , "# (use \"git %s <file>...\" to include in what will be committed)" , how );
191
- color_fprintf_ln ( s -> fp , c , "# " );
190
+ status_printf_ln ( s , c , " (use \"git %s <file>...\" to include in what will be committed)" , how );
191
+ status_printf_ln ( s , c , "" );
192
192
}
193
193
194
194
static void wt_status_print_trailer (struct wt_status * s )
195
195
{
196
- color_fprintf_ln ( s -> fp , color (WT_STATUS_HEADER , s ), "# " );
196
+ status_printf_ln ( s , color (WT_STATUS_HEADER , s ), "" );
197
197
}
198
198
199
199
#define quote_path quote_path_relative
@@ -207,7 +207,7 @@ static void wt_status_print_unmerged_data(struct wt_status *s,
207
207
const char * one , * how = "bug" ;
208
208
209
209
one = quote_path (it -> string , -1 , & onebuf , s -> prefix );
210
- color_fprintf ( s -> fp , color (WT_STATUS_HEADER , s ), "# \t" );
210
+ status_printf ( s , color (WT_STATUS_HEADER , s ), "\t" );
211
211
switch (d -> stagemask ) {
212
212
case 1 : how = "both deleted:" ; break ;
213
213
case 2 : how = "added by us:" ; break ;
@@ -217,7 +217,7 @@ static void wt_status_print_unmerged_data(struct wt_status *s,
217
217
case 6 : how = "both added:" ; break ;
218
218
case 7 : how = "both modified:" ; break ;
219
219
}
220
- color_fprintf ( s -> fp , c , "%-20s%s\n" , how , one );
220
+ status_printf_more ( s , c , "%-20s%s\n" , how , one );
221
221
strbuf_release (& onebuf );
222
222
}
223
223
@@ -260,40 +260,40 @@ static void wt_status_print_change_data(struct wt_status *s,
260
260
one = quote_path (one_name , -1 , & onebuf , s -> prefix );
261
261
two = quote_path (two_name , -1 , & twobuf , s -> prefix );
262
262
263
- color_fprintf ( s -> fp , color (WT_STATUS_HEADER , s ), "# \t" );
263
+ status_printf ( s , color (WT_STATUS_HEADER , s ), "\t" );
264
264
switch (status ) {
265
265
case DIFF_STATUS_ADDED :
266
- color_fprintf ( s -> fp , c , "new file: %s" , one );
266
+ status_printf_more ( s , c , "new file: %s" , one );
267
267
break ;
268
268
case DIFF_STATUS_COPIED :
269
- color_fprintf ( s -> fp , c , "copied: %s -> %s" , one , two );
269
+ status_printf_more ( s , c , "copied: %s -> %s" , one , two );
270
270
break ;
271
271
case DIFF_STATUS_DELETED :
272
- color_fprintf ( s -> fp , c , "deleted: %s" , one );
272
+ status_printf_more ( s , c , "deleted: %s" , one );
273
273
break ;
274
274
case DIFF_STATUS_MODIFIED :
275
- color_fprintf ( s -> fp , c , "modified: %s" , one );
275
+ status_printf_more ( s , c , "modified: %s" , one );
276
276
break ;
277
277
case DIFF_STATUS_RENAMED :
278
- color_fprintf ( s -> fp , c , "renamed: %s -> %s" , one , two );
278
+ status_printf_more ( s , c , "renamed: %s -> %s" , one , two );
279
279
break ;
280
280
case DIFF_STATUS_TYPE_CHANGED :
281
- color_fprintf ( s -> fp , c , "typechange: %s" , one );
281
+ status_printf_more ( s , c , "typechange: %s" , one );
282
282
break ;
283
283
case DIFF_STATUS_UNKNOWN :
284
- color_fprintf ( s -> fp , c , "unknown: %s" , one );
284
+ status_printf_more ( s , c , "unknown: %s" , one );
285
285
break ;
286
286
case DIFF_STATUS_UNMERGED :
287
- color_fprintf ( s -> fp , c , "unmerged: %s" , one );
287
+ status_printf_more ( s , c , "unmerged: %s" , one );
288
288
break ;
289
289
default :
290
290
die ("bug: unhandled diff status %c" , status );
291
291
}
292
292
if (extra .len ) {
293
- color_fprintf ( s -> fp , color (WT_STATUS_HEADER , s ), "%s" , extra .buf );
293
+ status_printf_more ( s , color (WT_STATUS_HEADER , s ), "%s" , extra .buf );
294
294
strbuf_release (& extra );
295
295
}
296
- fprintf ( s -> fp , "\n" );
296
+ status_printf_more ( s , GIT_COLOR_NORMAL , "\n" );
297
297
strbuf_release (& onebuf );
298
298
strbuf_release (& twobuf );
299
299
}
@@ -647,9 +647,9 @@ static void wt_status_print_other(struct wt_status *s,
647
647
for (i = 0 ; i < l -> nr ; i ++ ) {
648
648
struct string_list_item * it ;
649
649
it = & (l -> items [i ]);
650
- color_fprintf ( s -> fp , color (WT_STATUS_HEADER , s ), "# \t" );
651
- color_fprintf_ln ( s -> fp , color (WT_STATUS_UNTRACKED , s ), "%s" ,
652
- quote_path (it -> string , strlen (it -> string ),
650
+ status_printf ( s , color (WT_STATUS_HEADER , s ), "\t" );
651
+ status_printf_more ( s , color (WT_STATUS_UNTRACKED , s ),
652
+ "%s\n" , quote_path (it -> string , strlen (it -> string ),
653
653
& buf , s -> prefix ));
654
654
}
655
655
strbuf_release (& buf );
@@ -716,17 +716,17 @@ void wt_status_print(struct wt_status *s)
716
716
branch_status_color = color (WT_STATUS_NOBRANCH , s );
717
717
on_what = "Not currently on any branch." ;
718
718
}
719
- color_fprintf ( s -> fp , color (WT_STATUS_HEADER , s ), "# " );
720
- color_fprintf ( s -> fp , branch_status_color , "%s" , on_what );
721
- color_fprintf_ln ( s -> fp , branch_color , "%s" , branch_name );
719
+ status_printf ( s , color (WT_STATUS_HEADER , s ), "" );
720
+ status_printf_more ( s , branch_status_color , "%s" , on_what );
721
+ status_printf_more ( s , branch_color , "%s\n " , branch_name );
722
722
if (!s -> is_initial )
723
723
wt_status_print_tracking (s );
724
724
}
725
725
726
726
if (s -> is_initial ) {
727
- color_fprintf_ln ( s -> fp , color (WT_STATUS_HEADER , s ), "# " );
728
- color_fprintf_ln ( s -> fp , color (WT_STATUS_HEADER , s ), "# Initial commit" );
729
- color_fprintf_ln ( s -> fp , color (WT_STATUS_HEADER , s ), "# " );
727
+ status_printf_ln ( s , color (WT_STATUS_HEADER , s ), "" );
728
+ status_printf_ln ( s , color (WT_STATUS_HEADER , s ), "Initial commit" );
729
+ status_printf_ln ( s , color (WT_STATUS_HEADER , s ), "" );
730
730
}
731
731
732
732
wt_status_print_updated (s );
@@ -743,15 +743,15 @@ void wt_status_print(struct wt_status *s)
743
743
if (s -> show_ignored_files )
744
744
wt_status_print_other (s , & s -> ignored , "Ignored" , "add -f" );
745
745
} else if (s -> commitable )
746
- fprintf ( s -> fp , "# Untracked files not listed%s\n " ,
746
+ status_printf_ln ( s , GIT_COLOR_NORMAL , " Untracked files not listed%s" ,
747
747
advice_status_hints
748
748
? " (use -u option to show untracked files)" : "" );
749
749
750
750
if (s -> verbose )
751
751
wt_status_print_verbose (s );
752
752
if (!s -> commitable ) {
753
753
if (s -> amend )
754
- fprintf ( s -> fp , "# No changes\n " );
754
+ status_printf_ln ( s , GIT_COLOR_NORMAL , " No changes" );
755
755
else if (s -> nowarn )
756
756
; /* nothing */
757
757
else if (s -> workdir_dirty )
0 commit comments