From: Junio C Hamano Date: Mon, 1 Oct 2012 19:58:51 +0000 (-0700) Subject: Merge branch 'os/commit-submodule-ignore' X-Git-Tag: v1.8.0-rc0~4 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=69759917aa4b1efb5bf198e76c3664bed9c70d4d;p=git.git Merge branch 'os/commit-submodule-ignore' "git status" honored the ignore=dirty settings in .gitmodules but "git commit" didn't. * os/commit-submodule-ignore: commit: pay attention to submodule.$name.ignore in .gitmodules --- 69759917aa4b1efb5bf198e76c3664bed9c70d4d diff --cc builtin/commit.c index 4d5048483,3cb1ef73a..a17a5df44 --- a/builtin/commit.c +++ b/builtin/commit.c @@@ -1412,30 -1253,24 +1412,31 @@@ int cmd_commit(int argc, const char **a struct commit_list *parents = NULL, **pptr = &parents; struct stat statbuf; int allow_fast_forward = 1; - struct wt_status s; + struct commit *current_head = NULL; + struct commit_extra_header *extra = NULL; + + if (argc == 2 && !strcmp(argv[1], "-h")) + usage_with_options(builtin_commit_usage, builtin_commit_options); wt_status_prepare(&s); + gitmodules_config(); git_config(git_commit_config, &s); - in_merge = file_exists(git_path("MERGE_HEAD")); - s.in_merge = in_merge; - - if (s.use_color == -1) - s.use_color = git_use_color_default; - argc = parse_and_validate_options(argc, argv, builtin_commit_usage, - prefix, &s); - if (dry_run) { - if (diff_use_color_default == -1) - diff_use_color_default = git_use_color_default; - return dry_run_commit(argc, argv, prefix, &s); + determine_whence(&s); + s.colopts = 0; + + if (get_sha1("HEAD", sha1)) + current_head = NULL; + else { + current_head = lookup_commit_or_die(sha1, "HEAD"); + if (!current_head || parse_commit(current_head)) + die(_("could not parse HEAD commit")); } - index_file = prepare_index(argc, argv, prefix, 0); + argc = parse_and_validate_options(argc, argv, builtin_commit_options, + builtin_commit_usage, + prefix, current_head, &s); + if (dry_run) + return dry_run_commit(argc, argv, prefix, current_head, &s); + index_file = prepare_index(argc, argv, prefix, current_head, 0); /* Set up everything for writing the commit object. This includes running hooks, writing the trees, and interacting with the user. */