From: Johannes Sixt <j.sixt@viscovery.net>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: David Reiss <dreiss@facebook.com>,
gitster@pobox.com, git@vger.kernel.org
Subject: Re: [SQUASHED PATCH] Add support for GIT_CEILING_DIRECTORIES
Date: Mon, 19 May 2008 09:55:04 +0200 [thread overview]
Message-ID: <48313258.5010208@viscovery.net> (raw)
In-Reply-To: <alpine.DEB.1.00.0805170117000.30431@racer>
Johannes Schindelin schrieb:
> Hi,
>
> On Fri, 16 May 2008, David Reiss wrote:
>
>> Sorry I missed this before. As you said, in Johannes's version the
>> ceiling directories are the last directories we look in, whereas in my
>> implementation, they are the first directories we do not look in. I
>> made this choice because it makes more sense for me to set my ceiling to
>> "/home", rather than "/home/dreiss", so it will work even if I am in
>> another user's homedir.
>>
>> There is also a difference in how they handle the case where the cwd is
>> a ceiling directory, but I think it is worth sorting out the first issue
>> first.
>
> Please do not top-post.
>
> This is the interdiff to the last squashed patch:
>
> -- snip --
> diff --git a/setup.c b/setup.c
> index cece3e4..2f7a17a 100644
> --- a/setup.c
> +++ b/setup.c
> @@ -441,6 +441,8 @@ const char *setup_git_directory_gently(int *nongit_ok)
> */
> offset = len = strlen(cwd);
> for (;;) {
> + if (offset <= min_offset)
> + goto non_git;
> gitfile_dir = read_gitfile_gently(DEFAULT_GIT_DIR_ENVIRONMENT);
> if (gitfile_dir) {
> if (set_git_dir(gitfile_dir))
> @@ -460,6 +462,7 @@ const char *setup_git_directory_gently(int *nongit_ok)
> chdir("..");
> do {
> if (offset <= min_offset) {
> +non_git:
> if (nongit_ok) {
> if (chdir(cwd))
> die("Cannot come back to cwd");
Hmm... If the implementation needs a 'goto', then I have the strong
suspicion that there's already something wrong at the concept level.
I actually like the previous version better because of its clearer semantics:
- The current directory is always checked.
- GIT_CEILING_DIRECTORIES are checked. Consequently, setting the variable
to the empty string is equivalent to not setting it at all.
(but it means that David can't have what he wants, i.e. he must set
GIT_CEILING_DIRECTORIES=/home/dreiss.)
This implementation:
- Never checks the root directory, even if it is the current directory.
- Otherwise always checks the current directory, even if it is mentioned
in GIT_CEILING_DIRECTORIES.
[That said, I'm not in strong support of this feature in general - I'm
just caring because *if* it goes in, it will have conflicts with the mingw
branch.]
-- Hannes
next prev parent reply other threads:[~2008-05-19 7:56 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-15 18:49 [PATCH v3] Add support for GIT_CEILING_DIRS David Reiss
2008-05-15 19:03 ` Johannes Schindelin
2008-05-15 19:40 ` David Reiss
2008-05-15 20:27 ` [PATCH] Add support for GIT_CEILING_DIRECTORIES Johannes Schindelin
2008-05-15 21:09 ` David Reiss
2008-05-15 22:29 ` Johannes Schindelin
2008-05-15 22:45 ` David Reiss
2008-05-15 23:27 ` [SQUASHED PATCH] " Johannes Schindelin
2008-05-16 6:54 ` Johannes Sixt
2008-05-16 10:20 ` Johannes Schindelin
2008-05-16 10:50 ` Johannes Sixt
2008-05-16 17:43 ` David Reiss
2008-05-17 0:19 ` Johannes Schindelin
2008-05-17 0:20 ` [2nd SQUASHED " Johannes Schindelin
2008-05-19 7:55 ` Johannes Sixt [this message]
2008-05-19 10:49 ` [SQUASHED " Johannes Schindelin
2008-05-15 19:46 ` [PATCH v3] Add support for GIT_CEILING_DIRS Junio C Hamano
2008-05-15 20:34 ` Johannes Schindelin
2008-05-16 7:03 ` Johannes Sixt
2008-05-16 10:21 ` Johannes Schindelin
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=48313258.5010208@viscovery.net \
--to=j.sixt@viscovery.net \
--cc=Johannes.Schindelin@gmx.de \
--cc=dreiss@facebook.com \
--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).