git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Dec 13, 2020, 00:25 UTC
Message-ID
<20201213002529.542928-1-sandals@crustytoothpaste.net>

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(-)
Next: brian m. carlson
Message 1 of 4 in “rev-parse options for absolute or relative paths”
  1. 0/2 rev-parse options for absolute or relative pathsbrian m. carlson, Dec 13, 2020
  2. 2/2 rev-parse: add option for absolute or relative path formattingbrian m. carlson, Dec 13, 2020
  3. 1/2 abspath: add a function to resolve paths with missing componentsbrian m. carlson, Dec 13, 2020
  4. Eric SunshineDec 13, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.