From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Johannes Sixt <J.Sixt@eudaptics.com>
Cc: Matthias Lederhofer <matled@gmx.net>,
Linus Torvalds <torvalds@linux-foundation.org>,
git@vger.kernel.org
Subject: Re: [PATCH] git-init: set core.worktree if GIT_WORK_TREE is specified
Date: Wed, 4 Jul 2007 12:57:32 +0100 (BST) [thread overview]
Message-ID: <Pine.LNX.4.64.0707041255510.4071@racer.site> (raw)
In-Reply-To: <468B793D.53661D60@eudaptics.com>
Hi,
On Wed, 4 Jul 2007, Johannes Sixt wrote:
> Matthias Lederhofer wrote:
> >
> > > + if (!getcwd(cwd, sizeof(cwd)) || cwd[0] != '/')
> > > + die("Unable to read current working directory");
> >
> > Dscho just pointed out that this causes problems on windows. The same
> > is also in setup_git_directory_gently and was there before I touched
> > it, introduced by Linus in d288a700. What was the original reason to
> > do this? Are there implementations of getcwd which return a relative
> > path?
> >
> > Additionally there are other places which need to check if some user
> > supplied path is absolute. Should we have a macro/function for that
> > which depends on the os and checks for path[0] = '/' on unix and
> > perhaps path[1] = ':' on windows?
>
> I've modified some places (that check for an absolute path) in the MinGW
> port to read (path[0] == '/' || path[1] == ':'). I don't think that it's
> necessary that you cater for this case in your code - I'll take care of
> it in the MinGW port. Of course, a hint that there is another place to
> watch out for, or even better a test case in t/, is most appreciated.
>
> I still hope to find some time to rework the MinGW port. Then such
> details will be hidden behind a is_path_absolute() function. Or maybe
> getcwd_or_die() ;)
Yes, but why not start early? is_path_absolute() makes perfect sense.
However, I was asking (out of lack of knowledge): is there any way
getcwd() does not return an absolute path?
Ciao,
Dscho
next prev parent reply other threads:[~2007-07-04 11:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-03 22:49 [PATCH] git-init: set core.worktree if GIT_WORK_TREE is specified Matthias Lederhofer
2007-07-04 9:29 ` Matthias Lederhofer
2007-07-04 10:41 ` Johannes Sixt
2007-07-04 11:57 ` Johannes Schindelin [this message]
2007-07-04 16:23 ` Linus Torvalds
2007-07-04 17:07 ` Junio C Hamano
2007-07-04 17:31 ` Linus Torvalds
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=Pine.LNX.4.64.0707041255510.4071@racer.site \
--to=johannes.schindelin@gmx.de \
--cc=J.Sixt@eudaptics.com \
--cc=git@vger.kernel.org \
--cc=matled@gmx.net \
--cc=torvalds@linux-foundation.org \
/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).