From: K Jayatheerth <jayatheerthkulkarni2005@gmail.com>
To: jayatheerthkulkarni2005@gmail.com
Cc: a3205153416@gmail.com, git@vger.kernel.org, gitster@pobox.com,
jltobler@gmail.com, kristofferhaugsbakk@fastmail.com,
kumarayushjha123@gmail.com, lucasseikioshiro@gmail.com,
phillip.wood@dunelm.org.uk, sandals@crustytoothpaste.net
Subject: [GSoC Patch v3 0/4] teach git repo info to handle path keys
Date: Fri, 12 Jun 2026 23:58:43 +0530 [thread overview]
Message-ID: <20260612182847.562816-1-jayatheerthkulkarni2005@gmail.com> (raw)
In-Reply-To: <20260601151950.30686-1-jayatheerthkulkarni2005@gmail.com>
Hi!
This series teaches `git repo info` to handle `path.*`
keys, allowing scripts to reliably discover core
repository paths without resorting to `git rev-parse`.
The patches are structured as follows:
1. path: Extract the localized path-formatting logic
out of `rev-parse` and expose it globally via
`path.h` using clear append semantics.
2. rev-parse: Refactor the command to leverage the
newly shared path engine.
3. repo: Introduce `path.commondir.absolute` and
`path.commondir.relative` alongside a robust,
isolated test helper.
4. repo: Introduce `path.gitdir.absolute` and
`path.gitdir.relative` using the same standardized
formatting rules.
Since all the questions were answered
I have removed them from this cover letter.
Changes since v2:
* Renamed the shared helper from `format_path()` to
`append_formatted_path()`, and renamed the `buf`
parameter to `dest` to better reflect its
append-style behavior (Lucas, Phillip).
* Introduced a dedicated `PATH_FORMAT_DEFAULT`
enumerator. This removes the awkward `-1`
sentinel in `print_path()` while preserving enum
type safety (Phillip, Justin).
* Handled `PATH_FORMAT_DEFAULT` as
`PATH_FORMAT_UNMODIFIED` inside
`append_formatted_path()`, while intercepting it
in `print_path()` for rev-parse-specific fallback
behavior (Justin).
* Replaced the `else if` chain in `append_formatted_path()` with a
clean `switch` statement setup (Justin, Lucas).
* Reordered the `commondir` and `gitdir` patches so
the parameterized test helper
(`test_repo_info_path`) is introduced first,
establishing the isolated test infrastructure up
front (Justin).
* Reworked the test helper to accept a label,
`repo_name`, and `path_suffix`; moved repository
creation into the helper for isolation; and
replaced `eval` by capturing `$PWD` before
changing directories (Justin, Lucas).
* Corrected trailer ordering so `Signed-off-by`
appears after `Mentored-by` (Kristoffer).
* Cleaned up minor trailing whitespace issues across
the patch array declarations.
Tagging Justin Tobler, Lucas Seiki Oshiro, Junio,
Phillip Wood, brian m. carlson, and Ayush Jha.
Thanks for taking another look!
K Jayatheerth (4):
path: introduce append_formatted_path() for shared path formatting
rev-parse: use append_formatted_path() for path formatting
repo: add path.commondir with absolute and relative suffix formatting
repo: add path.gitdir with absolute and relative suffix formatting
Documentation/git-repo.adoc | 15 ++++++
builtin/repo.c | 50 +++++++++++++++++
builtin/rev-parse.c | 103 ++++++++----------------------------
path.c | 70 ++++++++++++++++++++++++
path.h | 36 +++++++++++++
t/t1900-repo-info.sh | 68 ++++++++++++++++++++++++
6 files changed, 262 insertions(+), 80 deletions(-)
Range-diff against v2:
1: c1f1e87fe9 ! 1: a396b4f8e6 path: introduce format_path() for centralized path formatting
@@ Metadata
Author: K Jayatheerth <jayatheerthkulkarni2005@gmail.com>
## Commit message ##
- path: introduce format_path() for centralized path formatting
+ path: introduce append_formatted_path() for shared path formatting
- The path-formatting logic inside `builtin/rev-parse.c` handles absolute,
- canonical, and relative formatting rules based on user-supplied options.
- However, this logic is tightly coupled to `rev-parse` and writes directly
- to stdout.
+ The path-formatting logic in builtin/rev-parse.c is tightly coupled
+ to that command and writes directly to stdout, making it impossible
+ for other builtins to reuse.
- To allow other builtins (such as the upcoming `git repo` path keys) to
- re-use this logic, extract the core path-formatting algorithm into a centralized
- helper function, `format_path()`, in `path.c`.
-
- Expose a single, streamlined `path_format` enum in `path.h` to let callers
- explicitly declare their formatting strategy (UNMODIFIED, RELATIVE,
- RELATIVE_IF_SHARED, or CANONICAL). This decouples the core algorithm from
- the localized fallback mechanics specific to `rev-parse`.
+ Extract the core algorithm into append_formatted_path() in path.c
+ and expose a path_format enum in path.h so that any builtin can
+ format paths consistently without duplicating logic.
Mentored-by: Justin Tobler <jltobler@gmail.com>
Mentored-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>
@@ path.c: char *xdg_cache_home(const char *filename)
return NULL;
}
-+void format_path(struct strbuf *buf, const char *path,
-+ const char *prefix, enum path_format format)
++void append_formatted_path(struct strbuf *dest, const char *path,
++ const char *prefix, enum path_format format)
+{
-+ if (format == PATH_FORMAT_UNMODIFIED) {
-+ strbuf_addstr(buf, path);
-+ return;
-+ }
++ switch (format) {
++ case PATH_FORMAT_DEFAULT:
++ case PATH_FORMAT_UNMODIFIED:
++ strbuf_addstr(dest, path);
++ break;
+
-+ if (format == PATH_FORMAT_RELATIVE) {
++ case PATH_FORMAT_RELATIVE: {
+ struct strbuf relative_buf = STRBUF_INIT;
+ struct strbuf real_path = STRBUF_INIT;
+ struct strbuf real_prefix = STRBUF_INIT;
@@ path.c: char *xdg_cache_home(const char *filename)
+ prefix = real_prefix.buf;
+ }
+
-+ strbuf_addstr(buf, relative_path(path, prefix, &relative_buf));
++ strbuf_addstr(dest, relative_path(path, prefix, &relative_buf));
+
+ strbuf_release(&relative_buf);
+ strbuf_release(&real_path);
+ strbuf_release(&real_prefix);
+ free(cwd);
-+ } else if (format == PATH_FORMAT_RELATIVE_IF_SHARED) {
++ break;
++ }
++
++ case PATH_FORMAT_RELATIVE_IF_SHARED: {
+ struct strbuf relative_buf = STRBUF_INIT;
+
+ /*
@@ path.c: char *xdg_cache_home(const char *filename)
+ * default the prefix to the current working directory. Doing so
+ * would cause a relative path to always be produced if possible.
+ */
-+ strbuf_addstr(buf, relative_path(path, prefix, &relative_buf));
++ strbuf_addstr(dest, relative_path(path, prefix, &relative_buf));
+ strbuf_release(&relative_buf);
-+ } else if (format == PATH_FORMAT_CANONICAL) {
++ break;
++ }
++
++ case PATH_FORMAT_CANONICAL: {
+ struct strbuf canonical_buf = STRBUF_INIT;
+
+ strbuf_realpath_forgiving(&canonical_buf, path, 1);
-+ strbuf_addbuf(buf, &canonical_buf);
++ strbuf_addbuf(dest, &canonical_buf);
+
+ strbuf_release(&canonical_buf);
++ break;
++ }
++
++ default:
++ BUG("unknown path_format value %d", format);
+ }
+}
+
@@ path.h: enum scld_error safe_create_leading_directories_no_share(char *path);
+ * The formatting strategy to apply when writing a path into a buffer.
+ */
+enum path_format {
++ /*
++ * Represents the default formatting behavior. Treated as
++ * PATH_FORMAT_UNMODIFIED by append_formatted_path().
++ */
++ PATH_FORMAT_DEFAULT,
++
+ /* Output the path exactly as-is without any modifications. */
+ PATH_FORMAT_UNMODIFIED,
+
@@ path.h: enum scld_error safe_create_leading_directories_no_share(char *path);
+ * Format a path according to the specified formatting strategy and append
+ * the result to the given strbuf.
+ *
-+ * `buf` : The string buffer to append the formatted path to.
++ * `dest` : The string buffer to append the formatted path to.
+ * `path` : The path string that needs to be formatted.
+ * `prefix` : The directory prefix to calculate relative offsets against.
+ * Pass NULL to default to the current working directory where applicable.
+ * `format` : The formatting behavior rule to execute.
+ */
-+void format_path(struct strbuf *buf, const char *path,
-+ const char *prefix, enum path_format format);
++void append_formatted_path(struct strbuf *dest, const char *path,
++ const char *prefix, enum path_format format);
+
# ifdef USE_THE_REPOSITORY_VARIABLE
# include "strbuf.h"
2: 2cc3e671af ! 2: 16198f96d1 rev-parse: use format_path for path formatting
@@ Metadata
Author: K Jayatheerth <jayatheerthkulkarni2005@gmail.com>
## Commit message ##
- rev-parse: use format_path for path formatting
+ rev-parse: use append_formatted_path() for path formatting
- Now that the core path-formatting logic has been abstracted into
- format_path() inside path.c, remove the localized duplicate formatting
- mechanics from builtin/rev-parse.c.
+ Now that path formatting logic lives in a shared helper, keeping a
+ duplicate implementation in rev-parse is unnecessary and risks the
+ two diverging over time.
- Drop the usage of the old local format_type and default_type enums,
- and update print_path() to act as a light wrapper around the new shared
- engine. Resolve user-provided formatting flags directly within rev-parse
- to pass the final determined path_format to format_path().
+ Replace the local format_type and default_type enums and the
+ hand-rolled formatting logic with a call to append_formatted_path().
+ Introduce PATH_FORMAT_DEFAULT as the initial value of arg_path_format
+ so that per-path fallback behavior is resolved in print_path() rather
+ than leaked into the shared helper.
Mentored-by: Justin Tobler <jltobler@gmail.com>
Mentored-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>
@@ builtin/rev-parse.c: static void handle_ref_opt(const char *pattern, const char
-
-static void print_path(const char *path, const char *prefix, enum format_type format, enum default_type def)
+static void print_path(const char *path, const char *prefix,
-+ int arg_path_format, enum path_format def_format)
++ enum path_format arg_path_format, enum path_format def_format)
{
- char *cwd = NULL;
- /*
@@ builtin/rev-parse.c: static void handle_ref_opt(const char *pattern, const char
- }
- free(cwd);
+ struct strbuf sb = STRBUF_INIT;
-+ enum path_format fmt = (arg_path_format != -1) ? arg_path_format : def_format;
++ enum path_format fmt = (arg_path_format != PATH_FORMAT_DEFAULT) ? arg_path_format : def_format;
+
-+ format_path(&sb, path, prefix, fmt);
++ append_formatted_path(&sb, path, prefix, fmt);
+ puts(sb.buf);
+
+ strbuf_release(&sb);
@@ builtin/rev-parse.c: int cmd_rev_parse(int argc,
struct strbuf buf = STRBUF_INIT;
int seen_end_of_options = 0;
- enum format_type format = FORMAT_DEFAULT;
-+ int arg_path_format = -1;
++ enum path_format arg_path_format = PATH_FORMAT_DEFAULT;
show_usage_if_asked(argc, argv, builtin_rev_parse_usage);
@@ builtin/rev-parse.c: int cmd_rev_parse(int argc,
char *cwd;
int len;
- enum format_type wanted = format;
-+ int wanted = arg_path_format;
++ enum path_format wanted = arg_path_format;
if (arg[2] == 'g') { /* --git-dir */
if (gitdir) {
- print_path(gitdir, prefix, format, DEFAULT_UNMODIFIED);
4: 61b5d69306 ! 3: 7de41faa04 repo: add path.commondir with absolute and relative suffix formatting
@@ Metadata
## Commit message ##
repo: add path.commondir with absolute and relative suffix formatting
- In standard Git repositories, the Git directory and the common directory
- are identical. However, in environments utilizing multiple worktrees, the
- local working state ($GIT_DIR) is separated from the shared central data
- ($GIT_COMMON_DIR). Scripts require a reliable way to discover this shared
- path.
+ Scripts working with worktree setups need a reliable way to discover
+ the common directory, which diverges from the git directory when
+ multiple worktrees are in use. There is no way to retrieve this path
+ from git repo info today.
- Introduce `path.commondir.absolute` and `path.commondir.relative` keys
- to `git repo info`. Similar to the `path.gitdir` keys, exposing explicit
- format variants removes the ambiguity of default fallbacks. Both keys are
- evaluated via the `format_path()` engine.
+ Introduce path.commondir.absolute and path.commondir.relative keys.
+ Exposing explicit format variants rather than a single key with a
+ default avoids ambiguity for scripts that require predictable output.
- Insert the new keys into the `repo_info_field` array in lexicographical
- order to maintain the integrity of binary search lookups.
-
- Utilize the parameterized `test_repo_info_path` helper to validate the
- worktree edge cases. This ensures that path resolution correctly respects
- $GIT_COMMON_DIR when defined and safely falls back to $GIT_DIR otherwise.
+ Add a test helper test_repo_info_path that creates isolated
+ repositories per test case to prevent state leaks, captures the repo
+ root before changing directories to avoid eval, and accepts an optional
+ init_command to cover environment variable overrides such as
+ GIT_COMMON_DIR and GIT_DIR.
Mentored-by: Justin Tobler <jltobler@gmail.com>
Mentored-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>
@@ Documentation/git-repo.adoc: values that they return:
+ The path to the Git repository's common directory relative to
+ the current working directory.
+
- `path.gitdir.absolute`::
- The canonical absolute path to the Git repository directory (the `.git` directory).
-
+ `references.format`::
+ The reference storage format. The valid values are:
+ +
## builtin/repo.c ##
+@@
+ #include "hex.h"
+ #include "odb.h"
+ #include "parse-options.h"
++#include "path.h"
+ #include "path-walk.h"
+ #include "progress.h"
+ #include "quote.h"
+ #include "ref-filter.h"
+ #include "refs.h"
+ #include "revision.h"
++#include "setup.h"
+ #include "strbuf.h"
+ #include "string-list.h"
+ #include "shallow.h"
@@ builtin/repo.c: static int get_object_format(struct repository *repo, struct strbuf *buf)
return 0;
}
@@ builtin/repo.c: static int get_object_format(struct repository *repo, struct str
+ if (!common_dir)
+ return error(_("unable to get common directory"));
+
-+ format_path(buf, common_dir, startup_info->prefix, PATH_FORMAT_CANONICAL);
++ append_formatted_path(buf, common_dir, startup_info->prefix, PATH_FORMAT_CANONICAL);
+ return 0;
+}
+
@@ builtin/repo.c: static int get_object_format(struct repository *repo, struct str
+ if (!common_dir)
+ return error(_("unable to get common directory"));
+
-+ format_path(buf, common_dir, startup_info->prefix, PATH_FORMAT_RELATIVE);
++ append_formatted_path(buf, common_dir, startup_info->prefix, PATH_FORMAT_RELATIVE);
+ return 0;
+}
+
- static int get_path_gitdir_absolute(struct repository *repo, struct strbuf *buf)
+ static int get_references_format(struct repository *repo, struct strbuf *buf)
{
- const char *git_dir = repo_get_git_dir(repo);
+ strbuf_addstr(buf,
@@ builtin/repo.c: static const struct repo_info_field repo_info_field[] = {
{ "layout.bare", get_layout_bare },
{ "layout.shallow", get_layout_shallow },
{ "object.format", get_object_format },
+ { "path.commondir.absolute", get_path_commondir_absolute },
+ { "path.commondir.relative", get_path_commondir_relative },
- { "path.gitdir.absolute", get_path_gitdir_absolute },
- { "path.gitdir.relative", get_path_gitdir_relative },
{ "references.format", get_references_format },
+ };
+
## t/t1900-repo-info.sh ##
-@@ t/t1900-repo-info.sh: test_expect_success 'setup test repository layout for path fields' '
- mkdir -p test-repo/sub
+@@ t/t1900-repo-info.sh: test_expect_success 'git repo info -h shows only repo info usage' '
+ test_grep ! "git repo structure" actual
'
-+test_expect_success 'setup custom-common for commondir tests' '
-+ git init --bare test-repo/custom-common
-+'
-+
-+test_repo_info_path 'commondir' 'echo "$(cd .. && pwd)/.git"' '../.git'
-+test_repo_info_path 'commondir' 'echo "$(cd .. && pwd)/custom-common"' '../custom-common' 'GIT_COMMON_DIR="$(cd .. && pwd)/custom-common" GIT_DIR=../.git'
-+test_repo_info_path 'commondir' 'echo "$(cd .. && pwd)/.git"' '../.git' 'GIT_DIR=../.git'
- test_repo_info_path 'gitdir' 'echo "$(cd .. && pwd)/.git"' '../.git'
-
++# Helper function to test path keys in both absolute and relative formats.
++# $1: label for the test
++# $2: field_name (e.g., commondir)
++# $3: unique repo name for isolation
++# $4: expect_absolute (suffix appended to repo root)
++# $5: expect_relative (the relative path string expected)
++# $6: init_command (extra setup like exporting env vars)
++test_repo_info_path () {
++ label=$1
++ field_name=$2
++ repo_name=$3
++ expect_absolute_suffix=$4
++ expect_relative=$5
++ init_command=$6
++
++ absolute_root="$repo_name-absolute"
++ relative_root="$repo_name-relative"
++
++ test_expect_success "setup: $label" '
++ git init "$absolute_root" &&
++ git init "$relative_root" &&
++ mkdir -p "$absolute_root/sub" "$relative_root/sub"
++ '
++
++ test_expect_success "absolute: $label" '
++ (
++ cd "$absolute_root/sub" &&
++ ROOT="$(test-tool path-utils real_path "..")" && export ROOT &&
++ eval "$init_command" &&
++ expect_path="$ROOT${expect_absolute_suffix:+/$expect_absolute_suffix}" &&
++ echo "path.$field_name.absolute=$expect_path" >expect &&
++ git repo info "path.$field_name.absolute" >actual &&
++ test_cmp expect actual
++ )
++ '
++
++ test_expect_success "relative: $label" '
++ (
++ cd "$relative_root/sub" &&
++ ROOT="$(test-tool path-utils real_path "..")" && export ROOT &&
++ eval "$init_command" &&
++ echo "path.$field_name.relative=$expect_relative" >expect &&
++ git repo info "path.$field_name.relative" >actual &&
++ test_cmp expect actual
++ )
++ '
++}
++
++test_repo_info_path 'commondir standard' 'commondir' 'commondir-std' \
++ '.git' '../.git'
++
++test_repo_info_path 'commondir with GIT_COMMON_DIR and GIT_DIR' 'commondir' \
++ 'commondir-envs' 'custom-common' '../custom-common' \
++ 'GIT_COMMON_DIR="$ROOT/custom-common" && export GIT_COMMON_DIR &&
++ GIT_DIR="../.git" && export GIT_DIR &&
++ git init --bare "$ROOT/custom-common"'
++
++test_repo_info_path 'commondir with only GIT_DIR' 'commondir' \
++ 'commondir-only-gitdir' '.git' '../.git' \
++ 'GIT_DIR="../.git" && export GIT_DIR'
++
test_done
3: ca95d51f6e ! 4: ffd6a5bb16 repo: add path.gitdir with absolute and relative suffix formatting
@@ Metadata
## Commit message ##
repo: add path.gitdir with absolute and relative suffix formatting
- Scripts often need to locate the `.git` directory. While `git rev-parse`
- provides this, it relies on command-line flags to dictate path formatting.
+ Scripts need a stable way to locate the git directory without
+ parsing rev-parse output or relying on its flag-driven path format
+ selection. There is no way to retrieve this path from git repo info
+ today.
- Introduce `path.gitdir.absolute` and `path.gitdir.relative` keys to
- `git repo info`. Exposing separate format-specific keys instead of a base
- `path.gitdir` key avoids default fallbacks and requires callers to state
- their format requirements explicitly. Both keys use `format_path()` to
- resolve paths.
-
- To test these keys, introduce the `test_repo_info_path` helper in
- `t/t1900-repo-info.sh`. The helper evaluates paths dynamically and accepts
- environment variable prefixes. This prepares the test suite for future path
- keys that depend on environment overrides, such as `commondir`.
+ Introduce path.gitdir.absolute and path.gitdir.relative keys,
+ consistent with the path.commondir keys added in the previous patch.
+ Reuse the test_repo_info_path helper introduced there to validate
+ both variants.
Mentored-by: Justin Tobler <jltobler@gmail.com>
Mentored-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>
@@ Commit message
## Documentation/git-repo.adoc ##
@@ Documentation/git-repo.adoc: values that they return:
- `object.format`::
- The object format (hash algorithm) used in the repository.
+ The path to the Git repository's common directory relative to
+ the current working directory.
+`path.gitdir.absolute`::
+ The canonical absolute path to the Git repository directory (the `.git` directory).
@@ Documentation/git-repo.adoc: values that they return:
+
## builtin/repo.c ##
-@@
- #include "hex.h"
- #include "odb.h"
- #include "parse-options.h"
-+#include "path.h"
- #include "path-walk.h"
- #include "progress.h"
- #include "quote.h"
- #include "ref-filter.h"
- #include "refs.h"
- #include "revision.h"
-+#include "setup.h"
- #include "strbuf.h"
- #include "string-list.h"
- #include "shallow.h"
-@@ builtin/repo.c: static int get_object_format(struct repository *repo, struct strbuf *buf)
+@@ builtin/repo.c: static int get_path_commondir_relative(struct repository *repo, struct strbuf *b
return 0;
}
@@ builtin/repo.c: static int get_object_format(struct repository *repo, struct str
+ if (!git_dir)
+ return error(_("unable to get git directory"));
+
-+ format_path(buf, git_dir, startup_info->prefix, PATH_FORMAT_CANONICAL);
++ append_formatted_path(buf, git_dir, startup_info->prefix, PATH_FORMAT_CANONICAL);
+ return 0;
+}
+
@@ builtin/repo.c: static int get_object_format(struct repository *repo, struct str
+ if (!git_dir)
+ return error(_("unable to get git directory"));
+
-+ format_path(buf, git_dir, startup_info->prefix, PATH_FORMAT_RELATIVE);
++ append_formatted_path(buf, git_dir, startup_info->prefix, PATH_FORMAT_RELATIVE);
+ return 0;
+}
+
@@ builtin/repo.c: static int get_object_format(struct repository *repo, struct str
{
strbuf_addstr(buf,
@@ builtin/repo.c: static const struct repo_info_field repo_info_field[] = {
- { "layout.bare", get_layout_bare },
- { "layout.shallow", get_layout_shallow },
{ "object.format", get_object_format },
+ { "path.commondir.absolute", get_path_commondir_absolute },
+ { "path.commondir.relative", get_path_commondir_relative },
+ { "path.gitdir.absolute", get_path_gitdir_absolute },
+ { "path.gitdir.relative", get_path_gitdir_relative },
{ "references.format", get_references_format },
@@ builtin/repo.c: static const struct repo_info_field repo_info_field[] = {
## t/t1900-repo-info.sh ##
-@@ t/t1900-repo-info.sh: test_expect_success 'git repo info -h shows only repo info usage' '
- test_grep ! "git repo structure" actual
- '
+@@ t/t1900-repo-info.sh: test_repo_info_path 'commondir with only GIT_DIR' 'commondir' \
+ 'commondir-only-gitdir' '.git' '../.git' \
+ 'GIT_DIR="../.git" && export GIT_DIR'
-+test_repo_info_path () {
-+ field_name=$1
-+ expect_absolute_eval=$2
-+ expect_relative=$3
-+ env_prefix=$4
-+
-+ test_expect_success "query individual key: path.$field_name.absolute${env_prefix:+ ($env_prefix)}" '
-+ (
-+ cd test-repo/sub &&
-+ expect_absolute=$(eval "$expect_absolute_eval") &&
-+ echo "path.$field_name.absolute=$expect_absolute" >expect &&
-+ eval "${env_prefix:+$env_prefix }git repo info \"path.$field_name.absolute\"" >actual &&
-+ test_cmp expect actual
-+ )
-+ '
-+
-+ test_expect_success "query individual key: path.$field_name.relative${env_prefix:+ ($env_prefix)}" '
-+ (
-+ cd test-repo/sub &&
-+ echo "path.$field_name.relative=$expect_relative" >expect &&
-+ eval "${env_prefix:+$env_prefix }git repo info \"path.$field_name.relative\"" >actual &&
-+ test_cmp expect actual
-+ )
-+ '
-+}
-+
-+test_expect_success 'setup test repository layout for path fields' '
-+ git init test-repo &&
-+ mkdir -p test-repo/sub
-+'
++test_repo_info_path 'gitdir standard' 'gitdir' 'gitdir-std' \
++ '.git' '../.git'
+
-+test_repo_info_path 'gitdir' 'echo "$(cd .. && pwd)/.git"' '../.git'
++test_repo_info_path 'gitdir with explicit GIT_DIR' 'gitdir' \
++ 'gitdir-env' '.git' '../.git' \
++ 'GIT_DIR="../.git" && export GIT_DIR'
+
test_done
--
2.54.0
next prev parent reply other threads:[~2026-06-12 18:29 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-01 15:19 [GSoC][PATCH 0/4] teach git repo info to handle path keys K Jayatheerth
2026-06-01 15:19 ` [GSoC][PATCH 1/4] path: add strbuf_add_path for formatting paths K Jayatheerth
2026-06-02 13:00 ` Phillip Wood
2026-06-01 15:19 ` [GSoC][PATCH 2/4] rev-parse: use strbuf_add_path for path formatting K Jayatheerth
2026-06-01 15:19 ` [GSoC][PATCH 3/4] repo: add path.gitdir with absolute and relative suffix formatting K Jayatheerth
2026-06-01 16:28 ` Lucas Seiki Oshiro
2026-06-01 23:09 ` Junio C Hamano
2026-06-01 15:19 ` [GSoC][PATCH 4/4] repo: add path.commondir " K Jayatheerth
2026-06-01 16:34 ` Lucas Seiki Oshiro
2026-06-01 21:58 ` Lucas Seiki Oshiro
2026-06-01 16:25 ` [GSoC][PATCH 0/4] teach git repo info to handle path keys Lucas Seiki Oshiro
2026-06-01 22:04 ` Lucas Seiki Oshiro
2026-06-01 23:05 ` Junio C Hamano
2026-06-02 13:03 ` Phillip Wood
2026-06-05 16:30 ` [GSoC PATCH v2 " K Jayatheerth
2026-06-05 16:30 ` [GSoC PATCH v2 1/4] path: introduce format_path() for centralized path formatting K Jayatheerth
2026-06-05 16:55 ` Kristoffer Haugsbakk
2026-06-09 2:27 ` K Jayatheerth
2026-06-08 15:05 ` Lucas Seiki Oshiro
2026-06-09 2:47 ` K Jayatheerth
2026-06-08 17:28 ` Justin Tobler
2026-06-05 16:30 ` [GSoC PATCH v2 2/4] rev-parse: use format_path for " K Jayatheerth
2026-06-08 17:54 ` Justin Tobler
2026-06-05 16:30 ` [GSoC PATCH v2 3/4] repo: add path.gitdir with absolute and relative suffix formatting K Jayatheerth
2026-06-08 18:50 ` Justin Tobler
2026-06-09 4:41 ` K Jayatheerth
2026-06-09 14:31 ` Justin Tobler
2026-06-10 12:11 ` K Jayatheerth
2026-06-08 22:17 ` Lucas Seiki Oshiro
2026-06-05 16:30 ` [GSoC PATCH v2 4/4] repo: add path.commondir " K Jayatheerth
2026-06-08 22:40 ` Lucas Seiki Oshiro
2026-06-05 17:35 ` [GSoC PATCH v2 0/4] teach git repo info to handle path keys Lucas Seiki Oshiro
2026-06-09 2:30 ` K Jayatheerth
2026-06-08 22:36 ` Junio C Hamano
2026-06-09 5:00 ` K Jayatheerth
2026-06-10 12:42 ` Lucas Seiki Oshiro
2026-06-12 18:28 ` K Jayatheerth [this message]
2026-06-12 18:28 ` [GSoC Patch v3 1/4] path: introduce append_formatted_path() for shared path formatting K Jayatheerth
2026-06-12 18:28 ` [GSoC Patch v3 2/4] rev-parse: use append_formatted_path() for " K Jayatheerth
2026-06-12 18:28 ` [GSoC Patch v3 3/4] repo: add path.commondir with absolute and relative suffix formatting K Jayatheerth
2026-06-15 1:54 ` Lucas Seiki Oshiro
2026-06-12 18:28 ` [GSoC Patch v3 4/4] repo: add path.gitdir " K Jayatheerth
2026-06-15 1:55 ` Lucas Seiki Oshiro
2026-06-15 1:59 ` [GSoC Patch v3 0/4] teach git repo info to handle path keys Lucas Seiki Oshiro
2026-06-15 4:51 ` [GSoC Patch v4 " K Jayatheerth
2026-06-15 4:51 ` [GSoC Patch v4 1/4] path: introduce append_formatted_path() for shared path formatting K Jayatheerth
2026-06-15 4:51 ` [GSoC Patch v4 2/4] rev-parse: use append_formatted_path() for " K Jayatheerth
2026-06-15 4:51 ` [GSoC Patch v4 3/4] repo: add path.commondir with absolute and relative suffix formatting K Jayatheerth
2026-06-15 4:51 ` [GSoC Patch v4 4/4] repo: add path.gitdir " K Jayatheerth
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=20260612182847.562816-1-jayatheerthkulkarni2005@gmail.com \
--to=jayatheerthkulkarni2005@gmail.com \
--cc=a3205153416@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jltobler@gmail.com \
--cc=kristofferhaugsbakk@fastmail.com \
--cc=kumarayushjha123@gmail.com \
--cc=lucasseikioshiro@gmail.com \
--cc=phillip.wood@dunelm.org.uk \
--cc=sandals@crustytoothpaste.net \
/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