@@ -131,33 +131,33 @@ static void wt_status_print_unmerged_header(struct wt_status *s)
131131{
132132 const char * c = color (WT_STATUS_HEADER , s );
133133
134- color_fprintf_ln ( s -> fp , c , "# Unmerged paths:" );
134+ status_printf_ln ( s , c , "Unmerged paths:" );
135135 if (!advice_status_hints )
136136 return ;
137137 if (s -> in_merge )
138138 ;
139139 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 );
141141 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 , "" );
145145}
146146
147147static void wt_status_print_cached_header (struct wt_status * s )
148148{
149149 const char * c = color (WT_STATUS_HEADER , s );
150150
151- color_fprintf_ln ( s -> fp , c , "# Changes to be committed:" );
151+ status_printf_ln ( s , c , "Changes to be committed:" );
152152 if (!advice_status_hints )
153153 return ;
154154 if (s -> in_merge )
155155 ; /* NEEDSWORK: use "git reset --unresolve"??? */
156156 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 );
158158 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 , "" );
161161}
162162
163163static 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,
166166{
167167 const char * c = color (WT_STATUS_HEADER , s );
168168
169- color_fprintf_ln ( s -> fp , c , "# Changes not staged for commit:" );
169+ status_printf_ln ( s , c , "Changes not staged for commit:" );
170170 if (!advice_status_hints )
171171 return ;
172172 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)" );
174174 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)" );
177177 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 , "" );
180180}
181181
182182static void wt_status_print_other_header (struct wt_status * s ,
183183 const char * what ,
184184 const char * how )
185185{
186186 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 );
188188 if (!advice_status_hints )
189189 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 , "" );
192192}
193193
194194static void wt_status_print_trailer (struct wt_status * s )
195195{
196- color_fprintf_ln ( s -> fp , color (WT_STATUS_HEADER , s ), "# " );
196+ status_printf_ln ( s , color (WT_STATUS_HEADER , s ), "" );
197197}
198198
199199#define quote_path quote_path_relative
@@ -207,7 +207,7 @@ static void wt_status_print_unmerged_data(struct wt_status *s,
207207 const char * one , * how = "bug" ;
208208
209209 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" );
211211 switch (d -> stagemask ) {
212212 case 1 : how = "both deleted:" ; break ;
213213 case 2 : how = "added by us:" ; break ;
@@ -217,7 +217,7 @@ static void wt_status_print_unmerged_data(struct wt_status *s,
217217 case 6 : how = "both added:" ; break ;
218218 case 7 : how = "both modified:" ; break ;
219219 }
220- color_fprintf ( s -> fp , c , "%-20s%s\n" , how , one );
220+ status_printf_more ( s , c , "%-20s%s\n" , how , one );
221221 strbuf_release (& onebuf );
222222}
223223
@@ -260,40 +260,40 @@ static void wt_status_print_change_data(struct wt_status *s,
260260 one = quote_path (one_name , -1 , & onebuf , s -> prefix );
261261 two = quote_path (two_name , -1 , & twobuf , s -> prefix );
262262
263- color_fprintf ( s -> fp , color (WT_STATUS_HEADER , s ), "# \t" );
263+ status_printf ( s , color (WT_STATUS_HEADER , s ), "\t" );
264264 switch (status ) {
265265 case DIFF_STATUS_ADDED :
266- color_fprintf ( s -> fp , c , "new file: %s" , one );
266+ status_printf_more ( s , c , "new file: %s" , one );
267267 break ;
268268 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 );
270270 break ;
271271 case DIFF_STATUS_DELETED :
272- color_fprintf ( s -> fp , c , "deleted: %s" , one );
272+ status_printf_more ( s , c , "deleted: %s" , one );
273273 break ;
274274 case DIFF_STATUS_MODIFIED :
275- color_fprintf ( s -> fp , c , "modified: %s" , one );
275+ status_printf_more ( s , c , "modified: %s" , one );
276276 break ;
277277 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 );
279279 break ;
280280 case DIFF_STATUS_TYPE_CHANGED :
281- color_fprintf ( s -> fp , c , "typechange: %s" , one );
281+ status_printf_more ( s , c , "typechange: %s" , one );
282282 break ;
283283 case DIFF_STATUS_UNKNOWN :
284- color_fprintf ( s -> fp , c , "unknown: %s" , one );
284+ status_printf_more ( s , c , "unknown: %s" , one );
285285 break ;
286286 case DIFF_STATUS_UNMERGED :
287- color_fprintf ( s -> fp , c , "unmerged: %s" , one );
287+ status_printf_more ( s , c , "unmerged: %s" , one );
288288 break ;
289289 default :
290290 die ("bug: unhandled diff status %c" , status );
291291 }
292292 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 );
294294 strbuf_release (& extra );
295295 }
296- fprintf ( s -> fp , "\n" );
296+ status_printf_more ( s , GIT_COLOR_NORMAL , "\n" );
297297 strbuf_release (& onebuf );
298298 strbuf_release (& twobuf );
299299}
@@ -647,9 +647,9 @@ static void wt_status_print_other(struct wt_status *s,
647647 for (i = 0 ; i < l -> nr ; i ++ ) {
648648 struct string_list_item * it ;
649649 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 ),
653653 & buf , s -> prefix ));
654654 }
655655 strbuf_release (& buf );
@@ -716,17 +716,17 @@ void wt_status_print(struct wt_status *s)
716716 branch_status_color = color (WT_STATUS_NOBRANCH , s );
717717 on_what = "Not currently on any branch." ;
718718 }
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 );
722722 if (!s -> is_initial )
723723 wt_status_print_tracking (s );
724724 }
725725
726726 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 ), "" );
730730 }
731731
732732 wt_status_print_updated (s );
@@ -743,15 +743,15 @@ void wt_status_print(struct wt_status *s)
743743 if (s -> show_ignored_files )
744744 wt_status_print_other (s , & s -> ignored , "Ignored" , "add -f" );
745745 } 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" ,
747747 advice_status_hints
748748 ? " (use -u option to show untracked files)" : "" );
749749
750750 if (s -> verbose )
751751 wt_status_print_verbose (s );
752752 if (!s -> commitable ) {
753753 if (s -> amend )
754- fprintf ( s -> fp , "# No changes\n " );
754+ status_printf_ln ( s , GIT_COLOR_NORMAL , " No changes" );
755755 else if (s -> nowarn )
756756 ; /* nothing */
757757 else if (s -> workdir_dirty )
0 commit comments