From: Daniel Vetter <daniel@ffwll.ch>
To: Andrzej Hajda <a.hajda@samsung.com>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
dim-tools@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
Marek Szyprowski <m.szyprowski@samsung.com>
Subject: Re: [maintainer-tools PATCH RFC 3/3] dim: fix rr_cache_dir discovery
Date: Mon, 17 Dec 2018 15:46:44 +0100 [thread overview]
Message-ID: <20181217144644.GF21184@phenom.ffwll.local> (raw)
In-Reply-To: <a24373f5-830c-4a12-25be-6e9932e8f64e@samsung.com>
On Mon, Dec 17, 2018 at 10:54:48AM +0100, Andrzej Hajda wrote:
> Hi Daniel,
>
> Thanks for reviewing other two patches.
>
>
> On 14.12.2018 17:29, Daniel Vetter wrote:
> > On Fri, Dec 14, 2018 at 02:38:52PM +0100, Andrzej Hajda wrote:
> >> rr_cache_dir function cannot assume REPO/.git is a directory. On the other
> >> side it should be backward compatible - if rr-cache directory/link already
> >> exists it should be returned.
> >>
> >> Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
> >> ---
> >> Hi,
> >>
> >> I am not sure of the purpose of rr-cache symbolic link, dim does not use
> >> it (except its creation/removal). So this patch should be verified by
> >> someone who knows better what is going on here.
> >>
> >> Regards
> >> Andrzej
> >> ---
> >> dim | 20 +++++++++++---------
> >> 1 file changed, 11 insertions(+), 9 deletions(-)
> >>
> >> diff --git a/dim b/dim
> >> index 3afa8b6..b72ebfd 100755
> >> --- a/dim
> >> +++ b/dim
> >> @@ -554,15 +554,6 @@ function check_conflicts # tree
> >> true
> >> }
> >>
> >> -function rr_cache_dir
> >> -{
> >> - if [ -d $DIM_PREFIX/drm-tip/.git/ ] ; then
> >> - echo $DIM_PREFIX/drm-tip/.git/rr-cache
> >> - else
> >> - echo $DIM_PREFIX/$DIM_REPO/.git/rr-cache
> >> - fi
> >> -}
> > I think this breaks it, rr-cache is shared among all worktrees (which is a
> > big reason for having them).
>
>
> If drm-tip and $DIM_REPO are worktrees (more exactly "linked working
> tree" - ie .git is a file), then rr_cache_dir will return invalid path.
>
> As a result update_rerere_cache will fail create symlink, with this kind
> of error:
>
> ln: failed to create symbolic link '/lab/dim/drm-misc-next/.git':
> File exists
Ah, now I get it, your $DIM_REPO is also a worktree. Yes that's not
supported with the current code.
But your code doesn't fix it. We do _not_ want $(git_dir)/rr-cache here,
but really the .git/rr-cache of the master repo. The worktrees do not have
their own private rr-cache, but use the one of the master repo.
> > And yes dim only sets up the symlink, dim rebuild-tip uses the rr-cache
> > stuff automatically through git merge.
>
>
> I still do not see who and when is using (ie. reading) this link.
> rebuild_tip seems to use only $DIM_PREFIX/drm_rerere/rr-cache. Is there
> some magic inside git itself, or I am just blind?
git merge --rerere-autoupdate uses it internally. We want that drm-tip
uses the rr-cache we store in drm-rerere/rr-cache.
Maybe $(git_dir drm-tip)/../../rr-cache works? Again, the important part
is that we edit the .git/rr-cache in your master repo, not in any of the
worktrees (rr-cache doesn't exist there).
-Daniel
>
>
> Regards
>
> Andrzej
>
>
>
> > -Daniel
> >
> >> -
> >> function git_dir
> >> {
> >> local dir=${1:-$PWD}
> >> @@ -574,6 +565,17 @@ function git_dir
> >> fi
> >> }
> >>
> >> +function rr_cache_dir
> >> +{
> >> + local dir=$(git_dir $DIM_PREFIX/$DIM_REPO)/rr-cache
> >> +
> >> + if [ -d $dir ]; then
> >> + echo $dir
> >> + else
> >> + echo $(git_dir $DIM_PREFIX/drm-tip)/rr-cache
> >> + fi
> >> +}
> >> +
> >> function pull_rerere_cache
> >> {
> >> cd $DIM_PREFIX/drm-rerere/
> >> --
> >> 2.17.1
> >>
> >> _______________________________________________
> >> dim-tools mailing list
> >> dim-tools@lists.freedesktop.org
> >> https://lists.freedesktop.org/mailman/listinfo/dim-tools
>
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2018-12-17 14:46 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20181214133858eucas1p19a983a1f42b3d833868de6e18464ef22@eucas1p1.samsung.com>
2018-12-14 13:38 ` [maintainer-tools PATCH RFC 0/3] dim: fix git directory evaluation Andrzej Hajda
2018-12-14 13:38 ` [maintainer-tools PATCH RFC 1/3] dim: allow git_dir to specify arbitrary work directory Andrzej Hajda
2018-12-14 13:38 ` [maintainer-tools PATCH RFC 2/3] dim: fix git directory handling Andrzej Hajda
2018-12-14 16:26 ` Daniel Vetter
2018-12-14 13:38 ` [maintainer-tools PATCH RFC 3/3] dim: fix rr_cache_dir discovery Andrzej Hajda
2018-12-14 16:29 ` Daniel Vetter
2018-12-17 9:54 ` Andrzej Hajda
2018-12-17 14:46 ` Daniel Vetter [this message]
2018-12-18 7:15 ` Andrzej Hajda
2018-12-18 7:58 ` Daniel Vetter
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=20181217144644.GF21184@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=a.hajda@samsung.com \
--cc=b.zolnierkie@samsung.com \
--cc=dim-tools@lists.freedesktop.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=m.szyprowski@samsung.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