#include "attr.h"
static const char archive_usage[] = \
- "git-archive --format=<fmt> [--prefix=<prefix>/] [--verbose] [<extra>] <tree-ish> [path...]";
+ "git archive --format=<fmt> [--prefix=<prefix>/] [--verbose] [<extra>] <tree-ish> [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,
#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 <revs-file>] [-M] [-C] [-C] [--contents <filename>] [--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 <file>'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;
}
static const char mailinfo_usage[] =
- "git-mailinfo [-k] [-u | --encoding=<encoding> | -n] msg patch <mail >info";
- "git mailinfo [-k] [-u | --encoding=<encoding>] msg patch <mail >info";
++ "git mailinfo [-k] [-u | --encoding=<encoding> | -n] msg patch <mail >info";
int cmd_mailinfo(int argc, const char **argv, const char *prefix)
{
#include "path-list.h"
static const char git_mailsplit_usage[] =
- "git-mailsplit [-d<prec>] [-f<n>] [-b] -o<directory> [<mbox>|<Maildir>...]";
-"git mailsplit [-d<prec>] [-f<n>] [-b] -o<directory> <mbox>|<Maildir>...";
++"git mailsplit [-d<prec>] [-f<n>] [-b] -o<directory> [<mbox>|<Maildir>...]";
static int is_from_line(const char *line, int len)
{
#include "xdiff/xdiff.h"
#include "xdiff-interface.h"
-#include <time.h>
-
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;
#include "utf8.h"
#include "mailmap.h"
#include "shortlog.h"
+#include "parse-options.h"
-static const char shortlog_usage[] =
-"git shortlog [-n] [-s] [-e] [-w] [<commit-id>... ]";
+static char const * const shortlog_usage[] = {
- "git-shortlog [-n] [-s] [-e] [-w] [rev-opts] [--] [<commit-id>... ]",
++ "git shortlog [-n] [-s] [-e] [-w] [rev-opts] [--] [<commit-id>... ]",
+ "",
+ "[rev-opts] are documented in git-rev-list(1)",
+ NULL
+};
static int compare_by_number(const void *a1, const void *a2)
{
SUBDIRECTORY_OK=Yes
OPTIONS_KEEPDASHDASH=
OPTIONS_SPEC="\
- git-am [options] [<mbox>|<Maildir>...]
- git-am [options] --resolved
- git-am [options] --skip
-git am [options] <mbox>|<Maildir>...
++git am [options] [<mbox>|<Maildir>...]
+ git am [options] --resolved
+ git am [options] --skip
--
d,dotest= (removed -- do not use)
i,interactive run interactively
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' '
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 &&
'
test_expect_success 'am fails on mail without patch' '
- ! git am <failmail &&
+ test_must_fail git am <failmail &&
- rm -r .dotest/
+ rm -r .git/rebase/
'
test_expect_success 'am fails on empty patch' '
echo "---" >>failmail &&
- ! git am <failmail &&
+ test_must_fail git am <failmail &&
git am --skip &&
- ! test -d .dotest
+ ! test -d .git/rebase
'
test_expect_success 'am works from stdin in subdirectory' '
git reset --hard &&
mkdir .git/rr-cache &&
git config --unset rerere.enabled &&
- ! git merge first
+ test_must_fail git merge first
'
-sha1=$(sed -e 's/ .*//' .git/rr-cache/MERGE_RR)
+sha1=$(sed -e 's/ .*//' .git/MERGE_RR)
rr=.git/rr-cache/$sha1
-test_expect_success 'recorded preimage' "grep ======= $rr/preimage"
+test_expect_success 'recorded preimage' "grep ^=======$ $rr/preimage"
test_expect_success 'rerere.enabled works, too' '
rm -rf .git/rr-cache &&
git config rerere.enabled true &&
git reset --hard &&
- ! git merge first &&
+ test_must_fail git merge first &&
- grep ======= $rr/preimage
+ grep ^=======$ $rr/preimage
'
test_expect_success 'no postimage or thisimage yet' \
echo Bello > 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 &&