Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-08-18 03:02:49 +0300
committerJunio C Hamano <gitster@pobox.com>2020-08-18 03:02:49 +0300
commiteca8c62a50e033ce6a4f4e065bb507ca3d98e75c (patch)
treef36173d168e17cd1ac0ce95daa3c7351db14260e /builtin/log.c
parente6ec620d8b2d576908889476eb7da716d2e4bda2 (diff)
parent5fbb4bc1910f76b344fcb88df2544701b6030435 (diff)
Merge branch 'jk/log-fp-implies-m'
"git log --first-parent -p" showed patches only for single-parent commits on the first-parent chain; the "--first-parent" option has been made to imply "-m". Use "--no-diff-merges" to restore the previous behaviour to omit patches for merge commits. * jk/log-fp-implies-m: doc/git-log: clarify handling of merge commit diffs doc/git-log: move "-t" into diff-options list doc/git-log: drop "-r" diff option doc/git-log: move "Diff Formatting" from rev-list-options log: enable "-m" automatically with "--first-parent" revision: add "--no-diff-merges" option to counteract "-m" log: drop "--cc implies -m" logic
Diffstat (limited to 'builtin/log.c')
-rw-r--r--builtin/log.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/builtin/log.c b/builtin/log.c
index 33528fefa9d..b58f8da09ef 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -599,8 +599,8 @@ static int show_tree_object(const struct object_id *oid,
static void show_setup_revisions_tweak(struct rev_info *rev,
struct setup_revision_opt *opt)
{
- if (rev->ignore_merges) {
- /* There was no "-m" on the command line */
+ if (rev->ignore_merges < 0) {
+ /* There was no "-m" variant on the command line */
rev->ignore_merges = 0;
if (!rev->first_parent_only && !rev->combine_merges) {
/* No "--first-parent", "-c", or "--cc" */
@@ -732,8 +732,7 @@ static void log_setup_revisions_tweak(struct rev_info *rev,
if (!rev->diffopt.output_format && rev->combine_merges)
rev->diffopt.output_format = DIFF_FORMAT_PATCH;
- /* Turn -m on when --cc/-c was given */
- if (rev->combine_merges)
+ if (rev->first_parent_only && rev->ignore_merges < 0)
rev->ignore_merges = 0;
}