git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/2] for-each-repo: interpolate repo path arguments

From
Ronan Pigott <ronan@rjp.ie>
Date
Nov 5, 2022, 18:45 UTC
Message-ID
<20221105184532.457043-2-ronan@rjp.ie>
In-Reply-To
<20221105184532.457043-1-ronan@rjp.ie>

This is a quality of life change for git-maintenance, so repos can be recorded with the tilde syntax. The register subcommand will not record repos in this format by default.

Signed-off-by: Ronan Pigott <ronan@rjp.ie>
---
 builtin/for-each-repo.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/builtin/for-each-repo.c b/builtin/for-each-repo.c
index d45d873f57..6aeac37148 100644
--- a/builtin/for-each-repo.c
+++ b/builtin/for-each-repo.c
@@ -14,13 +14,16 @@ static int run_command_on_repo(const char *path, int argc, const char ** argv)
 {
 	int i;
 	struct child_process child = CHILD_PROCESS_INIT;
+	char *abspath = interpolate_path(path, 0);
 
 	child.git_cmd = 1;
-	strvec_pushl(&child.args, "-C", path, NULL);
+	strvec_pushl(&child.args, "-C", abspath, NULL);
 
 	for (i = 0; i < argc; i++)
 		strvec_push(&child.args, argv[i]);
 
+	free(abspath);
+
 	return run_command(&child);
 }
 
-- 
2.38.1
Previous: Ronan PigottNext: Taylor Blau
Message 2 of 8 in “git-maintenance quality-of-life improvements”
  1. 0/2 git-maintenance quality-of-life improvementsRonan Pigott, Nov 5, 2022
  2. 1/2 for-each-repo: interpolate repo path argumentsRonan Pigott, Nov 5, 2022
  3. Taylor BlauNov 6, 2022
  4. Derrick StoleeNov 7, 2022
  5. 2/2 maintenance: add option to register in a specific configRonan Pigott, Nov 5, 2022
  6. Taylor BlauNov 6, 2022
  7. Taylor BlauNov 6, 2022
  8. Derrick StoleeNov 7, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.