All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jerry Zhang <jerry@skydio.com>
To: git@vger.kernel.org, gitster@pobox.com
Cc: ross@skydio.com, abe@skydio.com, brian.kubisiak@skydio.com,
	Jerry Zhang <jerry@skydio.com>
Subject: [PATCH V2] git-apply: modify prints to account for --3way changes
Date: Tue, 27 Apr 2021 12:40:05 -0700	[thread overview]
Message-ID: <20210427194005.14318-1-jerry@skydio.com> (raw)
In-Reply-To: <20210427011314.28156-1-jerry@skydio.com>

"git apply" specifically calls out when it
is falling back to 3way merge application.
Since the order changed to preferring 3way
and falling back to direct application,
continue that behavior by printing whenever
3way fails and git has to fall back.

Signed-off-by: Jerry Zhang <jerry@skydio.com>
---
V1 -> V2:
- Moved --quiet flag to separate patch

 apply.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/apply.c b/apply.c
index a36d4002ca..7aa49e2048 100644
--- a/apply.c
+++ b/apply.c
@@ -3572,7 +3572,7 @@ static int try_threeway(struct apply_state *state,
 		 read_blob_object(&buf, &pre_oid, patch->old_mode))
 		return error(_("repository lacks the necessary blob to perform 3-way merge."));
 
-	if (state->apply_verbosity > verbosity_silent)
+	if (state->apply_verbosity > verbosity_silent && patch->direct_to_threeway)
 		fprintf(stderr, _("Performing three-way merge...\n"));
 
 	img = strbuf_detach(&buf, &len);
@@ -3639,6 +3639,10 @@ static int apply_data(struct apply_state *state, struct patch *patch,
 		return -1;
 
 	if (!state->threeway || try_threeway(state, &image, patch, st, ce) < 0) {
+		if (state->apply_verbosity > verbosity_silent &&
+		    state->threeway && !patch->direct_to_threeway)
+			fprintf(stderr, _("Falling back to direct application...\n"));
+
 		/* Note: with --reject, apply_fragments() returns 0 */
 		if (patch->direct_to_threeway || apply_fragments(state, &image, patch) < 0)
 			return -1;
-- 
2.29.0


  parent reply	other threads:[~2021-04-27 19:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-27  1:13 [PATCH] git-apply: modify prints to account for --3way changes Jerry Zhang
2021-04-27  7:46 ` Junio C Hamano
2021-04-27 19:40 ` Jerry Zhang [this message]
2021-04-28  7:32   ` [PATCH V2] " Junio C Hamano
2021-04-28 18:26     ` Jerry Zhang
2021-04-29  0:58       ` Junio C Hamano
2021-04-29  2:35   ` [PATCH V3] git-apply: adjust messages " Jerry Zhang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210427194005.14318-1-jerry@skydio.com \
    --to=jerry@skydio.com \
    --cc=abe@skydio.com \
    --cc=brian.kubisiak@skydio.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=ross@skydio.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.