git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH v2] branch: do not fail a no-op --edit-desc
Date: Fri, 30 Sep 2022 11:13:40 -0700	[thread overview]
Message-ID: <xmqqill4k9wr.fsf@gitster.g> (raw)
In-Reply-To: <220930.861qrsvj12.gmgdl@evledraar.gmail.com> ("Ævar Arnfjörð Bjarmason"'s message of "Fri, 30 Sep 2022 19:58:03 +0200")

Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:

>> Ah, OK, so in short, _gently() is still unusable to use for that.  I
>> guess it means that the approach taken by v1 would be a better
>> solution, then.
>
> As you noted it's got a TOCTOU instead, so we might wipe away good
> config entirely.

I do not think that is the case.

What you have in mind is probably something entirely different.  If
you open two windows, start "edit description" in both, write a
description in one of them, then write a different description in
another, depending on the order you save the buffer and cause the
"git branch --edit-desc" that invoked the editor to use the edited
result, the description written in the editor that was later closed
will win, instead of telling you "you started from state X and you
want to update to state Y, but in the meantime somebody else made it
state Z, so I won't overwrite it with state Y".  But that has always
been with us, IIUC.

The only "funny" thing the change makes it do is leave the good
config as-is, if the user starts without an existing branch
description and exits with an empty edit buffer, instead of removing
the description written in the other window in the meantime.  That
is quite far from wiping away good config entirely.


  reply	other threads:[~2022-09-30 18:14 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-28 19:15 [PATCH] branch: do not fail a no-op --edit-desc Junio C Hamano
2022-09-28 23:04 ` Rubén Justo
2022-09-28 23:40   ` Junio C Hamano
2022-09-29 21:49 ` Rubén Justo
2022-09-29 22:26   ` Junio C Hamano
2022-09-30 22:59     ` Rubén Justo
2022-10-01  9:15     ` Rubén Justo
2022-09-30  1:27 ` [PATCH v2] " Junio C Hamano
2022-09-30 10:21   ` Ævar Arnfjörð Bjarmason
2022-09-30 17:01     ` Junio C Hamano
2022-09-30 17:58       ` Ævar Arnfjörð Bjarmason
2022-09-30 18:13         ` Junio C Hamano [this message]
2022-09-30 18:06   ` [PATCH v3] " 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=xmqqill4k9wr.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=avarab@gmail.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).