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

[PATCH 1/2] alias: Rework comment about processing aliases

From
Tim Schumacher <timschumi@gmx.de>
Date
Oct 21, 2018, 18:46 UTC
Message-ID
<20181021184619.6688-1-timschumi@gmx.de>

The old comment's message wasn't really clear and it was in a weird location for it to talk about the alias handling process as a whole.

Rephrase and move it to the top of the while() loop to make the
message more clear.
---
 git.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/git.c b/git.c
index 6a81ed6fc..0f77bce7d 100644
--- a/git.c
+++ b/git.c
@@ -718,6 +718,11 @@ static int run_argv(int *argcp, const char ***argv)
 	struct strbuf env = STRBUF_INIT;
 
 	init_cmd_history(&env, &cmd_list);
+
+	/*
+	 * Check if argv[0] is a command before seeing if it is an
+	 * alias to avoid taking over existing commands
+	 */
 	while (1) {
 		/*
 		 * If we tried alias and futzed with our environment,
@@ -753,11 +758,6 @@ static int run_argv(int *argcp, const char ***argv)
 
 		add_cmd_history(&env, &cmd_list, *argv[0]);
 
-		/*
-		 * It could be an alias -- this works around the insanity
-		 * of overriding "git log" with "git show" by having
-		 * alias.log = show
-		 */
 		if (!handle_alias(argcp, argv))
 			break;
 		done_alias = 1;
-- 
2.19.1.450.ga4b8ab536
Next: Tim Schumacher
Message 1 of 2 in “alias: Rework comment about processing aliases”
  1. 1/2 alias: Rework comment about processing aliasesTim Schumacher, Oct 21, 2018
  2. 2/2 alias: Move checking code into a seperate functionTim Schumacher, Oct 21, 2018

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.