Merge remote branch 'ko/master' into HEAD

* ko/master: (366 commits)
  Update draft release notes to 1.6.6 before merging topics for -rc1
  Makefile: do not clean arm directory
  Add a notice that only certain functions can print color escape codes
  builtin-apply.c: pay attention to -p<n> when determining the name
  gitworkflows: Consistently back-quote git commands
  Explicitly truncate bswap operand to uint32_t
  t1200: fix a timing dependent error
  Documentation: update descriptions of revision options related to '--bisect'
  Enable support for IPv6 on MinGW
  Refactor winsock initialization into a separate function
  t/gitweb-lib: Split HTTP response with non-GNU sed
  pack-objects: split implications of --all-progress from progress activation
  instaweb: restart server if already running
  prune-packed: only show progress when stderr is a tty
  remote-curl.c: fix rpc_out()
  Protect scripted Porcelains from GREP_OPTIONS insanity
  mergetool--lib: simplify guess_merge_tool()
  strbuf_add_wrapped_text(): skip over colour codes
  t4014-format-patch: do not assume 'test' is available as non-builtin
  Fix over-simplified documentation for 'git log -z'
  ...
This commit is contained in:
Junio C Hamano
2009-11-29 23:11:22 -08:00
320 changed files with 15900 additions and 2455 deletions

View File

@ -43,6 +43,7 @@ static const char * const builtin_merge_usage[] = {
static int show_diffstat = 1, option_log, squash;
static int option_commit = 1, allow_fast_forward = 1;
static int fast_forward_only;
static int allow_trivial = 1, have_message;
static struct strbuf merge_msg;
static struct commit_list *remoteheads;
@ -166,7 +167,9 @@ static struct option builtin_merge_options[] = {
OPT_BOOLEAN(0, "commit", &option_commit,
"perform a commit if the merge succeeds (default)"),
OPT_BOOLEAN(0, "ff", &allow_fast_forward,
"allow fast forward (default)"),
"allow fast-forward (default)"),
OPT_BOOLEAN(0, "ff-only", &fast_forward_only,
"abort if fast-forward is not possible"),
OPT_CALLBACK('s', "strategy", &use_strategies, "strategy",
"merge strategy to use", option_parse_strategy),
OPT_CALLBACK('m', "message", &merge_msg, "message",
@ -264,6 +267,7 @@ static void squash_message(void)
struct strbuf out = STRBUF_INIT;
struct commit_list *j;
int fd;
struct pretty_print_context ctx = {0};
printf("Squash commit -- not updating HEAD\n");
fd = open(git_path("SQUASH_MSG"), O_WRONLY | O_CREAT, 0666);
@ -285,13 +289,15 @@ static void squash_message(void)
if (prepare_revision_walk(&rev))
die("revision walk setup failed");
ctx.abbrev = rev.abbrev;
ctx.date_mode = rev.date_mode;
strbuf_addstr(&out, "Squashed commit of the following:\n");
while ((commit = get_revision(&rev)) != NULL) {
strbuf_addch(&out, '\n');
strbuf_addf(&out, "commit %s\n",
sha1_to_hex(commit->object.sha1));
pretty_print_commit(rev.commit_format, commit, &out, rev.abbrev,
NULL, NULL, rev.date_mode, 0);
pretty_print_commit(rev.commit_format, commit, &out, &ctx);
}
if (write(fd, out.buf, out.len) < 0)
die_errno("Writing SQUASH_MSG");
@ -840,7 +846,6 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
const char *best_strategy = NULL, *wt_strategy = NULL;
struct commit_list **remotes = &remoteheads;
setup_work_tree();
if (file_exists(git_path("MERGE_HEAD")))
die("You have not concluded your merge. (MERGE_HEAD exists)");
if (read_cache_unmerged())
@ -874,6 +879,9 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
option_commit = 0;
}
if (!allow_fast_forward && fast_forward_only)
die("You cannot combine --no-ff with --ff-only.");
if (!argc)
usage_with_options(builtin_merge_usage,
builtin_merge_options);
@ -1013,7 +1021,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
hex,
find_unique_abbrev(remoteheads->item->object.sha1,
DEFAULT_ABBREV));
strbuf_addstr(&msg, "Fast forward");
strbuf_addstr(&msg, "Fast-forward");
if (have_message)
strbuf_addstr(&msg,
" (no commit created; -m option ignored)");
@ -1031,16 +1039,16 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
} else if (!remoteheads->next && common->next)
;
/*
* We are not doing octopus and not fast forward. Need
* We are not doing octopus and not fast-forward. Need
* a real merge.
*/
else if (!remoteheads->next && !common->next && option_commit) {
/*
* We are not doing octopus, not fast forward, and have
* We are not doing octopus, not fast-forward, and have
* only one common.
*/
refresh_cache(REFRESH_QUIET);
if (allow_trivial) {
if (allow_trivial && !fast_forward_only) {
/* See if it is really trivial. */
git_committer_info(IDENT_ERROR_ON_NO_NAME);
printf("Trying really trivial in-index merge...\n");
@ -1079,6 +1087,9 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
}
}
if (fast_forward_only)
die("Not possible to fast-forward, aborting.");
/* We are going to make a new commit. */
git_committer_info(IDENT_ERROR_ON_NO_NAME);