From: Junio C Hamano <gitster@pobox.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Daniel Barkalow <barkalow@iabervon.org>,
git@vger.kernel.org, Greg KH <greg@kroah.com>,
Andrew Klossner <andrew@cesa.opbu.xerox.com>
Subject: Re: [PATCH] Use nonrelative paths instead of absolute paths for cloned repositories
Date: Fri, 06 Jun 2008 11:07:19 -0700 [thread overview]
Message-ID: <7v7id2v3mw.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <alpine.DEB.1.00.0806061832330.1783@racer> (Johannes Schindelin's message of "Fri, 6 Jun 2008 18:34:13 +0100 (BST)")
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>> In the longer term, we would inevitably face "when should one use
>> nonrelative and when should one use absolute?" and we would eventually
>> have to answer it. It may turn out that many current users of
>> "absolute" are better off using "nonrelative", but I suspect we won't
>> get rid of "absolute" completely, because one of the reasons it avoids
>> symlinks at great lengths is so that it can check the containment
>> relationships between paths reliably (e.g. "is this path outside the
>> repository, in which case we should refuse to add it to the index, and
>> we use --no-index without being asked when running "diff"").
>>
>> But using "absolute" for containment comparison is one thing. Storing
>> the result of "absolute" is quite another.
>
> The easy way would be to add an option to make_absolute_path(), say
> "resolve_symlinks".
I am afraid that it does not solve anything.
Be they two separate functions, or a one function that has two different
semantics depending on an option, the API documentation needs to answer
the "when should I use one and when should I use the other" question.
And the hard part is figuring out which of the current "absolute" callers
need to be fixed in a way similar to how Daniel fixed git-clone, and which
of them stay the same. Perhaps all of the "chdir then getpwd" patterns
need to be looked at and some of them need to be restructured to honor $PWD
better. I dunno.
prev parent reply other threads:[~2008-06-06 18:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-06 3:15 [PATCH] Use nonrelative paths instead of absolute paths for cloned repositories Daniel Barkalow
2008-06-06 3:23 ` Johannes Schindelin
2008-06-06 3:47 ` Daniel Barkalow
2008-06-06 16:45 ` Junio C Hamano
2008-06-06 17:34 ` Johannes Schindelin
2008-06-06 18:07 ` Junio C Hamano [this message]
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=7v7id2v3mw.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=andrew@cesa.opbu.xerox.com \
--cc=barkalow@iabervon.org \
--cc=git@vger.kernel.org \
--cc=greg@kroah.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).