git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Additional variables for git var
@ 2023-06-22 19:50 brian m. carlson
  2023-06-22 19:50 ` [PATCH 1/3] var: add support for listing the shell brian m. carlson
                   ` (4 more replies)
  0 siblings, 5 replies; 42+ messages in thread
From: brian m. carlson @ 2023-06-22 19:50 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Elijah Newren, Calvin Wan

On many Unix systems, we have a good idea where Git's configuration
files and the shell it uses are located.  However, there are some
systems where that's not the case, such as Windows and with Homebrew,
where the expected files might be found in another location.

Right now, programs who would like to access things like the system
gitattributes or config file have to guess where the distributor of Git
placed these files, and with runtime relocation, it's not even
guaranteed that these will be in a fixed place from invocation to
invocation.  As a result, we need a way to query Git about the location
of these files.

This series introduces five new configuration variables that refer to
the shell path, the system and global gitattributes files, and the
system and global config files.  The global values are not technically
needed, since they should be computable from the environment alone, but
they are added to make life easier for users.

The shell path is especially useful on Windows, where Git usually
provides the POSIX shell, and is designed to make using programs that
interact with Git or Unix-like environment variables (e.g., `EDITOR` and
`VISUAL`) easier.

The gitattributes files are primarily for the benefit of Git LFS, but of
course the goal is to be generally useful.

The curious reviewer may ask, "Why are these in `git var` and not `git
rev-parse`?"  The answer is that these refer to configuration (albeit
partially at compile time), and thus are like the existing GIT_EDITOR,
and unlike what `git rev-parse` produces, which is almost completely
limited to paths and metadata related specifically to a given
repository.

This should be a relatively straightforward series, but of course any
feedback is welcome.

brian m. carlson (3):
  var: add support for listing the shell
  var: add attributes files locations
  var: add config file locations

 Documentation/git-var.txt | 23 +++++++++
 attr.c                    |  6 +--
 attr.h                    |  4 ++
 builtin/var.c             | 99 +++++++++++++++++++++++++++++++++++----
 t/t0007-git-var.sh        | 98 ++++++++++++++++++++++++++++++++++++++
 5 files changed, 219 insertions(+), 11 deletions(-)


^ permalink raw reply	[flat|nested] 42+ messages in thread

end of thread, other threads:[~2023-06-27 20:18 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-22 19:50 [PATCH 0/3] Additional variables for git var brian m. carlson
2023-06-22 19:50 ` [PATCH 1/3] var: add support for listing the shell brian m. carlson
2023-06-22 20:42   ` Eric Sunshine
2023-06-22 21:05     ` Junio C Hamano
2023-06-22 21:13       ` Eric Sunshine
2023-06-22 21:25       ` brian m. carlson
2023-06-22 21:41         ` Junio C Hamano
2023-06-22 21:20     ` brian m. carlson
2023-06-22 19:50 ` [PATCH 2/3] var: add attributes files locations brian m. carlson
2023-06-22 20:19   ` Derrick Stolee
2023-06-22 21:17     ` brian m. carlson
2023-06-22 21:37       ` Junio C Hamano
2023-06-22 21:17   ` Junio C Hamano
2023-06-22 21:18   ` Eric Sunshine
2023-06-22 21:30     ` brian m. carlson
2023-06-22 21:21   ` Eric Sunshine
2023-06-22 19:50 ` [PATCH 3/3] var: add config file locations brian m. carlson
2023-06-22 21:35   ` Eric Sunshine
2023-06-26 19:00 ` [PATCH v2 0/7] Additional variables for git var brian m. carlson
2023-06-26 19:00   ` [PATCH v2 1/7] t: add a function to check executable bit brian m. carlson
2023-06-26 19:00   ` [PATCH v2 2/7] var: add support for listing the shell brian m. carlson
2023-06-26 19:00   ` [PATCH v2 3/7] var: format variable structure with C99 initializers brian m. carlson
2023-06-26 19:00   ` [PATCH v2 4/7] var: adjust memory allocation for strings brian m. carlson
2023-06-26 19:56     ` Junio C Hamano
2023-06-26 19:00   ` [PATCH v2 5/7] attr: expose and rename accessor functions brian m. carlson
2023-06-26 19:58     ` Junio C Hamano
2023-06-26 19:00   ` [PATCH v2 6/7] var: add attributes files locations brian m. carlson
2023-06-27  7:05     ` Jeff King
2023-06-27 16:12       ` brian m. carlson
2023-06-27 17:56         ` Junio C Hamano
2023-06-27 20:16         ` Jeff King
2023-06-26 19:00   ` [PATCH v2 7/7] var: add config file locations brian m. carlson
2023-06-26 20:02     ` Junio C Hamano
2023-06-27 16:18 ` [PATCH v3 0/8] Additional variables for git var brian m. carlson
2023-06-27 16:18   ` [PATCH v3 1/8] var: mark unused parameters in git_var callbacks brian m. carlson
2023-06-27 16:18   ` [PATCH v3 2/8] t: add a function to check executable bit brian m. carlson
2023-06-27 16:18   ` [PATCH v3 3/8] var: add support for listing the shell brian m. carlson
2023-06-27 16:18   ` [PATCH v3 4/8] var: format variable structure with C99 initializers brian m. carlson
2023-06-27 16:18   ` [PATCH v3 5/8] var: adjust memory allocation for strings brian m. carlson
2023-06-27 16:19   ` [PATCH v3 6/8] attr: expose and rename accessor functions brian m. carlson
2023-06-27 16:19   ` [PATCH v3 7/8] var: add attributes files locations brian m. carlson
2023-06-27 16:19   ` [PATCH v3 8/8] var: add config file locations brian m. carlson

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).