All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: "brian m. carlson" <sandals@crustytoothpaste.net>
Cc: git@vger.kernel.org, Emily Shaffer <emilyshaffer@google.com>
Subject: Re: [PATCH v3 0/2] rev-parse options for absolute or relative paths
Date: Wed, 2 Dec 2020 14:12:01 +0100 (CET)	[thread overview]
Message-ID: <nycvar.QRO.7.76.6.2012021410560.25979@tvgsbejvaqbjf.bet> (raw)
In-Reply-To: <20201127231916.609852-1-sandals@crustytoothpaste.net>

Hi brian,

On Fri, 27 Nov 2020, brian m. carlson wrote:

> There are a bunch of different situations in which one would like to
> have an absolute and canonical or a relative path from Git.  In many of
> these cases, these values are already available from git rev-parse, but
> some values only come in one form or another.
>
> Many operating systems, such as macOS, lack a built-in realpath command
> that can canonicalize paths properly, and additionally some programming
> languages, like Go, currently do as well.  It's therefore helpful for us
> to provide a generic way to request that a path is fully canonicalized
> before using it.  Since users may wish for a relative path, we can
> provide one of those as well.
>
> The primary impetus for this was Git LFS, which needs paths to be
> canonicalized in the same way as Git in order to function correctly.
> See https://github.com/git-lfs/git-lfs/issues/4012 for more details.

Sounds good!

I offered a step back that would allow us to do without
`count_dir_separators()` (or `count_components()`) altogether.

Otherwise, this patch series still looks good to me.

Thanks,
Dscho

>
> Changes from v2:
>
> * Incorporate multiple missing segment support into the strbuf_realpath
>   code.
> * Switch some invocations to use DEFAULT_UNMODIFIED, which should not
>   result in a change in behavior.
> * Rebase, resolving some conflicts.
>
> Changes from v1:
>
> * Add a function to handle missing trailing components when
>   canonicalizing paths and use it.
> * Improve commit messages.
> * Fix broken && chain.
> * Fix situation where relative paths are not relative.
>
> brian m. carlson (2):
>   abspath: add a function to resolve paths with missing components
>   rev-parse: add option for absolute or relative path formatting
>
>  Documentation/git-rev-parse.txt |  71 +++++++++++++---------
>  abspath.c                       |  33 +++++++++-
>  builtin/rev-parse.c             | 104 ++++++++++++++++++++++++++++----
>  cache.h                         |   2 +
>  t/t1500-rev-parse.sh            |  57 ++++++++++++++++-
>  5 files changed, 223 insertions(+), 44 deletions(-)
>
>

      parent reply	other threads:[~2020-12-02 13:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-27 23:19 [PATCH v3 0/2] rev-parse options for absolute or relative paths brian m. carlson
2020-11-27 23:19 ` [PATCH v3 1/2] abspath: add a function to resolve paths with missing components brian m. carlson
2020-11-28 10:08   ` René Scharfe
2020-11-28 18:41     ` brian m. carlson
2020-12-02 13:09   ` Johannes Schindelin
2020-12-02 23:54     ` brian m. carlson
2020-11-27 23:19 ` [PATCH v3 2/2] rev-parse: add option for absolute or relative path formatting brian m. carlson
2020-12-02 13:12 ` Johannes Schindelin [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=nycvar.QRO.7.76.6.2012021410560.25979@tvgsbejvaqbjf.bet \
    --to=johannes.schindelin@gmx.de \
    --cc=emilyshaffer@google.com \
    --cc=git@vger.kernel.org \
    --cc=sandals@crustytoothpaste.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.