summaryrefslogtreecommitdiff
path: root/builtin/log.c
diff options
context:
space:
mode:
authorDenton Liu <liu.denton@gmail.com>2019-12-04 21:25:06 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-12-05 14:06:18 (GMT)
commit945dc55dda595a3e5449017797cb90599ed9ecb5 (patch)
tree98a75cac402c9a059823b6bf19fd75aa0c7b6f78 /builtin/log.c
parent700e006c5d69990fc1167355e9fa7a55e9166581 (diff)
downloadgit-945dc55dda595a3e5449017797cb90599ed9ecb5.zip
git-945dc55dda595a3e5449017797cb90599ed9ecb5.tar.gz
git-945dc55dda595a3e5449017797cb90599ed9ecb5.tar.bz2
format-patch: teach --no-base
If `format.useAutoBase = true`, there was no way to override this from the command-line. Teach the `--no-base` option in format-patch to override `format.useAutoBase`. Helped-by: René Scharfe <l.s.r@web.de> Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/log.c')
-rw-r--r--builtin/log.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/builtin/log.c b/builtin/log.c
index 9c44682..bf904e8 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -1406,7 +1406,7 @@ static struct commit *get_base_commit(const char *base_commit,
base = lookup_commit_reference_by_name(base_commit);
if (!base)
die(_("unknown commit %s"), base_commit);
- } else if ((base_commit && !strcmp(base_commit, "auto")) || base_auto) {
+ } else if ((base_commit && !strcmp(base_commit, "auto"))) {
struct branch *curr_branch = branch_get(NULL);
const char *upstream = branch_get_upstream(curr_branch, NULL);
if (upstream) {
@@ -1710,6 +1710,9 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
s_r_opt.def = "HEAD";
s_r_opt.revarg_opt = REVARG_COMMITTISH;
+ if (base_auto)
+ base_commit = "auto";
+
if (default_attach) {
rev.mime_boundary = default_attach;
rev.no_inline = 1;
@@ -1973,7 +1976,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
}
memset(&bases, 0, sizeof(bases));
- if (base_commit || base_auto) {
+ if (base_commit) {
struct commit *base = get_base_commit(base_commit, list, nr);
reset_revision_walk();
clear_object_flags(UNINTERESTING);