From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 545201F5AE for ; Mon, 29 Jun 2020 20:22:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388925AbgF2UIC (ORCPT ); Mon, 29 Jun 2020 16:08:02 -0400 Received: from pb-smtp20.pobox.com ([173.228.157.52]:63527 "EHLO pb-smtp20.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388769AbgF2UIA (ORCPT ); Mon, 29 Jun 2020 16:08:00 -0400 Received: from pb-smtp20.pobox.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 469A2DAAA1; Mon, 29 Jun 2020 16:07:59 -0400 (EDT) (envelope-from junio@pobox.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=msOqSxyM5njvWTyQSOs051NIF3Y=; b=mZLiYt cUBQnmd6/KzaDqROAH9HSOi7CsgkbRQ5xDlxzYuFFJP1tDPFVHYQIFuuZquFt2jW dbwN8Jo3JyyaLgxcR3xZj7wLHFdZdHliUKYT3xQmFlb1zfNF0c/oesD935JrLHNA jnRjSnpXUC9XuYKeRNXd+Q1joV2CnmqtrnSNY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=avsRtvowzLdf7FyCK2uv01S6trl8YgMc izWB7wR2jDKrQ55HiPf7h/ayOTLWVE0xhIcsygUb89Yc/bhagjjCKJ9k4ddEqaW+ AcTV4X4MS30FJa0MagfFuG5qTM47rNJ86rBLKD6CryIo/+UiYw4beCXNOG/WGBxG Iy+MsuxAsi0= Received: from pb-smtp20.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 3E40EDAA9E; Mon, 29 Jun 2020 16:07:59 -0400 (EDT) (envelope-from junio@pobox.com) Received: from pobox.com (unknown [35.196.173.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp20.pobox.com (Postfix) with ESMTPSA id 7D887DAA9D; Mon, 29 Jun 2020 16:07:56 -0400 (EDT) (envelope-from junio@pobox.com) From: Junio C Hamano To: "Han-Wen Nienhuys via GitGitGadget" Cc: git@vger.kernel.org, Han-Wen Nienhuys , Han-Wen Nienhuys Subject: Re: [PATCH v19 03/20] checkout: add '\n' to reflog message References: <125695ce92218ca2ddb9868880db542acb0d2a79.1593457018.git.gitgitgadget@gmail.com> Date: Mon, 29 Jun 2020 13:07:54 -0700 In-Reply-To: <125695ce92218ca2ddb9868880db542acb0d2a79.1593457018.git.gitgitgadget@gmail.com> (Han-Wen Nienhuys via GitGitGadget's message of "Mon, 29 Jun 2020 18:56:41 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: 3903BEE2-BA44-11EA-A814-B0405B776F7B-77302942!pb-smtp20.pobox.com Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org "Han-Wen Nienhuys via GitGitGadget" writes: > From: Han-Wen Nienhuys > > Reftable precisely reproduces the given message. This leads to differences, > because the files backend implicitly adds a trailing '\n' to all messages. What does this mean? With the files backend we'll now see a redundant two LFs in a row? I think you are careful enough not to introduce unnecessary compatibility breakage like that, so perhaps "implicitly adds" is a wrong way to characterize what happens in the files backend, and it only adds LF when the message does not end with one, but does not add an extra one if not necessary? If so, then the change in the patch does not break compatibility, but the above description does not give readers confidence that it is indeed the case. IOW it is unclear how this change manages to avoid breaking existing code. Sorry, but I am left puzzled. > > Signed-off-by: Han-Wen Nienhuys > --- > builtin/checkout.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/builtin/checkout.c b/builtin/checkout.c > index af849c644f..bb11fcc4e9 100644 > --- a/builtin/checkout.c > +++ b/builtin/checkout.c > @@ -884,8 +884,9 @@ static void update_refs_for_switch(const struct checkout_opts *opts, > > reflog_msg = getenv("GIT_REFLOG_ACTION"); > if (!reflog_msg) > - strbuf_addf(&msg, "checkout: moving from %s to %s", > - old_desc ? old_desc : "(invalid)", new_branch_info->name); > + strbuf_addf(&msg, "checkout: moving from %s to %s\n", > + old_desc ? old_desc : "(invalid)", > + new_branch_info->name); > else > strbuf_insertstr(&msg, 0, reflog_msg);