git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Sverre Hvammen Johansen" <hvammen@gmail.com>
To: "Junio C Hamano" <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [RFC/PATCH 3/4] Head reduction before selecting merge strategy
Date: Wed, 26 Mar 2008 20:10:19 -0700	[thread overview]
Message-ID: <402c10cd0803262010x4d707de0h3e5b6b28b5ecaf12@mail.gmail.com> (raw)
In-Reply-To: <7vlk45e9xn.fsf@gitster.siamese.dyndns.org>

On Wed, Mar 26, 2008 at 9:17 AM, Junio C Hamano <gitster@pobox.com> wrote:
>  In 3/4 you defined "real parents" as "the commits specified to be merged
>  from the command line", and you are picking only the independent ones out
>  of "real parents" to change the set of parents used for the merge
>  operation.  What is the reduced set called?

I was not happy about the split.  2/4 does not make much sense until
you read 3/4, and when you read 3/4 you are confused by 2/4.  Is it OK
that I squash these together again?

>  I think "real" vs "actual" is an invitation for "which is which"
>  confusion.  How about calling them "given" vs "reduced"?

Agree.  But reduced may not be reduced if --ff=never is specified.

>  Anyway, "the commit log message talks about the commits specified by the
>  end user, but the command outsmarts the user and does something different".

This is also the current behavior of git and I don't think anyone have
complained about it until now that we realize how git is actually
doing this.  We want the history to be as simple as possible when
presented in gitk, but the commit message should record what the user
asked for.   The commit message is used for later refferense.  The
commit message will usually only contain branch names which may or may
not make sense when we later look back the history.  That two branches
happen to point to the same commit or one is a fast forward of the
other is just a coincident.  I believe this is how most users want it
and I don't intend to change the log message.

>  > +... The
>
> > +real parents (only including `HEAD` if it is real) are the parents
>  > +recorded in the merge commit object.
>
>  Specifically, "does something different" above is "does not record some of
>  the commits given by the end user as parent commit of the resulting
>  merge".  Hence the name of the operation: "head reduction".
>
>  While I suspect that it would make sense to simplify parents, I do not
>  see why the seemingly deliberate discrepancy between what is recorded as
>  the parents (i.e. "reduced parents" on "parent " lines of the resulting
>  merge) and what the log message talks about (i.e. "given parents" you feed
>  to fmt-merge-msg) is a good idea.  Isn't it more consistent and easier to
>  explain to the users if they match?  Also it might be arguable that this
>  head reduction should be an optional feature.

If you use --ff=never it is turned off.

>  I suspect this would be a _very_ unexpected behaviour to untrained eyes
>  and would be a source of confusion.  You were on 'master' and merged many
>  things into it, but the resulting commit does not have 'master' as its
>  first parent.  So far, ORIG_HEAD would always have matched HEAD^1 unless
>  you fast-forwarded.  This alone may be a reason enough that this behaviour
>  can never be the default.

I am not sure we need to explain this in the manual.  What do you think?

This behavior is also the current behavior of git.  I don't think we
should care.  When we fast-forward, HEAD^1 may not match ORIG_HEAD
anyway.

-- 
Sverre Hvammen Johansen

      reply	other threads:[~2008-03-27  3:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-26  3:58 [RFC/PATCH 3/4] Head reduction before selecting merge strategy Sverre Hvammen Johansen
2008-03-26 12:50 ` Jakub Narebski
2008-03-26 16:17 ` Junio C Hamano
2008-03-27  3:10   ` Sverre Hvammen Johansen [this message]

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=402c10cd0803262010x4d707de0h3e5b6b28b5ecaf12@mail.gmail.com \
    --to=hvammen@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).