From: Junio C Hamano <gitster@pobox.com>
To: "Kristoffer Haugsbakk" <kristofferhaugsbakk@fastmail.com>
Cc: "Farid Zakaria" <farid.m.zakaria@gmail.com>,
git@vger.kernel.org, "Patrick Steinhardt" <ps@pks.im>
Subject: Re: [PATCH] notes: do not drop notes written by a concurrent process
Date: Thu, 29 Oct 2026 11:25:43 -0700 [thread overview]
Message-ID: <xmqqbj8c2wk8.fsf@gitster.g> (raw)
In-Reply-To: <3c4f3793-07d4-47c7-b503-13a6ae567147@app.fastmail.com> (Kristoffer Haugsbakk's message of "Thu, 29 Oct 2026 12:05:12 +0100")
"Kristoffer Haugsbakk" <kristofferhaugsbakk@fastmail.com> writes:
> Instead, maybe this would happen in an ideal world:
>
> 1. `master` and `feature1` race to commit a note
> 2. `master` wins
> 3. `feature1` notices that there is a new note commit (from `master`)
> 4. It checks whether that commit changed the commit that *it*
> (`feature1`) wanted to update
> • If so: fail
> • If not: continue
> 5. `feature1` retries (go to (1))
>
> Maybe this is too much logic for a “porcelain” command (interactive
> use), but there is no plumbing Notes command.
Or possibly
1. two races. Both remembers what commit was at the tip of the
notes tree (call it commit #1).
2. each creates a new note commit on top of #1. Call them commit
#2master and #2feature1.
3. 'master' one wins the race. As #2master is a fast-forward from
#1, the notes tree gets #2master at its tip.
4. 'feature1' loses the race. It merges #2feature1 into, or
rebases #2feature1 on top of, #2master and updates the notes
tree.
;-)
next prev parent reply other threads:[~2026-10-29 18:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-29 3:55 [PATCH] notes: do not drop notes written by a concurrent process Farid Zakaria
2026-10-29 11:05 ` Kristoffer Haugsbakk
2026-10-29 18:25 ` Junio C Hamano [this message]
2026-10-29 20:56 ` Farid Zakaria
2026-10-29 21:42 ` Junio C Hamano
2026-10-29 22:16 ` Farid Zakaria
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=xmqqbj8c2wk8.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=farid.m.zakaria@gmail.com \
--cc=git@vger.kernel.org \
--cc=kristofferhaugsbakk@fastmail.com \
--cc=ps@pks.im \
/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