git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Arturo Seijas Fernandez <arturo.seijas@canonical.com>
Cc: git@vger.kernel.org
Subject: Re: [BUG] git config --unset is not idempotent
Date: Thu, 25 Aug 2022 09:25:25 -0700	[thread overview]
Message-ID: <xmqqk06w2sui.fsf@gitster.g> (raw)
In-Reply-To: <CAHckPJS6ibtxbU+VKwDaU6pFMtJ5SMcWnBi6D2pY+ekqpWsqXg@mail.gmail.com> (Arturo Seijas Fernandez's message of "Thu, 25 Aug 2022 10:52:16 +0200")

Arturo Seijas Fernandez <arturo.seijas@canonical.com> writes:

> The command "git config --unset [option]" is not idempotent. It is
> currently returning a success  code when the property had already been
> set and a 5 error code otherwise.

"rm" is not "idempotent", either.

    echo >file
    rm file ; echo $?
    rm file ; echo $?

The "git config --unset" command signals the inability to unset a
variable when the variable to be unset does not even exist.

      parent reply	other threads:[~2022-08-25 16:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-25  8:52 [BUG] git config --unset is not idempotent Arturo Seijas Fernandez
2022-08-25  9:40 ` Jeff King
2022-08-25 16:25 ` Junio C Hamano [this message]

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=xmqqk06w2sui.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=arturo.seijas@canonical.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).