From: Elijah Newren <newren@gmail.com>
To: Ephrim Khong <dr.khong@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
Git Mailing List <git@vger.kernel.org>
Subject: Re: [RFC PATCH] merge-recursive: create new files with O_EXCL
Date: Thu, 11 Mar 2021 10:01:50 -0800 [thread overview]
Message-ID: <CABPp-BFPj4E=pOK_f=w9k_zGA+=A1F0Hv-PgYyNDdN30mXMBuw@mail.gmail.com> (raw)
In-Reply-To: <cd7c6682-7409-f72c-8751-02b70a423f83@gmail.com>
On Thu, Mar 11, 2021 at 1:58 AM Ephrim Khong <dr.khong@gmail.com> wrote:
>
> On 11.03.2021 00:01, Junio C Hamano wrote:
> > Ephrim Khong <dr.khong@gmail.com> writes:
> As a side-note, the strace on the affected file also shows that git
> writes that file twice during the merge, with the same content. There
> might be some potential to further optimize merges to avoid such
> double-writes. A small example to reproduce, note how "b" is opened
> twice during the merge:
>
> git init
> echo "foo" > a
> git add a
> git commit -m "Initial commit"
>
> git mv a b
> git commit -m "File moved"
>
> git checkout -b other_branch HEAD~
> touch c && git add c && git commit -m "Some other commit"
> strace -otrace git merge master -m "merge message"
> grep '"b"' trace
Yeah, this is somewhat fundamental to merge-recursive's implementation
design; fixing it essentially requires a rewrite. That rewrite is
nearing completion; so this double-write issue will be fixed when
merge-ort is complete (or for anyone who applies the patches and tries
it out now).
In fact, if you don't see the permissions problems when switching
branches (because branch switching uses O_EXCL?), then merge-ort
almost certainly incidentally fixes that problem for you as well.
next prev parent reply other threads:[~2021-03-11 18:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-10 7:57 [RFC PATCH] merge-recursive: create new files with O_EXCL Ephrim Khong
2021-03-10 23:01 ` Junio C Hamano
2021-03-11 9:54 ` Ephrim Khong
2021-03-11 17:52 ` Junio C Hamano
2021-03-11 18:01 ` Elijah Newren [this message]
2021-03-13 1:08 ` brian m. carlson
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='CABPp-BFPj4E=pOK_f=w9k_zGA+=A1F0Hv-PgYyNDdN30mXMBuw@mail.gmail.com' \
--to=newren@gmail.com \
--cc=dr.khong@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/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).