Skip to content

rev-parse options for absolute or relative paths

brian m. carlson git 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest2 patches 1 replyIn review
  2. v42 patches 6 repliesSuperseded
  3. v32 patches 5 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v22 patches10 repliesSuperseded

Changes in v5 from the cover letter

* Wrap an internal function.
* Use bitflags.
* Fix memory leaks.
* Explain that --path-format can be specified multiple times and its effects if that is done.
* Expand commit message.

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2abspath: add a function to resolve paths with missing componentsabspath.c cache.h+48 -181 reply
2/2rev-parse: add option for absolute or relative path formattingDocumentation/git-rev-parse.txt builtin/rev-parse.c t/t1500-rev-parse.sh+194 -430 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v5 yet.

Read the v5 thread

Cover letter [PATCH v5 0/2] rev-parse options for absolute or relative paths

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.

Changes from v4:

* Wrap an internal function.
* Use bitflags.
* Fix memory leaks.
* Explain that --path-format can be specified multiple times and its effects if that is done.
* Expand commit message.

Changes from v3:

* Switch to a binary option instead of a number of missing path components to skip.

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 |  74 +++++++++++++---------
 abspath.c                       |  64 +++++++++++++------
 builtin/rev-parse.c             | 106 ++++++++++++++++++++++++++++----
 cache.h                         |   2 +
 t/t1500-rev-parse.sh            |  57 ++++++++++++++++-
 5 files changed, 242 insertions(+), 61 deletions(-)