Thread (82 messages) flat view 82 messages, 5 authors, 6d ago

Re: [GSoC Patch v5 7/7] repo: add path.cdup

From: Junio C Hamano <hidden>
Date: 2026-08-25 19:31:48

K Jayatheerth [off-list ref] writes:
+static int get_path_cdup(struct repository *repo, struct strbuf *buf)
+{
+	const char *pfx = repo->prefix;
+
+	while (pfx) {
+		pfx = strchr(pfx, '/');
+		if (pfx) {
+			pfx++;
+			strbuf_addstr(buf, "../");
+		}
+	}
+	return 0;
+}
Can we have a small common helper library (e.g., repo-info.c at the
top level) shared between this code and builtin/rev-parse.c so
that we have only a single implementation of 'cdup'?

The same comment applies to all the other features that duplicate
implementations from rev-parse and elsewhere in the repo-info file.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help