login
Header Space

 
 

[PATCH] Print a sane error message if an alias expands to an invalid git command

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Junio C Hamano <junkio@...>
Cc: <git@...>, Theodore Ts'o <tytso@...>
Date: Saturday, February 10, 2007 - 12:05 pm

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
---
 git.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/git.c b/git.c
index 82a8357..c43d4ff 100644
--- a/git.c
+++ b/git.c
@@ -387,8 +387,15 @@ int main(int argc, const char **argv, char **envp)
 		done_alias = 1;
 	}
 
-	if (errno == ENOENT)
+	if (errno == ENOENT) {
+		if (done_alias) {
+			fprintf(stderr, "Expansion of alias '%s' failed; "
+				"'%s' is not a git-command\n",
+				cmd, argv[0]);
+			exit(1);
+		}
 		help_unknown_cmd(cmd);
+	}
 
 	fprintf(stderr, "Failed to run command '%s': %s\n",
 		cmd, strerror(errno));
-- 
1.5.0.rc4

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Git rescue mission, Bill Lear, (Wed Feb 7, 8:18 pm)
Re: Git rescue mission, Linus Torvalds, (Thu Feb 8, 1:27 pm)
Re: Git rescue mission, Kalle Pokki, (Thu Feb 8, 4:12 pm)
Re: Git rescue mission, Linus Torvalds, (Thu Feb 8, 5:23 pm)
Re: Git rescue mission, Kalle Pokki, (Thu Feb 8, 6:03 pm)
Re: Git rescue mission, Shawn O. Pearce, (Thu Feb 8, 6:10 pm)
Re: Git rescue mission, Kalle Pokki, (Fri Feb 9, 3:21 pm)
Re: Git rescue mission, Theodore Tso, (Thu Feb 8, 9:48 pm)
Re: Git rescue mission, Shawn O. Pearce, (Thu Feb 8, 9:58 pm)
Re: Git rescue mission, Theodore Ts'o, (Sat Feb 10, 12:05 pm)
[PATCH] Print a sane error message if an alias expands to an..., Theodore Ts'o, (Sat Feb 10, 12:05 pm)
[PATCH] Allow aliases to expand to shell commands, Theodore Ts'o, (Sat Feb 10, 12:05 pm)
Re: [PATCH] Allow aliases to expand to shell commands, Theodore Tso, (Sat Feb 10, 2:13 pm)
Re: [PATCH] Allow aliases to expand to shell commands, Johannes Schindelin, (Sat Feb 10, 4:34 pm)
Re: [PATCH] Allow aliases to expand to shell commands, Theodore Tso, (Sat Feb 10, 8:13 pm)
Re: [PATCH] Allow aliases to expand to shell commands, Johannes Schindelin, (Sun Feb 11, 12:03 pm)
Re: [PATCH] Allow aliases to expand to shell commands, Theodore Tso, (Sun Feb 11, 12:21 pm)
Re: [PATCH] Allow aliases to expand to shell commands, Junio C Hamano, (Sun Feb 11, 5:44 pm)
Re: [PATCH] Allow aliases to expand to shell commands, Theodore Tso, (Sun Feb 11, 11:56 pm)
Re: [PATCH] Allow aliases to expand to shell commands, Shawn O. Pearce, (Mon Feb 12, 2:53 am)
Re: [PATCH] Allow aliases to expand to shell commands, Johannes Schindelin, (Sun Feb 11, 6:03 pm)
Re: [PATCH] Allow aliases to expand to shell commands, Johannes Schindelin, (Sun Feb 11, 12:36 pm)
Re: [PATCH] Allow aliases to expand to shell commands, Linus Torvalds, (Sat Feb 10, 2:04 pm)
Re: Git rescue mission, Bill Lear, (Thu Feb 8, 5:57 pm)
Re: Git rescue mission, Linus Torvalds, (Thu Feb 8, 6:13 pm)
Re: Git rescue mission, Junio C Hamano, (Fri Feb 9, 12:38 am)
Re: Git rescue mission, Bill Lear, (Thu Feb 8, 7:25 pm)
Re: Git rescue mission, Linus Torvalds, (Thu Feb 8, 7:46 pm)
Re: Git rescue mission, Shawn O. Pearce, (Thu Feb 8, 7:33 pm)
Re: Git rescue mission, Bill Lear, (Thu Feb 8, 7:40 pm)
Re: Git rescue mission, Linus Torvalds, (Thu Feb 8, 8:17 pm)
Re: Git rescue mission, Michael S. Tsirkin, (Fri Feb 9, 4:58 am)
Re: Git rescue mission, Jakub Narebski, (Thu Feb 8, 8:03 pm)
Re: Git rescue mission, Shawn O. Pearce, (Thu Feb 8, 7:50 pm)
Re: Git rescue mission, Bill Lear, (Thu Feb 8, 6:33 pm)
Re: Git rescue mission, Jakub Narebski, (Thu Feb 8, 6:29 pm)
Re: Git rescue mission, Johannes Schindelin, (Wed Feb 7, 8:22 pm)
Re: Git rescue mission, Bill Lear, (Wed Feb 7, 8:24 pm)
Re: Git rescue mission, Johannes Schindelin, (Wed Feb 7, 8:25 pm)
Re: Git rescue mission, Bill Lear, (Wed Feb 7, 8:34 pm)
Re: Git rescue mission, Junio C Hamano, (Wed Feb 7, 8:48 pm)
Re: Git rescue mission, Alexander Litvinov, (Thu Feb 8, 12:28 am)
Re: Git rescue mission, Junio C Hamano, (Thu Feb 8, 8:53 pm)
Re: Git rescue mission, Alexander Litvinov, (Thu Feb 8, 11:32 pm)
Re: Git rescue mission, Bill Lear, (Thu Feb 8, 11:27 am)
Re: Git rescue mission, Jeff King, (Thu Feb 8, 7:24 pm)
Re: Git rescue mission, Bill Lear, (Thu Feb 8, 7:32 pm)
speck-geostationary