git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH v2 0/2] rev-parse options for absolute or relative paths
@ 2020-10-09 19:15 brian m. carlson
  2020-10-09 19:15 ` [PATCH v2 1/2] abspath: add a function to resolve paths with missing components brian m. carlson
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: brian m. carlson @ 2020-10-09 19:15 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, SZEDER Gábor

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.

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                       |  50 +++++++++++++--
 builtin/rev-parse.c             | 105 ++++++++++++++++++++++++++++----
 cache.h                         |   1 +
 t/t1500-rev-parse.sh            |  57 ++++++++++++++++-
 5 files changed, 237 insertions(+), 47 deletions(-)


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2020-11-16  2:26 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-09 19:15 [PATCH v2 0/2] rev-parse options for absolute or relative paths brian m. carlson
2020-10-09 19:15 ` [PATCH v2 1/2] abspath: add a function to resolve paths with missing components brian m. carlson
2020-10-09 21:10   ` Junio C Hamano
2020-10-10  1:10     ` brian m. carlson
2020-11-09 13:57       ` Johannes Schindelin
2020-11-09 13:55   ` Johannes Schindelin
2020-11-16  2:21     ` brian m. carlson
2020-10-09 19:15 ` [PATCH v2 2/2] rev-parse: add option for absolute or relative path formatting brian m. carlson
2020-11-09 14:46   ` Johannes Schindelin
2020-11-16  2:15     ` brian m. carlson
2020-11-04 23:01 ` [PATCH v2 0/2] rev-parse options for absolute or relative paths Emily Shaffer
2020-11-05  3:20   ` brian m. carlson
2020-11-09 13:33 ` Johannes Schindelin

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).