commit: use generations in paint_down_to_common()
[gitweb.git] / builtin / stripspace.c
index a8b7a93b43e414b51c76a4853ff3b49394ab1d77..bdf032886912bb768cf3528efbffab4fe3029a58 100644 (file)
@@ -1,5 +1,6 @@
 #include "builtin.h"
 #include "cache.h"
+#include "config.h"
 #include "parse-options.h"
 #include "strbuf.h"
 
@@ -14,8 +15,8 @@ static void comment_lines(struct strbuf *buf)
 }
 
 static const char * const stripspace_usage[] = {
-       N_("git stripspace [-s | --strip-comments] < input"),
-       N_("git stripspace [-c | --comment-lines] < input"),
+       N_("git stripspace [-s | --strip-comments]"),
+       N_("git stripspace [-c | --comment-lines]"),
        NULL
 };
 
@@ -35,7 +36,7 @@ int cmd_stripspace(int argc, const char **argv, const char *prefix)
                            N_("skip and remove all lines starting with comment character"),
                            STRIP_COMMENTS),
                OPT_CMDMODE('c', "comment-lines", &mode,
-                           N_("prepend comment character and blank to each line"),
+                           N_("prepend comment character and space to each line"),
                            COMMENT_LINES),
                OPT_END()
        };
@@ -44,8 +45,10 @@ int cmd_stripspace(int argc, const char **argv, const char *prefix)
        if (argc)
                usage_with_options(stripspace_usage, options);
 
-       if (mode == STRIP_COMMENTS || mode == COMMENT_LINES)
+       if (mode == STRIP_COMMENTS || mode == COMMENT_LINES) {
+               setup_git_directory_gently(NULL);
                git_config(git_default_config, NULL);
+       }
 
        if (strbuf_read(&buf, 0, 1024) < 0)
                die_errno("could not read the input");