git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Christian Couder <christian.couder@gmail.com>
To: Junio C Hamano <gitster@pobox.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 17:54:34 +0100	[thread overview]
Message-ID: <CAP8UFD0Y252vmqxziy4Y8Bp3cw6fS0iOVFzZG+=wGt7K25V8Yg@mail.gmail.com> (raw)
In-Reply-To: <xmqqd1u7fq5r.fsf@gitster.mtv.corp.google.com>

On Tue, Dec 15, 2015 at 8:49 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Christian Couder <christian.couder@gmail.com> writes:
>
>> +/*
>> + * We used to save the location of the work tree and the kernel version,
>> + * but it was not a good idea, so we now just save an empty string.
>> + */
>
> I do agree that storing the kernel version (or hostname or whatever
> specific to the machine) was not a good idea.  I however suspect
> that you must save and check the location of the working tree,
> though, for correctness.  If you use one GIT_DIR and GIT_WORK_TREE
> to do "git add" or whatever, and then use the same GIT_DIR but a
> different GIT_WORK_TREE, you should be able to notice that a
> directory D in the old GIT_WORK_TREE whose modification time you
> recorded is different from the directory D with the same name but in
> the new GIT_WORK_TREE, no?

Yeah, if people use many worktrees made using "git worktree", the code
above should be fine because there is one index per worktree, but if
they just use one GIT_DIR with many GIT_WORK_TREE then there will be
only one index used.

I am wondering about the case when the worktree is moved and then
GIT_WORK_TREE is changed to reflect the new path were the worktree has
been moved.

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.

  reply	other threads:[~2015-12-17 16:54 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 [this message]
2015-12-17 18:33       ` Junio C Hamano
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='CAP8UFD0Y252vmqxziy4Y8Bp3cw6fS0iOVFzZG+=wGt7K25V8Yg@mail.gmail.com' \
    --to=christian.couder@gmail.com \
    --cc=avarab@gmail.com \
    --cc=chriscool@tuxfamily.org \
    --cc=dturner@twopensource.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --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).