git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Stefan Beller <sbeller@google.com>
To: Duy Nguyen <pclouds@gmail.com>
Cc: Brandon Williams <bmwill@google.com>,
	"git@vger.kernel.org" <git@vger.kernel.org>,
	Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCHv7 4/6] worktree: have a function to check if worktrees are in use
Date: Fri, 9 Dec 2016 10:49:28 -0800	[thread overview]
Message-ID: <CAGZ79kaV4FYZEbRWQxKBHJg1jVzOkte1QxLZgu75=Jja_BMRGQ@mail.gmail.com> (raw)
In-Reply-To: <20161209120006.GA6609@ash>

On Fri, Dec 9, 2016 at 4:00 AM, Duy Nguyen <pclouds@gmail.com> wrote:

> int submodule_uses_worktrees(const char *path)
> {
>         struct strbuf path = STRBUF_INIT;
>         DIR *dir;
>         struct dirent *d;
>         int ret = 0;
>
>         strbuf_addf(&path, "%s/worktrees", path);
>         dir = opendir(path.buf);
>         strbuf_release(&path);
>
>         if (!dir)
>                 return 0;

The submodule may be one of the linked worktrees, which would be
caught if we use the code as I sent it out?

If this is one of the linked worktrees, we'd rather check if a file
"commondir" or "gitdir" exists?

I ask that because I would not know how to relocate such a linked
worktree gitdir?

  reply	other threads:[~2016-12-09 18:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-08 21:03 [PATCHv7 0/6] submodule absorbgitdirs Stefan Beller
2016-12-08 21:03 ` [PATCHv7 1/6] submodule: use absolute path for computing relative path connecting Stefan Beller
2016-12-08 21:03 ` [PATCHv7 2/6] submodule helper: support super prefix Stefan Beller
2016-12-08 21:03 ` [PATCHv7 3/6] test-lib-functions.sh: teach test_commit -C <dir> Stefan Beller
2016-12-08 21:03 ` [PATCHv7 4/6] worktree: have a function to check if worktrees are in use Stefan Beller
2016-12-09 12:00   ` Duy Nguyen
2016-12-09 18:49     ` Stefan Beller [this message]
2016-12-10 11:16       ` Duy Nguyen
2016-12-08 21:03 ` [PATCHv7 5/6] move connect_work_tree_and_git_dir to dir.h Stefan Beller
2016-12-08 21:03 ` [PATCHv7 6/6] submodule: add absorb-git-dir function Stefan Beller

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='CAGZ79kaV4FYZEbRWQxKBHJg1jVzOkte1QxLZgu75=Jja_BMRGQ@mail.gmail.com' \
    --to=sbeller@google.com \
    --cc=bmwill@google.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=pclouds@gmail.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.
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).