diff options
author | brian m. carlson <sandals@crustytoothpaste.net> | 2020-12-13 00:25:29 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-12-12 23:35:51 -0800 |
commit | fac60b89252e5865da077bb6ccaa9bef43efbfeb (patch) | |
tree | d6e56599862333b790b5a2b75c10620f9aeac5dd /t/t5515/refs.br-remote-explicit-octopus_remote-explicit | |
parent | abspath: add a function to resolve paths with missing components (diff) | |
download | tgif-fac60b89252e5865da077bb6ccaa9bef43efbfeb.tar.xz |
rev-parse: add option for absolute or relative path formatting
git rev-parse has several options which print various paths. Some of
these paths are printed relative to the current working directory, and
some are absolute.
Normally, this is not a problem, but there are times when one wants
paths entirely in one format or another. This can be done trivially if
the paths are canonical, but canonicalizing paths is not possible on
some shell scripting environments which lack realpath(1) and also in Go,
which lacks functions that properly canonicalize paths on Windows.
To help out the scripter, let's provide an option which turns most of
the paths printed by git rev-parse to be either relative to the current
working directory or absolute and canonical. Document which options are
affected and which are not so that users are not confused.
This approach is cleaner and tidier than providing duplicates of
existing options which are either relative or absolute.
Note that if the user needs both forms, it is possible to pass an
additional option in the middle of the command line which changes the
behavior of subsequent operations.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5515/refs.br-remote-explicit-octopus_remote-explicit')
0 files changed, 0 insertions, 0 deletions