From: "Nguyen Thai Ngoc Duy" <pclouds@gmail.com>
To: "Junio C Hamano" <gitster@pobox.com>
Cc: git@vger.kernel.org, "Johannes Schindelin" <Johannes.Schindelin@gmx.de>
Subject: Re: [PATCH] Move worktree setup out of setup_git_directory*
Date: Mon, 25 Feb 2008 20:17:36 +0700 [thread overview]
Message-ID: <fcaeb9bf0802250517x2192b51epf2a162b0a984e99c@mail.gmail.com> (raw)
In-Reply-To: <7vr6f1sur3.fsf@gitster.siamese.dyndns.org>
On Mon, Feb 25, 2008 at 8:13 AM, Junio C Hamano <gitster@pobox.com> wrote:
> - At startup:
>
> - If the command always need to run from a repository, call
> setup_git_directory(), which would complain and die if you
> are outside.
>
> - If the command can optionally run in a repository, use
> setup_git_directory_gently(&nongit_ok); it won't complain
> but sets nongit_ok to true if run outside a repository.
>
> In either case, they return prefix string to be used for
> setup_work_tree() later.
>
> In either case, there is no chdir() done at this point.
Interesting. It currently does chdir(). But it is pointless now as
worktree should not be accessed until setup_work_tree() is called.
setup_git_directory* should not return a prefix at all.
> - After calling setup_git_directory(), or you made sure you are
> in a repository after callilng setup_git_directory_gently(),
> call setup_work_tree(). This will chdir to the top of the
> work tree.
>
> - When you need to know where $GIT_DIR is, call get_git_dir().
> When you need to know where the work tree is, call
> get_git_work_tree(). However, it is an error to call these
> functions before calling setup_git_directory and
> setup_work_tree.
I guess I just need to verify your statements and put them to
Doc/technical/api-setup.txt ;)
--
Duy
next prev parent reply other threads:[~2008-02-25 13:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-24 4:46 [PATCH] Move worktree setup out of setup_git_directory* Nguyễn Thái Ngọc Duy
2008-02-25 1:13 ` Junio C Hamano
2008-02-25 13:17 ` Nguyen Thai Ngoc Duy [this message]
2008-02-25 19:01 ` Junio C Hamano
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=fcaeb9bf0802250517x2192b51epf2a162b0a984e99c@mail.gmail.com \
--to=pclouds@gmail.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.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).