Re: [SQUASHED PATCH] Add support for GIT_CEILING_DIRECTORIES
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- May 19, 2008, 10:49 UTC
- Message-ID
- <alpine.DEB.1.00.0805191138210.30431@racer>
- In-Reply-To
- <48313258.5010208@viscovery.net>
Hi,
On Mon, 19 May 2008, Johannes Sixt wrote:
Show 26 quoted lines
> Johannes Schindelin schrieb:
>
> > 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 do not share the notion that "goto" = BAD.
> [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.]
I am not in support of this feature at all, since I do not need it.
However, I saw that David needs it, but I did not agree with the way he implemented his patch. So I tried to show how it is possible to do it in a way that looks simpler to me.
Now the ball is back in David's field: he can just take my patch, mangle it until it does what he wants, and resubmit. That said, if the result offends my eye again, I will complain again.
Ciao, Dscho