@@ -76,7 +76,7 @@ static void print_table_body_line(struct strbuf *buf1, struct strbuf *buf2, stru
printf(_("|\n"));
}
-void build_and_draw_status_table(struct wt_status *s)
+void build_and_draw_status_table(struct wt_status *s, int add_advice)
{
struct winsize w;
int cols;
@@ -95,14 +95,29 @@ void build_and_draw_status_table(struct wt_status *s)
cols -= 1;
}
+ /* Draw table header */
build_table_border(&table_border, cols);
build_table_entry(&table_col_entry_1, "Untracked files", cols);
build_table_entry(&table_col_entry_2, "Changes not staged for commit", cols);
build_table_entry(&table_col_entry_3, "Changes to be committed", cols);
- /* Draw table header */
printf(_("%s\n"), table_border.buf);
printf(_("|%s|%s|%s|\n"), table_col_entry_1.buf, table_col_entry_2.buf, table_col_entry_3.buf);
+
+ if (add_advice) {
+ build_table_entry(&table_col_entry_1, "(stage: git add <file>)", cols);
+ build_table_entry(&table_col_entry_2, "(stage: git add <file>)", cols);
+ build_table_entry(&table_col_entry_3, "(unstage: git restore --staged <file>)", cols);
+
+ printf(_("|%s|%s|%s|\n"), table_col_entry_1.buf, table_col_entry_2.buf, table_col_entry_3.buf);
+
+ build_table_entry(&table_col_entry_1, "", cols);
+ build_table_entry(&table_col_entry_2, "(discard: git restore --staged <file>)", cols);
+ build_table_entry(&table_col_entry_3, "", cols);
+
+ printf(_("|%s|%s|%s|\n"), table_col_entry_1.buf, table_col_entry_2.buf, table_col_entry_3.buf);
+ }
+
printf(_("%s\n"), table_border.buf);
/* Draw table body */
@@ -1,6 +1,6 @@
#ifndef TABLE_H
#define TABLE_H
-void build_and_draw_status_table(struct wt_status *s);
+void build_and_draw_status_table(struct wt_status *s, int i);
#endif /* TABLE_H */
@@ -2149,7 +2149,7 @@ static void wt_tablestatus_print(struct wt_status *s)
wt_longstatus_print_tracking(s);
}
- build_and_draw_status_table(s);
+ build_and_draw_status_table(s, 0);
}
static void wt_porcelain_print(struct wt_status *s)
Signed-off-by: Jacob Stopak <jacob@initialcommit.io> --- table.c | 19 +++++++++++++++++-- table.h | 2 +- wt-status.c | 2 +- 3 files changed, 19 insertions(+), 4 deletions(-)