On 8. 1. 25 13:52, Daniel Sahlberg wrote:
Den tis 31 dec. 2024 kl 10:36 skrev Stefan Sperling <s...@stsp.name>:

    This change seems to be unnecessary to me. The stated motivation
    for it,
    i.e. translating URLs to local paths in order to decide which
    local files
    were modified, ignores risks which occur beyond the escaping of
    characters.


    If a mapping from repo URL to a local path is needed for scripting
    purposes
    without any further processing, then the file or directory can be
    checked
    out before diff --summarize is run. When provided a working copy
    path then
    diff --summarize displays on-disk paths in local style, spaces and
    all.
    So why not just use a working copy if local paths are required?

    When provided a URL, then diff --summarize displays a URL.
    There should already be tools which decode URI-encoded data for use in
    a script if that is needed. However, there are problems beyond
    characters
    which require ecaping in a URL. Scripts should take precautions when
    translating URLs to a local path in an automated way. The
    repository root
    needs to be infered somehow, e.g. the repository-relative path for
    the URL
    https://svn.apache.org/repos/asf/subversion/trunk/libsvn_client
    is subversion/trunk/libsvn_client, and scripts would need to know
    this.

    Worse, paths need to be normalized before use because a malicious
    server
    or proxy could return a URL containing paths components such as .. and
    then overwrite files outside the intended working area.

    The SVN client covers such problems during checkout. Checking out
    a working
    copy before operating on local paths is much safer than working
    from URLs.


Thanks Stefan for your thoughts on this, your comments uncovered even more problems with this change.

I believe the reason was to "display names in human readable format", rather than to actually do local processing. Since this is only an issue when there is no WC, I was assuming they used it to check for example other branches than the current branch.

We already have svn info URL --show-item, the only thing missing in order to display user-friendly names (only) is --show-item=path.

-- Brane

Reply via email to