From 9e7e41bf19ed10469f9adb60669b1699c81b8ea6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=B2=9B=E6=96=87=20=28Aleen=29?= Date: Thu, 9 Dec 2021 07:25:55 +0000 Subject: am: support --allow-empty to record specific empty patches MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This option helps to record specific empty patches in the middle of an am session, which does create empty commits only when: 1. the index has not changed 2. lacking a branch When the index has changed, "--allow-empty" will create a non-empty commit like passing "--continue" or "--resolved". Signed-off-by: 徐沛文 (Aleen) Signed-off-by: Junio C Hamano --- wt-status.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'wt-status.c') diff --git a/wt-status.c b/wt-status.c index e4f29b2b4c..09045c62e1 100644 --- a/wt-status.c +++ b/wt-status.c @@ -1212,17 +1212,23 @@ static void show_merge_in_progress(struct wt_status *s, static void show_am_in_progress(struct wt_status *s, const char *color) { + int am_empty_patch; + status_printf_ln(s, color, _("You are in the middle of an am session.")); if (s->state.am_empty_patch) status_printf_ln(s, color, _("The current patch is empty.")); if (s->hints) { - if (!s->state.am_empty_patch) + am_empty_patch = s->state.am_empty_patch; + if (!am_empty_patch) status_printf_ln(s, color, _(" (fix conflicts and then run \"git am --continue\")")); status_printf_ln(s, color, _(" (use \"git am --skip\" to skip this patch)")); + if (am_empty_patch) + status_printf_ln(s, color, + _(" (use \"git am --allow-empty\" to record this patch as an empty commit)")); status_printf_ln(s, color, _(" (use \"git am --abort\" to restore the original branch)")); } -- cgit v1.2.3