All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Christopher Lindee <christopher.lindee@webpros.com>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: [PATCH 2/2] Add transport message for up-to-date references
Date: Wed, 13 Mar 2024 17:07:07 -0700	[thread overview]
Message-ID: <xmqqttl94qxg.fsf@gitster.g> (raw)
In-Reply-To: <SA1PR14MB4691A8AC86E290A3539BE1398D2B2@SA1PR14MB4691.namprd14.prod.outlook.com> (Christopher Lindee's message of "Tue, 12 Mar 2024 21:55:18 +0000")

Christopher Lindee <christopher.lindee@webpros.com> writes:

> Subject: Re: [PATCH 2/2] Add transport message for up-to-date references

Same comment as [1/2].  Perhaps

    push: mark forced no-op pushes differently in the report

or something?

> If the `--send-up-to-date` option in the previous commit is used, the
> "Everything up-to-date!" message will never appear, even if all of the
> refs are up to date.  Moreover, the output `deadbeef..deadbeef` appears
> suspicious, almost as if a collision occurred.  To clarify that the hash
> is, in fact, identical & to allow grepping for the phrase "up-to-date",
> add a message to the output when the ref is transmitted, but no change
> occurred.
>
> Signed-off-by: Christopher Lindee <christopher.lindee@webpros.com>
> ---
>  transport.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/transport.c b/transport.c
> index 84deadd2b6..89802452ea 100644
> --- a/transport.c
> +++ b/transport.c
> @@ -670,6 +670,8 @@ static void print_ok_ref_status(struct ref *ref,
>  			strbuf_addstr(&quickref, "..");
>  			type = ' ';
>  			msg = NULL;
> +			if (oideq(old_oid, new_oid))
> +				msg = "up-to-date";
>  		}
>  		strbuf_add_unique_abbrev(&quickref, new_oid,
>  					 DEFAULT_ABBREV);

This code is in an if/else cascade of this shape:

	if we are deleting
		print [deleted]
	else if they did not have any
		print [new]
	else {
		if we forced
		then
			prepare to say forced
		else
			prepare to say an unforced update
		say "updated" in a certain way
	}

The above addition looks somewhat out of place.  I would understand
if the addition happened like so instead:

diff --git i/transport.c w/transport.c
index df518ead70..bacef94b33 100644
--- i/transport.c
+++ w/transport.c
@@ -666,6 +666,8 @@ static void print_ok_ref_status(struct ref *ref,
 			strbuf_addstr(&quickref, "...");
 			type = '+';
 			msg = "forced update";
+		} else if (oideq(old_oid, new_oid)) {
+			... prepare to say "same but forced no-op" ...
 		} else {
 			strbuf_addstr(&quickref, "..");
 			type = ' ';


to make the new logic flow more like so:

		if we forced
		then
			prepare to say forced
		else if we were forced to tell no-op push
			prepare to say we did no-op
		else
			prepare to say an unforced update
		say "updated" in a certain way

  reply	other threads:[~2024-03-14  0:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-12 21:55 [PATCH 2/2] Add transport message for up-to-date references Christopher Lindee
2024-03-14  0:07 ` Junio C Hamano [this message]
2024-03-15  6:09   ` Christopher Lindee
2024-03-15  6:47     ` Christopher Lindee
2024-03-15 16:49       ` Junio C Hamano
2024-03-15 16:42     ` Junio C Hamano
2024-03-14 21:44 ` Martin Ågren
2024-03-15  3:09   ` Christopher Lindee
2024-03-15 16:54     ` Junio C Hamano

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=xmqqttl94qxg.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=christopher.lindee@webpros.com \
    --cc=git@vger.kernel.org \
    /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.