From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: "René Scharfe" <l.s.r@web.de>
Cc: git@vger.kernel.org, Johannes Schindelin <Johannes.Schindelin@gmx.de>
Subject: Re: [PATCH v4 1/2] abspath: add a function to resolve paths with missing components
Date: Tue, 8 Dec 2020 02:51:33 +0000 [thread overview]
Message-ID: <X87qNTiQDlnzm6e2@camp.crustytoothpaste.net> (raw)
In-Reply-To: <c1d1fe44-6a7d-3578-cd89-9aea59c4637a@web.de>
[-- Attachment #1: Type: text/plain, Size: 1152 bytes --]
On 2020-12-07 at 17:19:32, René Scharfe wrote:
> I find the concept of a "real" path with imaginary components strangely
> amusing. But perhaps a name like strbuf_resolve_path() would fit better?
I think I'm going to take the strbuf_realpath_forgiving solution from
Eric Sunshine because I think having similar names for similar functions
helps discoverability.
> So the original code errors out if there is a real error
> (errno != ENOENT). It also errors out if any component except the last
> one is missing (errno == ENOENT && remaining.len); that's what the
> comment is about. This patch adds the ability to ignore ENOENT for all
> components.
>
> Perhaps convert many_missing and die_on_error into a single flags
> parameter and implement the flags DIE_ON_ERR and REQUIRE_BASENAME or
> similar? Callers would be easier to read because such an interface is
> self-documenting -- provided we find good flag names.
As discussed elsewhere in the thread, this will be moving to an internal
function, but I can make that function take two flag parameters.
--
brian m. carlson (he/him or they/them)
Houston, Texas, US
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 263 bytes --]
next prev parent reply other threads:[~2020-12-08 2:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-06 22:53 [PATCH v4 0/2] rev-parse options for absolute or relative paths brian m. carlson
2020-12-06 22:53 ` [PATCH v4 1/2] abspath: add a function to resolve paths with missing components brian m. carlson
2020-12-07 0:02 ` Eric Sunshine
2020-12-07 2:11 ` brian m. carlson
2020-12-07 17:19 ` René Scharfe
2020-12-08 2:51 ` brian m. carlson [this message]
2020-12-06 22:53 ` [PATCH v4 2/2] rev-parse: add option for absolute or relative path formatting brian m. carlson
2020-12-07 0:30 ` Eric Sunshine
2020-12-07 2:38 ` brian m. carlson
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=X87qNTiQDlnzm6e2@camp.crustytoothpaste.net \
--to=sandals@crustytoothpaste.net \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=l.s.r@web.de \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).