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
This commit is contained in:
Junio C Hamano 2013-11-06 14:34:43 -08:00
commit 152a9c17a8
16 changed files with 30 additions and 41 deletions

View file

@ -42,6 +42,8 @@ Assume the following history exists and the current branch is
A---B---C master on origin
/
D---E---F---G master
^
origin/master in your repository
------------
Then "`git pull`" will fetch and replay the changes from the remote
@ -51,7 +53,7 @@ result in a new commit along with the names of the two parent commits
and a log message from the user describing the changes.
------------
A---B---C remotes/origin/master
A---B---C origin/master
/ \
D---E---F---G---H master
------------

View file

@ -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);

View file

@ -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;
}

View file

@ -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")),

View file

@ -2987,7 +2987,7 @@ static struct commit *get_revision_internal(struct rev_info *revs)
if (revs->max_count) {
c = get_revision_1(revs);
if (c) {
while (0 < revs->skip_count) {
while (revs->skip_count > 0) {
revs->skip_count--;
c = get_revision_1(revs);
if (!c)
@ -3002,9 +3002,8 @@ static struct commit *get_revision_internal(struct rev_info *revs)
if (c)
c->object.flags |= SHOWN;
if (!revs->boundary) {
if (!revs->boundary)
return c;
}
if (!c) {
/*
@ -3050,9 +3049,8 @@ struct commit *get_revision(struct rev_info *revs)
if (revs->reverse) {
reversed = NULL;
while ((c = get_revision_internal(revs))) {
while ((c = get_revision_internal(revs)))
commit_list_insert(c, &reversed);
}
revs->commits = reversed;
revs->reverse = 0;
revs->reverse_output_stage = 1;

View file

@ -5,6 +5,7 @@
#include "grep.h"
#include "notes.h"
#include "commit.h"
#include "diff.h"
#define SEEN (1u<<0)
#define UNINTERESTING (1u<<1)

View file

@ -406,13 +406,12 @@ int start_command(struct child_process *cmd)
unsetenv(*cmd->env);
}
}
if (cmd->git_cmd) {
if (cmd->git_cmd)
execv_git_cmd(cmd->argv);
} else if (cmd->use_shell) {
else if (cmd->use_shell)
execv_shell_cmd(cmd->argv);
} else {
else
sane_execvp(cmd->argv[0], (char *const*) cmd->argv);
}
if (errno == ENOENT) {
if (!cmd->silent_exec_failure)
error("cannot run %s: %s", cmd->argv[0],
@ -446,7 +445,6 @@ int start_command(struct child_process *cmd)
cmd->pid = -1;
}
close(notify_pipe[0]);
}
#else
{
@ -480,11 +478,10 @@ int start_command(struct child_process *cmd)
if (cmd->env)
env = make_augmented_environ(cmd->env);
if (cmd->git_cmd) {
if (cmd->git_cmd)
cmd->argv = prepare_git_cmd(cmd->argv);
} else if (cmd->use_shell) {
else if (cmd->use_shell)
cmd->argv = prepare_shell_cmd(cmd->argv);
}
cmd->pid = mingw_spawnvpe(cmd->argv[0], cmd->argv, env, cmd->dir,
fhin, fhout, fherr);

View file

@ -343,7 +343,6 @@ static int get_short_sha1(const char *name, int len, unsigned char *sha1,
return status;
}
int for_each_abbrev(const char *prefix, each_abbrev_fn fn, void *cb_data)
{
char hex_pfx[40];

View file

@ -92,7 +92,7 @@ test_expect_success 'blame 2 authors + 1 branch2 author' '
'
test_expect_success 'merge branch1 & branch2' '
git pull . branch1
git merge branch1
'
test_expect_success 'blame 2 authors + 2 merged-in authors' '

View file

@ -172,7 +172,7 @@ test_expect_success 'first postimage wins' '
git show second^:a1 | sed "s/To die: t/To die! T/" >a1 &&
git commit -q -a -m third &&
test_must_fail git pull . first &&
test_must_fail git merge first &&
# rerere kicked in
! grep "^=======\$" a1 &&
test_cmp expect a1

View file

@ -62,7 +62,7 @@ test_expect_success 'setup git mirror and merge' '
echo friend > README &&
cat tmp >> README &&
git commit -a -m "friend" &&
git pull . merge
git merge merge
'
test_debug 'gitk --all & sleep 1'

View file

@ -328,7 +328,7 @@ test_expect_success \
git add b &&
git commit -a -m "On branch" &&
git checkout master &&
git pull . b &&
git merge b &&
git tag merge_commit'
test_expect_success \

View file

@ -269,6 +269,7 @@ static const char *unsupported_options[] = {
TRANS_OPT_THIN,
TRANS_OPT_KEEP
};
static const char *boolean_options[] = {
TRANS_OPT_THIN,
TRANS_OPT_KEEP,