git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Christian Couder <christian.couder@gmail.com>
Cc: git <git@vger.kernel.org>, "Jeff King" <peff@peff.net>,
	"Ævar Arnfjörð" <avarab@gmail.com>,
	"Nguyen Thai Ngoc Duy" <pclouds@gmail.com>,
	"David Turner" <dturner@twopensource.com>,
	"Eric Sunshine" <sunshine@sunshineco.com>,
	"Torsten Bögershausen" <tboegi@web.de>,
	"Christian Couder" <chriscool@tuxfamily.org>
Subject: Re: [PATCH v2 10/10] dir: do not use untracked cache ident anymore
Date: Thu, 17 Dec 2015 10:33:27 -0800	[thread overview]
Message-ID: <xmqq1talc4co.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <CAP8UFD0Y252vmqxziy4Y8Bp3cw6fS0iOVFzZG+=wGt7K25V8Yg@mail.gmail.com> (Christian Couder's message of "Thu, 17 Dec 2015 17:54:34 +0100")

Christian Couder <christian.couder@gmail.com> writes:

> In the "git worktree" documentation there is:
>
> "If you move a linked working tree to another file system, or within a
> file system that does not support hard links, you need to run at least
> one git command inside the linked working tree (e.g. git status) in
> order to update its administrative files in the repository so that
> they do not get automatically pruned."
>
> It looks like git can detect when a worktree created with "git
> worktree" has been moved and I wonder if it would be possible to
> detect if the main worktree pointed to by GIT_WORK_TREE as moved.

As I personally do not find "moving a working tree" a very
compelling use case, I'd be fine if cached information is not used
when the actual worktree and the root of the cached untracked paths
are different.

If you are going to change the in-index data of untracked cache
anyway (like you attempted with 10/10 patch), I think a lot more
sensible simplification may be to make the mechanism _always_ keep
track of the worktree that is rooted one level above the index, and
not use the cache in all other cases.  That way, if you move the
working tree in its entirety (i.e. $foo/{Makefile,.git/,untracked}
all move to $bar/. at the same time), the untracked cache data that
was in $foo/.git/index, which knew about $foo/untracked, will now
know about $bar/untracked when the index is moved to $bar/.git/index
automatically.

  reply	other threads:[~2015-12-17 18:33 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-15 16:28 [PATCH v2 00/10] Untracked cache improvements Christian Couder
2015-12-15 16:28 ` [PATCH v2 01/10] update-index: use enum for untracked cache options Christian Couder
2015-12-17 12:06   ` Torsten Bögershausen
2015-12-15 16:28 ` [PATCH v2 02/10] update-index: add --test-untracked-cache Christian Couder
2015-12-17 18:05   ` David Turner
2015-12-15 16:28 ` [PATCH v2 03/10] update-index: add untracked cache notifications Christian Couder
2015-12-15 16:28 ` [PATCH v2 04/10] update-index: move 'uc' var declaration Christian Couder
2015-12-15 16:28 ` [PATCH v2 05/10] dir: add add_untracked_cache() Christian Couder
2015-12-15 16:28 ` [PATCH v2 06/10] dir: add remove_untracked_cache() Christian Couder
2015-12-15 16:28 ` [PATCH v2 07/10] dir: free untracked cache when removing it Christian Couder
2015-12-15 19:05   ` Junio C Hamano
2015-12-15 16:28 ` [PATCH v2 08/10] config: add core.untrackedCache Christian Couder
2015-12-15 16:28 ` [PATCH v2 09/10] t7063: add tests for core.untrackedCache Christian Couder
2015-12-15 16:28 ` [PATCH v2 10/10] dir: do not use untracked cache ident anymore Christian Couder
2015-12-15 19:49   ` Junio C Hamano
2015-12-17 16:54     ` Christian Couder
2015-12-17 18:33       ` Junio C Hamano [this message]
2015-12-18  8:32         ` Christian Couder

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqq1talc4co.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=avarab@gmail.com \
    --cc=chriscool@tuxfamily.org \
    --cc=christian.couder@gmail.com \
    --cc=dturner@twopensource.com \
    --cc=git@vger.kernel.org \
    --cc=pclouds@gmail.com \
    --cc=peff@peff.net \
    --cc=sunshine@sunshineco.com \
    --cc=tboegi@web.de \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).