All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: "Björn Steinbrink" <B.Steinbrink@gmx.de>
Cc: Richard Lee <richard@webdezign.co.uk>, git@vger.kernel.org
Subject: Re: Preserving branches after merging on ancestor
Date: Thu, 5 Nov 2009 23:03:53 -0600	[thread overview]
Message-ID: <20091106050353.GA8824@progeny.tock> (raw)
In-Reply-To: <20091106021038.GA27206@atjola.homenet>

Björn Steinbrink wrote:

> For example in git.git, I can do "git log --first-parent
> ..origin/master" to get a high-level log of what happened. And then I
> might see commit b7eb912b0, which is "Merge branch ja/fetch-doc". So I
> know "OK, there were some doc updates", without having to crawl through
> the individual commits.

Yep, fast-forward merges do ruin the --first-parent log.  Thanks for
the reminder.

>> Of course, these things are a matter of taste.  I just wanted to
>> explain why a fast-forward could at least sometimes be the right
>> result from merging a topic branch (and why, in practice, some people
>> never end up needing to use --no-ff).
> 
> Sure, fast-forwards can be the right thing, e.g. when you have a
> (possibly useless) branch head "master" that you update by pulling. In
> such a case merge commits would only lead to useless clutter.

I hope this use case becomes less important as git’s UI improves.  To
track unmodified upstream sources, a simple 'git checkout' to get
up-to-date is much simpler, except that "git branch" does not display
the current branch any more.  Using 'git pull' for the daily update
makes for a distractingly merge-heavy history once one has commits of
one’s own.

A similar use case won’t disappear: asking someone else to resolve a
merge for you and pulling the result.

For both these tasks, --ff-only might give better behavior.

In other cases, I would guess some people would always want --no-ff
and others never.  Apparently, there is a configuration option to
support this: add a line "mergeoptions = --no-ff" (or "mergeoptions =
--ff") to a [branch "master"] section in .git/config or ~/.gitconfig.

> But
> Richard wants to see where topic branches got merged (to be still able
> to see what got merged in the future), and yeah, that's a matter of
> taste. But you argued that using --no-ff would "[miss] some of the main
> benefits of feature branches", which is simply not true.

I spoke imprecisely; I should have said that if most merges are
candidates for fast-forwarding, this suggests feature branches are not
being used in the best way, and --no-ff just makes that situation more
tolerable.

Then your response pushed me towards the question of whether --no-ff
is a good idea in general, and I got distracted. :)  Sorry for the
confusion, and thanks for the insights.

Regards,
Jonathan

  reply	other threads:[~2009-11-06  4:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-05 18:30 Preserving branches after merging on ancestor Richard Lee
2009-11-05 18:38 ` Eric Raible
2009-11-05 22:30 ` Jonathan Nieder
2009-11-05 23:28   ` Björn Steinbrink
2009-11-06  1:09     ` Jonathan Nieder
2009-11-06  2:10       ` Björn Steinbrink
2009-11-06  5:03         ` Jonathan Nieder [this message]
2009-11-06 15:21           ` rhlee
2009-11-06 22:52             ` Jonathan Nieder
2009-11-07  3:41             ` Dilip M
2009-11-07 13:31               ` Björn Steinbrink
2009-11-07 13:28             ` Björn Steinbrink

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=20091106050353.GA8824@progeny.tock \
    --to=jrnieder@gmail.com \
    --cc=B.Steinbrink@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=richard@webdezign.co.uk \
    /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.