From: Junio C Hamano <gitster@pobox.com>
To: "Miguel Ángel Pastor Olivar via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org,
"Miguel Ángel Pastor Olivar" <miguelinlas3@gmail.com>,
"Miguel Ángel Pastor Olivar" <migue@github.com>
Subject: Re: [PATCH 2/2] cat-file: configurable "best effort mode" for symlink resolution
Date: Mon, 17 Jun 2024 12:33:54 -0700 [thread overview]
Message-ID: <xmqqr0cv5pp9.fsf@gitster.g> (raw)
In-Reply-To: <5de72c45e767c4d704503c8cd5c8e6dce4ea04d6.1718615028.git.gitgitgadget@gmail.com> ("Miguel Ángel Pastor Olivar via GitGitGadget"'s message of "Mon, 17 Jun 2024 09:03:48 +0000")
"Miguel Ángel Pastor Olivar via GitGitGadget"
<gitgitgadget@gmail.com> writes:
> From: =?UTF-8?q?Miguel=20=C3=81ngel=20Pastor=20Olivar?= <migue@github.com>
>
> This patch introduces a new "best effort mode" where the object found at
> resolution step N is returned. If we've reached the end of the chain, the
> returned object will be the file at the end of the chain, however, if, after
> n resolutions we haven't reached the end of the chain, the returned object
> will represent a symlink
>
> The goal is to extend the symlink resolution process and provide the ability
> to return the object found at the designated depth instead of returning an
> error.
>
> The current code already provides a limit to the maximum number of
> resolutions that can be performed and something similar to this is returned
> back to the caller:
>
> loop SP <size> LF <object> LF
>
> With the new config setting we are looking to return the actual information
> of the object where the resolution stopped. Something similar to:
>
> <oid> blob <size>\ndata\n
I do not think this should be a configuration variable at all.
Either a command line option, or even better yet would be an
in-stream instruction ("flip into the 'tell me the last symlink
you saw before you gave up' mode"), is understandable though, given
that this is strictly for the "batch" mode.
For that matter, it is dubious that the previous one that added a
configuration variable to lower the symlink recursion limit is a
good idea. It does not affect anything but "cat-file --batch" and
an in-stream instruction, e.g. "in this session, do not resolve more
than 3 levels", sounds like a much better fit to what this wants to
do. That way, it will be a lot better isolated from unrelated code
paths. It might even make sense not to introduce the new
max_symlink_depth global variable, but pass it through as a new
member in "struct object_context" given to get_oid_with_context(),
which in turn is passed as a new parameter to
get_tree_entry_follow_symlinks() function.
So, I am supportive to solving the problem this series attempts to
solve, but I am not on board with the design this series took.
Thanks.
next prev parent reply other threads:[~2024-06-17 19:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-17 9:03 [PATCH 0/2] Symlink resolutions: limits and return modes Miguel Ángel Pastor Olivar via GitGitGadget
2024-06-17 9:03 ` [PATCH 1/2] cat-file: configurable number of symlink resolutions Miguel Ángel Pastor Olivar via GitGitGadget
2024-06-17 19:33 ` Junio C Hamano
2024-06-17 9:03 ` [PATCH 2/2] cat-file: configurable "best effort mode" for symlink resolution Miguel Ángel Pastor Olivar via GitGitGadget
2024-06-17 19:33 ` Junio C Hamano [this message]
2024-06-17 19:33 ` [PATCH 0/2] Symlink resolutions: limits and return modes Junio C Hamano
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=xmqqr0cv5pp9.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=migue@github.com \
--cc=miguelinlas3@gmail.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).