Merge branch 'nd/config-split'
Split the overly large Documentation/config.txt file into million little pieces. This potentially allows each individual piece included into the manual page of the command it affects more easily. * nd/config-split: (81 commits) config.txt: remove config/dummy.txt config.txt: move worktree.* to a separate file config.txt: move web.* to a separate file config.txt: move versionsort.* to a separate file config.txt: move user.* to a separate file config.txt: move url.* to a separate file config.txt: move uploadpack.* to a separate file config.txt: move uploadarchive.* to a separate file config.txt: move transfer.* to a separate file config.txt: move tag.* to a separate file config.txt: move submodule.* to a separate file config.txt: move stash.* to a separate file config.txt: move status.* to a separate file config.txt: move splitIndex.* to a separate file config.txt: move showBranch.* to a separate file config.txt: move sequencer.* to a separate file config.txt: move sendemail-config.txt to config/ config.txt: move reset.* to a separate file config.txt: move rerere.* to a separate file config.txt: move repack.* to a separate file ...
This commit is contained in:
@ -25,6 +25,8 @@
|
||||
#include "submodule.h"
|
||||
#include "submodule-config.h"
|
||||
|
||||
#define REFRESH_INDEX_DELAY_WARNING_IN_MS (2 * 1000)
|
||||
|
||||
static const char * const git_reset_usage[] = {
|
||||
N_("git reset [--mixed | --soft | --hard | --merge | --keep] [-q] [<commit>]"),
|
||||
N_("git reset [-q] [<tree-ish>] [--] <paths>..."),
|
||||
@ -307,6 +309,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
|
||||
};
|
||||
|
||||
git_config(git_reset_config, NULL);
|
||||
git_config_get_bool("reset.quiet", &quiet);
|
||||
|
||||
argc = parse_options(argc, argv, prefix, options, git_reset_usage,
|
||||
PARSE_OPT_KEEP_DASHDASH);
|
||||
@ -376,9 +379,19 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
|
||||
int flags = quiet ? REFRESH_QUIET : REFRESH_IN_PORCELAIN;
|
||||
if (read_from_tree(&pathspec, &oid, intent_to_add))
|
||||
return 1;
|
||||
if (get_git_work_tree())
|
||||
if (!quiet && get_git_work_tree()) {
|
||||
uint64_t t_begin, t_delta_in_ms;
|
||||
|
||||
t_begin = getnanotime();
|
||||
refresh_index(&the_index, flags, NULL, NULL,
|
||||
_("Unstaged changes after reset:"));
|
||||
t_delta_in_ms = (getnanotime() - t_begin) / 1000000;
|
||||
if (advice_reset_quiet_warning && t_delta_in_ms > REFRESH_INDEX_DELAY_WARNING_IN_MS) {
|
||||
printf(_("\nIt took %.2f seconds to enumerate unstaged changes after reset. You can\n"
|
||||
"use '--quiet' to avoid this. Set the config setting reset.quiet to true\n"
|
||||
"to make this the default.\n"), t_delta_in_ms / 1000.0);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
int err = reset_index(&oid, reset_type, quiet);
|
||||
if (reset_type == KEEP && !err)
|
||||
|
Reference in New Issue
Block a user