diff mbox series

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

Message ID 20181021184619.6688-1-timschumi@gmx.de
State New, archived
Headers show
Series [1/2] alias: Rework comment about processing aliases | expand

Commit Message

Tim Schumacher Oct. 21, 2018, 6:46 p.m. UTC
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 mbox series

Patch

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;