All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Petr Baudis <pasky@suse.cz>
Cc: Christian MICHON <christian.michon@gmail.com>,
	git list <git@vger.kernel.org>
Subject: Re: [PATCH] git log -p -m: Document, honor --first-parent
Date: Tue, 09 Feb 2010 17:30:29 -0800	[thread overview]
Message-ID: <7vpr4dop1m.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <20100210011149.GR9553@machine.or.cz> (Petr Baudis's message of "Wed\, 10 Feb 2010 02\:11\:49 +0100")

Petr Baudis <pasky@suse.cz> writes:

> diff --git a/Documentation/git-log.txt b/Documentation/git-log.txt
> index 0e39bb6..a2a2d04 100644
> --- a/Documentation/git-log.txt
> +++ b/Documentation/git-log.txt
> @@ -118,6 +118,15 @@ git log master --not --remotes=*/master::
>  	Shows all commits that are in local master but not in any remote
>  	repository master branches.
>  
> +git log -p -m --first-parent::
> +
> +	Shows the history including change diffs, but only from the
> +	"main branch" perspective, skipping commits that come only from
> +	merges, and showing full diffs of changes introduced by the merges.
> +	This makes sense only when following a strict policy of merging all
> +	topic branches when staying on a single integration branch and
> +	making sure the merges are not fast-forwards.

I think the tone of the last three lines is too strong.

Why is it necessary to make a merge with a single commit side branch when
fast-forward would do?  And if the side branch is actually two or more
commits, it will show the broken-down changes in more detail, but the fact
that it was made on the "primary" history would also have some
significance (e.g. trivial and obvious fixes made directly on 'master',
other branches merged from topic after cooking).

It is Ok to elaborate on the "policy" issues in the Discussion section,
but otherwise, I would rather see you spend the same number of lines to
clarify "showing full diffs of changes introduced by the merges" a bit
better (e.g. it is unclear if you are showing diff from each parents or
just from the first parent).  Perhaps "s/introduced /& to the first-parent
ancestry /" may suffice.

> diff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt
> index 6e9baf8..d7d0dee 100644
> --- a/Documentation/rev-list-options.txt
> +++ b/Documentation/rev-list-options.txt
> @@ -108,8 +108,8 @@ options may be given. See linkgit:git-diff-files[1] for more options.
>  
>  -c::
>  
> -	This flag changes the way a merge commit is displayed.  It shows
> -	the differences from each of the parents to the merge result
> +	This flag forces the default way a merge commit is displayed.  It
> +	shows the differences from each of the parents to the merge result
>  	simultaneously instead of showing pairwise diff between a parent

Sorry, I don't understand this change; "forces the default?"  Any option
"forces" the command to behave differently.  At least the original is
understandable "Ah, without it it shows one way but with this it shows in
a different way", even though that does not carry much useful information
(i.e. what are the two ways?  ah, I need to read further down).

> diff --git a/log-tree.c b/log-tree.c
> index 27afcf6..fb990a1 100644
> --- a/log-tree.c
> +++ b/log-tree.c
> @@ -514,6 +514,14 @@ static int log_tree_diff(struct rev_info *opt, struct commit *commit, struct log
>  			return 0;
>  		else if (opt->combine_merges)
>  			return do_diff_combined(opt, commit);
> +		else if (opt->first_parent_only) {
> +			/* Generate merge log entry only for the first
> +			 * parent, showing summary diff of the others
> +			 * we merged _in_. */

Style?

Don't we use --cc as default for "show" (and possibly "log"---I don't
remember the details)?

> +			diff_tree_sha1(parents->item->object.sha1, sha1, "", &opt->diffopt);
> +			log_tree_diff_flush(opt);
> +			return !opt->loginfo;
> +		}

This needs some tests but I think it is a good first step in the right
direction.

Thanks.

  reply	other threads:[~2010-02-10  1:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-09 23:45 What should I do to display the diff of even a simple merge commit? Christian MICHON
2010-02-09 23:46 ` Christian MICHON
2010-02-09 23:57 ` Petr Baudis
2010-02-10  0:05   ` Junio C Hamano
2010-02-10  1:11     ` [PATCH] git log -p -m: Document, honor --first-parent Petr Baudis
2010-02-10  1:30       ` Junio C Hamano [this message]
2010-02-10  2:12         ` Petr Baudis
2010-02-10  3:23           ` Junio C Hamano
2010-02-10  0:07   ` What should I do to display the diff of even a simple merge commit? Christian MICHON

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vpr4dop1m.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=christian.michon@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=pasky@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.