@matheusbsbs / matheus-bagliano / commits / 82dca84871
Fork 0

Align section headers of 'git status' to new 'git add'.

Now that 'git add' is considered a first-class UI for 'update-index' and that the 'git add' documentation states "Even modified files must be added to the set of changes about to be committed" we should make the output of 'git status' align with that documentation and common usage. So now we see a status output such as: # Added but not yet committed: # (will commit) # # new file: x # # Changed but not added: # (use "git add file1 file2" to include for commit) # # modified: x # # Untracked files: # (use "git add" on files to include for commit) # # y which just reads better in the context of using 'git add' to manipulate a commit (and not a checkin, whatever the heck that is). We also now support 'color.status.added' as an alias for the existing 'color.status.updated', as this alias more closely aligns with the current output and documentation. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>

Shawn O. Pearce committed Dec 15, 2006 at 21:53 UTC 82dca84871637ac9812c0dec27f56d07cfba524c
4 files changed +13 -12
Documentation/config.txt
+2 -2
@@ -169,8 +169,8 @@ color.status::
169 color.status.<slot>::
170 Use customized color for status colorization. `<slot>` is
171 one of `header` (the header text of the status message),
172 - `updated` (files which are updated but not committed),
173 - `changed` (files which are changed but not updated in the index),
172 + `added` or `updated` (files which are added but not committed),
173 + `changed` (files which are changed but not added in the index),
174 or `untracked` (files which are not tracked by git). The values of
175 these variables may be specified as in color.diff.<slot>.
176
Documentation/git-reset.txt
+1 -1
@@ -31,7 +31,7 @@ OPTIONS
31 --soft::
32 Does not touch the index file nor the working tree at all, but
33 requires them to be in a good order. This leaves all your changed
34 - files "Updated but not checked in", as gitlink:git-status[1] would
34 + files "Added but not yet committed", as gitlink:git-status[1] would
35 put it.
36
37 --hard::
Documentation/tutorial-2.txt
+5 -5
@@ -353,23 +353,23 @@ situation:
353 ------------------------------------------------
354 $ git status
355 #
356 -# Updated but not checked in:
356 +# Added but not yet committed:
357 # (will commit)
358 #
359 # new file: closing.txt
360 #
361 #
362 -# Changed but not updated:
363 -# (use git-update-index to mark for commit)
362 +# Changed but not added:
363 +# (use "git add file1 file2" to include for commit)
364 #
365 # modified: file.txt
366 #
367 ------------------------------------------------
368
369 Since the current state of closing.txt is cached in the index file,
370 -it is listed as "updated but not checked in". Since file.txt has
370 +it is listed as "added but not yet committed". Since file.txt has
371 changes in the working directory that aren't reflected in the index,
372 -it is marked "changed but not updated". At this point, running "git
372 +it is marked "changed but not added". At this point, running "git
373 commit" would create a commit that added closing.txt (with its new
374 contents), but that didn't modify file.txt.
375
wt-status.c
+5 -4
@@ -21,7 +21,8 @@ static int parse_status_slot(const char *var, int offset)
21 {
22 if (!strcasecmp(var+offset, "header"))
23 return WT_STATUS_HEADER;
24 - if (!strcasecmp(var+offset, "updated"))
24 + if (!strcasecmp(var+offset, "updated")
25 + || !strcasecmp(var+offset, "added"))
26 return WT_STATUS_UPDATED;
27 if (!strcasecmp(var+offset, "changed"))
28 return WT_STATUS_CHANGED;
@@ -146,7 +147,7 @@ static void wt_status_print_updated_cb(struct diff_queue_struct *q,
147 if (q->queue[i]->status == 'U')
148 continue;
149 if (!shown_header) {
149 - wt_status_print_header("Updated but not checked in",
150 + wt_status_print_header("Added but not yet committed",
151 "will commit");
152 s->commitable = 1;
153 shown_header = 1;
@@ -163,7 +164,7 @@ static void wt_status_print_changed_cb(struct diff_queue_struct *q,
164 {
165 int i;
166 if (q->nr)
166 - wt_status_print_header("Changed but not updated", use_add_msg);
167 + wt_status_print_header("Changed but not added", use_add_msg);
168 for (i = 0; i < q->nr; i++)
169 wt_status_print_filepair(WT_STATUS_CHANGED, q->queue[i]);
170 if (q->nr)
@@ -178,7 +179,7 @@ void wt_status_print_initial(struct wt_status *s)
179 read_cache();
180 if (active_nr) {
181 s->commitable = 1;
181 - wt_status_print_header("Updated but not checked in",
182 + wt_status_print_header("Added but not yet committed",
183 "will commit");
184 }
185 for (i = 0; i < active_nr; i++) {