public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Nanako Shiraishi <nanako3@lavabit•com>
To: Junio C Hamano <gitster@pobox•com>
Cc: git@vger•kernel.org, Clemens Buchacher <drizzd@aon•at>,
	Bjorn Steinbrink <B.Steinbrink@gmx•de>,
	Daniel Barkalow <barkalow@iabervon•org>,
	Thomas Rast <trast@student•ethz.ch>
Subject: Re: [RFC/PATCH] git-merge: forbid fast-forward and up-to-date when --no-commit is given
Date: Thu, 22 Oct 2009 19:21:45 +0900	[thread overview]
Message-ID: <20091022192145.6117@nanako3.lavabit.com> (raw)
In-Reply-To: <7vpr8g1l2a.fsf_-_@alter.siamese.dyndns.org>

Quoting Junio C Hamano <gitster@pobox•com>

> Traditionally "git merge --no-commit" meant just that: do not create a new
> commit even when a merge succeeds.  But this leads to confusion when the
> merged commit is a descendant of the current commit, in which case we
> succeed the merge by fast-forwarding and without creating a new commit.
> Also when the merged commit is already a part of the history, we succeeded
> without doing anything.
>
> Error out when --no-commit is given but the merge would result in a
> fast-forward or an up-to-date.
>
> Signed-off-by: Junio C Hamano <gitster@pobox•com>
> ---
>
>  * This is the first alternative.  I think it makes more sense than the
>    other one, but I am unsure, as I obviously do not get confused when
>    --no-commit becomes no-op due to a fast-forward nor an up-to-date and
>    am rather happy with the current behaviour.

I think this is good (but I am saying this only from your 
description without understanding the updated code), but 
the change breaks --squash to merge a branch, doesn't it?

    % git checkout feature  # from your master branch
    % work; git commit; work; git commit
    % git checkout master  # go back to your master branch
    % git merge --squash feature

This is a useful way to clean up changes that were built
in small steps that turned out to be worth only a commit.

-- 
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/

  reply	other threads:[~2009-10-22 10:21 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-20 17:47 [RFC] pull/fetch rename Thomas Rast
2009-10-20 19:59 ` Wesley J. Landaker
2009-10-20 21:46   ` Junio C Hamano
2009-10-20 22:53     ` Thomas Rast
2009-10-20 23:11       ` Junio C Hamano
2009-10-21  2:01         ` Wesley J. Landaker
2009-10-20 23:16       ` Junio C Hamano
2009-10-20 21:42 ` Nanako Shiraishi
2009-10-20 22:41   ` Thomas Rast
2009-10-20 23:56 ` Daniel Barkalow
2009-10-21  3:06   ` Björn Steinbrink
2009-10-21  4:22     ` Daniel Barkalow
2009-10-21 11:57       ` Björn Steinbrink
2009-10-21 17:12         ` Daniel Barkalow
2009-10-21  6:22     ` Junio C Hamano
2009-10-21 17:19       ` Clemens Buchacher
2009-10-21 17:21       ` [PATCH] modernize fetch/merge/pull examples Clemens Buchacher
2009-10-21 21:38         ` Junio C Hamano
2009-10-21 21:41           ` [RFC/PATCH] git-merge: forbid fast-forward and up-to-date when --no-commit is given Junio C Hamano
2009-10-22 10:21             ` Nanako Shiraishi [this message]
2009-10-22 22:26               ` Junio C Hamano
2009-10-21 21:46           ` [PATCH] git-merge: imply --no-ff " Junio C Hamano
2009-10-22  6:35             ` Clemens Buchacher
2009-10-22  8:51         ` [PATCH] modernize fetch/merge/pull examples Thomas Rast
2009-10-22  9:48       ` [RFC] pull/fetch rename Thomas Rast
2009-10-21  6:30   ` Mike Hommey
2009-10-21  6:33     ` Junio C Hamano
2009-10-21  7:06       ` Mike Hommey
2009-10-21  7:22       ` Junio C Hamano
2009-10-21  7:45         ` Jeff King
2009-10-21  7:47           ` Jeff King
2009-10-24  6:30           ` Junio C Hamano

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=20091022192145.6117@nanako3.lavabit.com \
    --to=nanako3@lavabit$(echo .)com \
    --cc=B.Steinbrink@gmx$(echo .)de \
    --cc=barkalow@iabervon$(echo .)org \
    --cc=drizzd@aon$(echo .)at \
    --cc=git@vger$(echo .)kernel.org \
    --cc=gitster@pobox$(echo .)com \
    --cc=trast@student$(echo .)ethz.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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