From: Junio C Hamano Date: Sun, 21 May 2006 08:34:54 +0000 (-0700) Subject: Merge branch 'master' into js/fmt-patch X-Git-Tag: v1.4.0-rc1~76^2~3 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=328b710d800dc3786fe2b8595e5553dc4a4af424;p=git.git Merge branch 'master' into js/fmt-patch * master: (119 commits) diff family: add --check option Document that "git add" only adds non-ignored files. Add a conversion tool to migrate remote information into the config fetch, pull: ask config for remote information Fix build procedure for builtin-init-db read-tree -m -u: do not overwrite or remove untracked working tree files. apply --cached: do not check newly added file in the working tree Implement a --dry-run option to git-quiltimport Implement git-quiltimport Revert "builtin-grep: workaround for non GNU grep." builtin-grep: workaround for non GNU grep. builtin-grep: workaround for non GNU grep. git-am: use apply --cached apply --cached: apply a patch without using working tree. apply --numstat: show new name, not old name. Documentation/Makefile: create tarballs for the man pages and html files Allow pickaxe and diff-filter options to be used by git log. Libify the index refresh logic Builtin git-init-db Remove unnecessary local in get_ref_sha1. ... --- 328b710d800dc3786fe2b8595e5553dc4a4af424 diff --cc commit.c index 93b3903ea,4a26070c1..84558bac2 --- a/commit.c +++ b/commit.c @@@ -22,25 -22,33 +22,34 @@@ struct sort_nod const char *commit_type = "commit"; + struct cmt_fmt_map { + const char *n; + size_t cmp_len; + enum cmit_fmt v; + } cmt_fmts[] = { + { "raw", 1, CMIT_FMT_RAW }, + { "medium", 1, CMIT_FMT_MEDIUM }, + { "short", 1, CMIT_FMT_SHORT }, ++ { "email", 1, CMIT_FMT_EMAIL }, + { "full", 5, CMIT_FMT_FULL }, + { "fuller", 5, CMIT_FMT_FULLER }, + { "oneline", 1, CMIT_FMT_ONELINE }, + }; + enum cmit_fmt get_commit_format(const char *arg) { - if (!*arg) + int i; + + if (!arg || !*arg) return CMIT_FMT_DEFAULT; - if (!strcmp(arg, "=raw")) - return CMIT_FMT_RAW; - if (!strcmp(arg, "=medium")) - return CMIT_FMT_MEDIUM; - if (!strcmp(arg, "=short")) - return CMIT_FMT_SHORT; - if (!strcmp(arg, "=full")) - return CMIT_FMT_FULL; - if (!strcmp(arg, "=fuller")) - return CMIT_FMT_FULLER; - if (!strcmp(arg, "=email")) - return CMIT_FMT_EMAIL; - if (!strcmp(arg, "=oneline")) - return CMIT_FMT_ONELINE; - die("invalid --pretty format"); + if (*arg == '=') + arg++; + for (i = 0; i < ARRAY_SIZE(cmt_fmts); i++) { + if (!strncmp(arg, cmt_fmts[i].n, cmt_fmts[i].cmp_len)) + return cmt_fmts[i].v; + } + + die("invalid --pretty format: %s", arg); } static struct commit *check_commit(struct object *obj, diff --cc git.c index a8f7926b4,3216d311b..f4dff02bd --- a/git.c +++ b/git.c @@@ -47,9 -47,12 +47,13 @@@ static void handle_internal_command(in { "whatchanged", cmd_whatchanged }, { "show", cmd_show }, { "push", cmd_push }, + { "fmt-patch", cmd_format_patch }, { "count-objects", cmd_count_objects }, { "diff", cmd_diff }, + { "grep", cmd_grep }, + { "rev-list", cmd_rev_list }, + { "init-db", cmd_init_db }, + { "check-ref-format", cmd_check_ref_format } }; int i;