Thread (10 messages) 10 messages, 3 authors, 2020-11-16
STALE2060d
Revisions (4)
  1. v2 current
  2. v3 [diff vs current]
  3. v4 [diff vs current]
  4. v5 [diff vs current]

[PATCH v2 0/2] rev-parse options for absolute or relative paths

From: brian m. carlson <hidden>
Date: 2020-10-09 19:15:34

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(-)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help