git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: <git@vger.kernel.org>
Cc: "Johannes Schindelin" <Johannes.Schindelin@gmx.de>,
	"René Scharfe" <l.s.r@web.de>
Subject: [PATCH v4 0/2] rev-parse options for absolute or relative paths
Date: Sun,  6 Dec 2020 22:53:47 +0000	[thread overview]
Message-ID: <20201206225349.3392790-1-sandals@crustytoothpaste.net> (raw)

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 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 |  71 +++++++++++++---------
 abspath.c                       |  13 +++-
 builtin/rev-parse.c             | 104 ++++++++++++++++++++++++++++----
 cache.h                         |   2 +
 t/t1500-rev-parse.sh            |  57 ++++++++++++++++-
 5 files changed, 203 insertions(+), 44 deletions(-)


             reply	other threads:[~2020-12-06 22:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-06 22:53 brian m. carlson [this message]
2020-12-06 22:53 ` [PATCH v4 1/2] abspath: add a function to resolve paths with missing components brian m. carlson
2020-12-07  0:02   ` Eric Sunshine
2020-12-07  2:11     ` brian m. carlson
2020-12-07 17:19   ` René Scharfe
2020-12-08  2:51     ` brian m. carlson
2020-12-06 22:53 ` [PATCH v4 2/2] rev-parse: add option for absolute or relative path formatting brian m. carlson
2020-12-07  0:30   ` Eric Sunshine
2020-12-07  2:38     ` brian m. carlson

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=20201206225349.3392790-1-sandals@crustytoothpaste.net \
    --to=sandals@crustytoothpaste.net \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=l.s.r@web.de \
    /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 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 NNTP newsgroup(s).