From: "Дилян Палаузов" <dilyan.palauzov@aegee.org>
To: Duy Nguyen <pclouds@gmail.com>, Eric Sunshine <sunshine@sunshineco.com>
Cc: Git List <git@vger.kernel.org>
Subject: Re: Worktree silently deleted on git fetch/gc/log
Date: Fri, 2 Mar 2018 12:34:23 +0100 [thread overview]
Message-ID: <b34d74fa-f4c7-fb4a-49df-cd7ebd996d95@aegee.org> (raw)
In-Reply-To: <CACsJy8BUKCG-yiYX3ouMVa44iEo0swHpTkhW3ho_T0PCP81DSw@mail.gmail.com>
Hello Duy,
thanks for your answer.
Your assumption is correct: when renaming the directory apparently I have not adjusted /git/A/.git/worktrees/B/gitdir to the new location.
I fixed the situation by renaming /git/B to /git/B.bak, creating a new worktree pointing to /git/B (with branch g), then deleting /git/B and moving /git/B.bak to /git/B .
Consider adjusting the documentation as suggested below, possibly using a different wording.
Regards
Дилян
On 03/02/18 00:56, Duy Nguyen wrote:
> On Fri, Mar 2, 2018 at 3:14 AM, Eric Sunshine <sunshine@sunshineco.com> wrote:
>> As far as I know, there isn't any code in Git which would
>> automatically remove the .git/worktrees/B directory, so it's not clear
>> how that happened.
>
> "git worktree prune" does, which is called by "git gc" and that was
> actually executed from the command output in the original mail.
>
> Дилян Палаузов did you move /git/B away manually? For example, you
> originally created "B" with
>
> git worktree add /somewhere/B g
>
> then you do this at some point
>
> mv /somewhere/B /git/B
>
Signed-off-by Дилян Палаузов <git-dpa@aegee.org>
---
diff --git a/Documentation/git-gc.txt b/Documentation/git-gc.txt
index 571b5a7..33655c4 100644
--- a/Documentation/git-gc.txt
+++ b/Documentation/git-gc.txt
@@ -15,8 +15,8 @@ DESCRIPTION
-----------
Runs a number of housekeeping tasks within the current repository,
such as compressing file revisions (to reduce disk space and increase
-performance) and removing unreachable objects which may have been
-created from prior invocations of 'git add'.
+performance), removing unreachable objects, which may have been
+created from prior invocations of 'git add', and calling 'git worktree prune'.
Users are encouraged to run this task on a regular basis within
each repository to maintain good disk space utilization and good
diff --git a/Documentation/git-worktree.txt b/Documentation/git-worktree.txt
index 5ac3f68..4b0d32f 100644
--- a/Documentation/git-worktree.txt
+++ b/Documentation/git-worktree.txt
@@ -82,7 +82,7 @@ with `--reason`.
prune::
-Prune working tree information in $GIT_DIR/worktrees.
+Prune working tree information in $GIT_DIR/worktrees. Called implicitly by 'git gc'.
unlock::
--
2.10.0.298.gc59cecb
next prev parent reply other threads:[~2018-03-02 11:34 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-28 12:44 Worktree silently deleted on git fetch/gc/log Дилян Палаузов
2018-03-01 18:09 ` Eric Sunshine
2018-03-01 19:24 ` Дилян Палаузов
2018-03-01 20:14 ` Eric Sunshine
2018-03-01 23:56 ` Duy Nguyen
2018-03-02 11:34 ` Дилян Палаузов [this message]
2018-03-02 11:40 ` Eric Sunshine
2018-03-02 11:53 ` Duy Nguyen
2018-03-03 10:05 ` Eric Sunshine
2018-03-07 10:01 ` Duy Nguyen
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=b34d74fa-f4c7-fb4a-49df-cd7ebd996d95@aegee.org \
--to=dilyan.palauzov@aegee.org \
--cc=git@vger.kernel.org \
--cc=pclouds@gmail.com \
--cc=sunshine@sunshineco.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).