All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Alban Gruin <alban.gruin@gmail.com>,
	Phillip Wood <phillip.wood@dunelm.org.uk>,
	Elijah Newren <newren@gmail.com>
Subject: Re: [PATCH] sequencer: rectify empty hint in call of require_clean_work_tree()
Date: Fri, 28 Apr 2023 00:33:56 +0200	[thread overview]
Message-ID: <ZEr4VKMPSYZZxgIM@ugly> (raw)
In-Reply-To: <xmqqmt2thvuu.fsf@gitster.g>

On Thu, Apr 27, 2023 at 02:13:29PM -0700, Junio C Hamano wrote:
>I think the right fix would be more like the attached patch, which
>will fix any other callsites that pass "" at the same time.  Of
>course, you can fix the callers on top, but that is secondary.
>
there is only that one incorrect (in-tree) call.
i don't think that making the behavior more compliant with the shell 
implementation is particularly elegant or even useful.
if i wanted to be super-pedantic about it, i'd assert that non-null 
strings are non-empty. but that would only help if all error paths 
actually have test coverage.

>--- i/wt-status.c
>+++ w/wt-status.c
>@@ -2650,7 +2650,7 @@ int require_clean_work_tree(struct repository *r,
> 
>-		if (hint)
>+		if (hint && *hint)
> 			error("%s", hint);

-- ossi


  reply	other threads:[~2023-04-27 22:34 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-23 16:22 [PATCH] sequencer: rectify empty hint in call of require_clean_work_tree() Oswald Buddenhagen
2023-04-27  7:58 ` Oswald Buddenhagen
2023-04-27 21:13   ` Junio C Hamano
2023-04-27 22:33     ` Oswald Buddenhagen [this message]
2023-05-02 18:57       ` Felipe Contreras
2023-05-03  7:15         ` Oswald Buddenhagen
2023-08-07 17:09 ` [PATCH v2] " Oswald Buddenhagen
2023-08-07 20:19   ` Junio C Hamano
2023-08-09 17:15     ` [PATCH v3] " Oswald Buddenhagen
2023-08-09 21:44       ` Junio C Hamano
2023-08-10 11:24         ` Oswald Buddenhagen
2023-08-10 16:04           ` Junio C Hamano
2023-08-24 15:00           ` [PATCH v4] " Oswald Buddenhagen
2023-08-24 15:59             ` Junio C Hamano
2023-08-09  1:24   ` [PATCH v2] " 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=ZEr4VKMPSYZZxgIM@ugly \
    --to=oswald.buddenhagen@gmx.de \
    --cc=alban.gruin@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=newren@gmail.com \
    --cc=phillip.wood@dunelm.org.uk \
    /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.