From 4de53ce0437e7326908c4a0571ac4ff9b8d5aeff Mon Sep 17 00:00:00 2001 From: Avery Pennarun Date: Wed, 16 Jul 2008 15:19:27 -0400 Subject: [PATCH 01/17] Reword "your branch has diverged..." lines to reduce line length The message length depends on the length of the branch name. In my case, the branch name "origin/add-chickens2" put the first line of the "your branch has diverged" message over 80 characters, which triggered "less -FS" to not exit automatically as expected. This patch rewords the messages to make the lines generally shorter, so that you'd need a significantly longer branch name to trigger the problem. Signed-off-by: Avery Pennarun Signed-off-by: Junio C Hamano --- remote.c | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/remote.c b/remote.c index df8bd72ba9..0d6020beb8 100644 --- a/remote.c +++ b/remote.c @@ -1308,34 +1308,28 @@ int stat_tracking_info(struct branch *branch, int *num_ours, int *num_theirs) int format_tracking_info(struct branch *branch, struct strbuf *sb) { int num_ours, num_theirs; - const char *base, *remote_msg; + const char *base; if (!stat_tracking_info(branch, &num_ours, &num_theirs)) return 0; base = branch->merge[0]->dst; if (!prefixcmp(base, "refs/remotes/")) { - remote_msg = " remote"; base += strlen("refs/remotes/"); - } else { - remote_msg = ""; } if (!num_theirs) - strbuf_addf(sb, "Your branch is ahead of the tracked%s branch '%s' " + strbuf_addf(sb, "Your branch is ahead of '%s' " "by %d commit%s.\n", - remote_msg, base, - num_ours, (num_ours == 1) ? "" : "s"); + base, num_ours, (num_ours == 1) ? "" : "s"); else if (!num_ours) - strbuf_addf(sb, "Your branch is behind the tracked%s branch '%s' " - "by %d commit%s,\n" + strbuf_addf(sb, "Your branch is behind '%s' " + "by %d commit%s, " "and can be fast-forwarded.\n", - remote_msg, base, - num_theirs, (num_theirs == 1) ? "" : "s"); + base, num_theirs, (num_theirs == 1) ? "" : "s"); else - strbuf_addf(sb, "Your branch and the tracked%s branch '%s' " - "have diverged,\nand respectively " - "have %d and %d different commit(s) each.\n", - remote_msg, base, - num_ours, num_theirs); + strbuf_addf(sb, "Your branch and '%s' have diverged,\n" + "and have %d and %d different commit(s) each, " + "respectively.\n", + base, num_ours, num_theirs); return 1; } From 9196e825875dce66f6bc95dda01f5833f20bc5e5 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 16 Jul 2008 20:25:18 -0700 Subject: [PATCH 02/17] rerere.autoupdate: change the message when autoupdate is in effect This changes the message rerere issues after reusing previous conflict resolution from "Resolved" to "Staged" when autoupdate option is in effect. It is envisioned that in practice, some auto resolitions are trickier and iffier than others, and we would want to add a feature to mark individual resolutions as "this is ok to autoupdate" or "do not autoupdate the result using this resolution even when rerere.autoupdate is in effect" in the future. When that happens, these messages will make the distinction clearer. Signed-off-by: Junio C Hamano --- rerere.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rerere.c b/rerere.c index 12589215e8..0456aa6376 100644 --- a/rerere.c +++ b/rerere.c @@ -278,10 +278,13 @@ static int do_plain_rerere(struct path_list *rr, int fd) if (has_resolution(name)) { if (!merge(name, path)) { - fprintf(stderr, "Resolved '%s' using " - "previous resolution.\n", path); if (rerere_autoupdate) path_list_insert(path, &update); + fprintf(stderr, + "%s '%s' using previous resolution.\n", + rerere_autoupdate + ? "Staged" : "Resolved", + path); goto mark_resolved; } } From 3e5057a8b4499f7b000cd465a3adf6ef22b89f2a Mon Sep 17 00:00:00 2001 From: Nanako Shiraishi Date: Wed, 16 Jul 2008 19:39:10 +0900 Subject: [PATCH 03/17] git am --abort After failing to apply patches in the middle of a series, "git am --abort" lets you go back to the original commit. [jc: doc/help update from Olivier, and fixups for "am -3" squashed in] Signed-off-by: Nanako Shiraishi Signed-off-by: Olivier Marin Signed-off-by: Junio C Hamano --- Documentation/git-am.txt | 5 +++- git-am.sh | 21 ++++++++++++--- t/t4151-am-abort.sh | 56 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 77 insertions(+), 5 deletions(-) create mode 100755 t/t4151-am-abort.sh diff --git a/Documentation/git-am.txt b/Documentation/git-am.txt index 2d7f162594..e010a16493 100644 --- a/Documentation/git-am.txt +++ b/Documentation/git-am.txt @@ -13,7 +13,7 @@ SYNOPSIS [--3way] [--interactive] [--binary] [--whitespace=