Re: [GSoC PATCH v2 1/4] path: introduce format_path() for centralized path formatting
- From
- Kristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com>
- Date
- Jun 5, 2026, 16:55 UTC
- Message-ID
- <bd9bc9aa-60b6-4e5d-9ce1-bf38b6032309@app.fastmail.com>
- In-Reply-To
- <20260605163012.181089-2-jayatheerthkulkarni2005@gmail.com>
On Fri, Jun 5, 2026, at 18:30, K Jayatheerth wrote:
Show 13 quoted lines
> 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. > > 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`.
This looks very well explained to my naive eyes.
> > Signed-off-by: K Jayatheerth <jayatheerthkulkarni2005@gmail.com> > Mentored-by: Justin Tobler <jltobler@gmail.com> > Mentored-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>
Nitpick. You are supposed to add your `Signed-off-by` at the end. You are saying with that line that you are signing off on the changes and the commit message, including the trailers (mentors) you’ve decided to add. Imagine if the maintainer applies this patch and fixes a typo and the commit becomes:
Mentored-by: Justin Tobler <jltobler@gmail.com>
Mentored-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>
Signed-off-by: K Jayatheerth <jayatheerthkulkarni2005@gmail.com>
[jc: typo fix]
Signed-off-by: Junio ...The chain of custody is then very clear.
> --- >[snip]