From: "brian m. carlson" <sandals@crustytoothpaste.net> To: <git@vger.kernel.org> Cc: "Johannes Schindelin" <Johannes.Schindelin@gmx.de>, "SZEDER Gábor" <szeder.dev@gmail.com> Subject: [PATCH v2 0/2] rev-parse options for absolute or relative paths Date: Fri, 9 Oct 2020 19:15:09 +0000 Message-ID: <20201009191511.267461-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. 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(-)
next reply index Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-10-09 19:15 brian m. carlson [this message] 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
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=20201009191511.267461-1-sandals@crustytoothpaste.net \ --to=sandals@crustytoothpaste.net \ --cc=Johannes.Schindelin@gmx.de \ --cc=git@vger.kernel.org \ --cc=szeder.dev@gmail.com \ /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
Git Mailing List Archive on lore.kernel.org Archives are clonable: git clone --mirror https://lore.kernel.org/git/0 git/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 git git/ https://lore.kernel.org/git \ git@vger.kernel.org public-inbox-index git Example config snippet for mirrors Newsgroup available over NNTP: nntp://nntp.lore.kernel.org/org.kernel.vger.git AGPL code for this site: git clone https://public-inbox.org/public-inbox.git