DORMANTno replies

[PATCH] git-rev-list --help anywhere

From: Alex Riesen <hidden>
Date: 2016-06-15 22:42:19
Subsystem: the rest · Maintainer: Linus Torvalds

Junio C Hamano, Sat, Feb 18, 2006 19:55:02 +0100:
Petr Baudis [off-list ref] writes:
quoted
	$ git-rev-list --help
	fatal: Not a git repository
Hmph, true.  Ideas?
Signed-off-by: Alex Riesen <redacted>

---

 rev-list.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

0855207c43a83007e4c060a03c39269f379fed41
diff --git a/rev-list.c b/rev-list.c
index f2d1105..a059e45 100644
--- a/rev-list.c
+++ b/rev-list.c
@@ -755,10 +755,16 @@ static void handle_all(struct commit_lis
 
 int main(int argc, const char **argv)
 {
-	const char *prefix = setup_git_directory();
+	const char *prefix;
 	struct commit_list *list = NULL;
 	int i, limited = 0;
 
+	for (i = 1 ; i < argc; i++)
+	    if ( !strcmp(argv[i], "--help") )
+		usage(rev_list_usage);
+
+	prefix = setup_git_directory();
+
 	for (i = 1 ; i < argc; i++) {
 		int flags;
 		const char *arg = argv[i];
-- 
1.2.1.g59a08
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help