diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-11-07 02:34:43 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-11-07 02:34:43 +0400 |
commit | 152a9c17a802379a3a48e025b74dedd76e2623cc (patch) | |
tree | 35adf01f3da51119a475392076d1cb290b800a00 /builtin | |
parent | f26f72de159d7ade2fbe8b48734ce98c1aba4d72 (diff) | |
parent | abf03eeb8e99538cd31806d5f252214b9fe695a6 (diff) |
Merge branch 'fc/trivial'
A random collection of style fixes and minor doc updates.
* fc/trivial:
setup: trivial style fixes
run-command: trivial style fixes
diff: trivial style fix
revision: trivial style fixes
pretty: trivial style fix
describe: trivial style fixes
transport-helper: trivial style fix
sha1-name: trivial style cleanup
branch: trivial style fix
revision: add missing include
doc/pull: clarify the illustrations
t: replace pulls with merges
merge: simplify ff-only option
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/branch.c | 3 | ||||
-rw-r--r-- | builtin/describe.c | 7 | ||||
-rw-r--r-- | builtin/diff.c | 2 | ||||
-rw-r--r-- | builtin/merge.c | 11 |
4 files changed, 7 insertions, 16 deletions
diff --git a/builtin/branch.c b/builtin/branch.c index ad0f86de54..5696cf0ef7 100644 --- a/builtin/branch.c +++ b/builtin/branch.c @@ -975,9 +975,8 @@ int cmd_branch(int argc, const char **argv, const char *prefix) die(_("no such branch '%s'"), argv[0]); } - if (!branch_has_merge_config(branch)) { + if (!branch_has_merge_config(branch)) die(_("Branch '%s' has no upstream information"), branch->name); - } strbuf_addf(&buf, "branch.%s.remote", branch->name); git_config_set_multivar(buf.buf, NULL, NULL, 1); diff --git a/builtin/describe.c b/builtin/describe.c index b9d3603704..6f62109887 100644 --- a/builtin/describe.c +++ b/builtin/describe.c @@ -9,7 +9,7 @@ #include "hash.h" #include "argv-array.h" -#define SEEN (1u<<0) +#define SEEN (1u << 0) #define MAX_TAGS (FLAG_BITS - 1) static const char * const describe_usage[] = { @@ -36,7 +36,6 @@ static const char *diff_index_args[] = { "diff-index", "--quiet", "HEAD", "--", NULL }; - struct commit_name { struct commit_name *next; unsigned char peeled[20]; @@ -46,6 +45,7 @@ struct commit_name { unsigned char sha1[20]; char *path; }; + static const char *prio_names[] = { "head", "lightweight", "annotated", }; @@ -488,9 +488,8 @@ int cmd_describe(int argc, const char **argv, const char *prefix) } else if (dirty) { die(_("--dirty is incompatible with commit-ishes")); } else { - while (argc-- > 0) { + while (argc-- > 0) describe(*argv++, argc == 0); - } } return 0; } diff --git a/builtin/diff.c b/builtin/diff.c index 2fb8c5dc0b..adb93a9efa 100644 --- a/builtin/diff.c +++ b/builtin/diff.c @@ -169,7 +169,7 @@ static int builtin_diff_tree(struct rev_info *revs, if (ent1->item->flags & UNINTERESTING) swap = 1; sha1[swap] = ent0->item->sha1; - sha1[1-swap] = ent1->item->sha1; + sha1[1 - swap] = ent1->item->sha1; diff_tree_sha1(sha1[0], sha1[1], "", &revs->diffopt); log_tree_diff_flush(revs); return 0; diff --git a/builtin/merge.c b/builtin/merge.c index 02a69c14e6..41fb66dec2 100644 --- a/builtin/merge.c +++ b/builtin/merge.c @@ -186,13 +186,6 @@ static int option_parse_n(const struct option *opt, return 0; } -static int option_parse_ff_only(const struct option *opt, - const char *arg, int unset) -{ - fast_forward = FF_ONLY; - return 0; -} - static struct option builtin_merge_options[] = { { OPTION_CALLBACK, 'n', NULL, NULL, NULL, N_("do not show a diffstat at the end of the merge"), @@ -210,9 +203,9 @@ static struct option builtin_merge_options[] = { OPT_BOOL('e', "edit", &option_edit, N_("edit message before committing")), OPT_SET_INT(0, "ff", &fast_forward, N_("allow fast-forward (default)"), FF_ALLOW), - { OPTION_CALLBACK, 0, "ff-only", NULL, NULL, + { OPTION_SET_INT, 0, "ff-only", &fast_forward, NULL, N_("abort if fast-forward is not possible"), - PARSE_OPT_NOARG | PARSE_OPT_NONEG, option_parse_ff_only }, + PARSE_OPT_NOARG | PARSE_OPT_NONEG, NULL, FF_ONLY }, OPT_RERERE_AUTOUPDATE(&allow_rerere_auto), OPT_BOOL(0, "verify-signatures", &verify_signatures, N_("Verify that the named commit has a valid GPG signature")), |