From: Junio C Hamano Date: Thu, 17 Jul 2008 00:22:50 +0000 (-0700) Subject: Merge branch 'sb/dashless' X-Git-Tag: v1.6.0-rc0~39 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=588c038ac690e012a00dcace34fb318449f5ec7c;p=git.git Merge branch 'sb/dashless' * sb/dashless: Make usage strings dash-less t/: Use "test_must_fail git" instead of "! git" t/test-lib.sh: exit with small negagive int is ok with test_must_fail Conflicts: builtin-blame.c builtin-mailinfo.c builtin-mailsplit.c builtin-shortlog.c git-am.sh t/t4150-am.sh t/t4200-rerere.sh --- 588c038ac690e012a00dcace34fb318449f5ec7c diff --cc builtin-archive.c index 88204bf73,5cca46012..d5e3af879 --- a/builtin-archive.c +++ b/builtin-archive.c @@@ -13,13 -13,16 +13,13 @@@ #include "attr.h" static const char archive_usage[] = \ - "git-archive --format= [--prefix=/] [--verbose] [] [path...]"; + "git archive --format= [--prefix=/] [--verbose] [] [path...]"; -static struct archiver_desc -{ - const char *name; - write_archive_fn_t write_archive; - parse_extra_args_fn_t parse_extra; -} archivers[] = { - { "tar", write_tar_archive, NULL }, - { "zip", write_zip_archive, parse_extra_zip_args }, +#define USES_ZLIB_COMPRESSION 1 + +const struct archiver archivers[] = { + { "tar", write_tar_archive }, + { "zip", write_zip_archive, USES_ZLIB_COMPRESSION }, }; static int run_remote_archiver(const char *remote, int argc, diff --cc builtin-blame.c index 8827f1e0c,91850a53e..9bced3b26 --- a/builtin-blame.c +++ b/builtin-blame.c @@@ -18,16 -18,24 +18,16 @@@ #include "cache-tree.h" #include "path-list.h" #include "mailmap.h" +#include "parse-options.h" - static char blame_usage[] = "git-blame [options] [rev-opts] [rev] [--] file"; -static char blame_usage[] = -"git blame [-c] [-b] [-l] [--root] [-t] [-f] [-n] [-s] [-p] [-w] [-L n,m] [-S ] [-M] [-C] [-C] [--contents ] [--incremental] [commit] [--] file\n" -" -c Use the same output mode as git-annotate (Default: off)\n" -" -b Show blank SHA-1 for boundary commits (Default: off)\n" -" -l Show long commit SHA1 (Default: off)\n" -" --root Do not treat root commits as boundaries (Default: off)\n" -" -t Show raw timestamp (Default: off)\n" -" -f, --show-name Show original filename (Default: auto)\n" -" -n, --show-number Show original linenumber (Default: off)\n" -" -s Suppress author name and timestamp (Default: off)\n" -" -p, --porcelain Show in a format designed for machine consumption\n" -" -w Ignore whitespace differences\n" -" -L n,m Process only line range n,m, counting from 1\n" -" -M, -C Find line movements within and across files\n" -" --incremental Show blame entries as we find them, incrementally\n" -" --contents file Use 's contents as the final image\n" -" -S revs-file Use revisions from revs-file instead of calling git-rev-list\n"; ++static char blame_usage[] = "git blame [options] [rev-opts] [rev] [--] file"; + +static const char *blame_opt_usage[] = { + blame_usage, + "", + "[rev-opts] are documented in git-rev-list(1)", + NULL +}; static int longest_file; static int longest_author; diff --cc builtin-mailinfo.c index 13f0502b9,b3d281e36..a4f99c886 --- a/builtin-mailinfo.c +++ b/builtin-mailinfo.c @@@ -962,7 -960,7 +962,7 @@@ static int mailinfo(FILE *in, FILE *out } static const char mailinfo_usage[] = - "git-mailinfo [-k] [-u | --encoding= | -n] msg patch info"; - "git mailinfo [-k] [-u | --encoding=] msg patch info"; ++ "git mailinfo [-k] [-u | --encoding= | -n] msg patch info"; int cmd_mailinfo(int argc, const char **argv, const char *prefix) { diff --cc builtin-mailsplit.c index e8cbe678e,0dc4cd9a8..13c60c39a --- a/builtin-mailsplit.c +++ b/builtin-mailsplit.c @@@ -9,7 -9,7 +9,7 @@@ #include "path-list.h" static const char git_mailsplit_usage[] = - "git-mailsplit [-d] [-f] [-b] -o [|...]"; -"git mailsplit [-d] [-f] [-b] -o |..."; ++"git mailsplit [-d] [-f] [-b] -o [|...]"; static int is_from_line(const char *line, int len) { diff --cc builtin-rerere.c index 5d40e1693,62ef7cfcf..580580502 --- a/builtin-rerere.c +++ b/builtin-rerere.c @@@ -5,8 -4,10 +5,8 @@@ #include "xdiff/xdiff.h" #include "xdiff-interface.h" -#include - static const char git_rerere_usage[] = - "git-rerere [clear | status | diff | gc]"; + "git rerere [clear | status | diff | gc]"; /* these values are days */ static int cutoff_noresolve = 15; diff --cc builtin-shortlog.c index f8bcbfce4,fcb0da9fc..94c472385 --- a/builtin-shortlog.c +++ b/builtin-shortlog.c @@@ -7,14 -7,9 +7,14 @@@ #include "utf8.h" #include "mailmap.h" #include "shortlog.h" +#include "parse-options.h" -static const char shortlog_usage[] = -"git shortlog [-n] [-s] [-e] [-w] [... ]"; +static char const * const shortlog_usage[] = { - "git-shortlog [-n] [-s] [-e] [-w] [rev-opts] [--] [... ]", ++ "git shortlog [-n] [-s] [-e] [-w] [rev-opts] [--] [... ]", + "", + "[rev-opts] are documented in git-rev-list(1)", + NULL +}; static int compare_by_number(const void *a1, const void *a2) { diff --cc git-am.sh index cc8787b46,14578ceb5..c5b0039d8 --- a/git-am.sh +++ b/git-am.sh @@@ -5,9 -5,9 +5,9 @@@ SUBDIRECTORY_OK=Yes OPTIONS_KEEPDASHDASH= OPTIONS_SPEC="\ - git-am [options] [|...] - git-am [options] --resolved - git-am [options] --skip -git am [options] |... ++git am [options] [|...] + git am [options] --resolved + git am [options] --skip -- d,dotest= (removed -- do not use) i,interactive run interactively diff --cc t/t4150-am.sh index 5cbd5ef67,476f20b50..98ba020d8 --- a/t/t4150-am.sh +++ b/t/t4150-am.sh @@@ -182,8 -182,8 +182,8 @@@ test_expect_success 'am -3 falls back t test_expect_success 'am pauses on conflict' ' git checkout lorem2^^ && - ! git am lorem-move.patch && + test_must_fail git am lorem-move.patch && - test -d .dotest + test -d .git/rebase ' test_expect_success 'am --skip works' ' @@@ -195,8 -195,8 +195,8 @@@ test_expect_success 'am --resolved works' ' git checkout lorem2^^ && - ! git am lorem-move.patch && + test_must_fail git am lorem-move.patch && - test -d .dotest && + test -d .git/rebase && echo resolved >>file && git add file && git am --resolved && @@@ -212,15 -212,15 +212,15 @@@ test_expect_success 'am takes patches f ' test_expect_success 'am fails on mail without patch' ' - ! git am >failmail && - ! git am file2 && git add file2 && git commit -m version2 && - ! git merge fourth && + test_must_fail git merge fourth && - sha1=$(sed -e "s/ .*//" .git/rr-cache/MERGE_RR) && + sha1=$(sed -e "s/ .*//" .git/MERGE_RR) && rr=.git/rr-cache/$sha1 && echo Cello > file2 && git add file2 &&