# git-merge --no-commit commits

4 messages from 2007-12-02 to 2007-12-02. Participants: Vegard Nossum, Jakub Narebski.
Thread: https://gitlist.dev/t/11098

## Vegard Nossum, 2007-12-02 16:57

Subject: git-merge --no-commit commits
Message-ID: <19f34abd0712020857m757c57cfr358a81e47f38fac8@mail.gmail.com>
URL: https://gitlist.dev/e/19f34abd0712020857m757c57cfr358a81e47f38fac8%40mail.gmail.com

```
Hi,

I am using git 1.5.3.4 and just did the following (v1 and v2 are
branches; v1 is a parent of v2):

git checkout v1
git merge --no-commit v2

It simply fast-forwarded AND committed even though I explicitly told
it not to. What gives?

Kind regards,
Vegard Nossum

```

## Jakub Narebski, 2007-12-02 17:10

Subject: Re: git-merge --no-commit commits
Message-ID: <m3bq99vx7t.fsf@roke.D-201>
URL: https://gitlist.dev/e/m3bq99vx7t.fsf%40roke.D-201
In-Reply-To: <19f34abd0712020857m757c57cfr358a81e47f38fac8@mail.gmail.com>

```
"Vegard Nossum" <vegard.nossum@gmail.com> writes:

> I am using git 1.5.3.4 and just did the following (v1 and v2 are
> branches; v1 is a parent of v2):
> 
> git checkout v1
> git merge --no-commit v2
> 
> It simply fast-forwarded AND committed even though I explicitly told
> it not to. What gives?

The --no-commit option doesn't prevent fast-forward because
fast-forward doesn't really _create_ a commit (and -no-commit is
really about commit creation). It just advanced ref (branch head).

You probably wanted to use

  $ git merge --no-commit --no-ff v2

HTH
-- 
Jakub Narebski
ShadeHawk on #git
Poland

```

## Vegard Nossum, 2007-12-02 17:18

Subject: Re: git-merge --no-commit commits
Message-ID: <19f34abd0712020918w1640389kb0ca006b2051a678@mail.gmail.com>
URL: https://gitlist.dev/e/19f34abd0712020918w1640389kb0ca006b2051a678%40mail.gmail.com
In-Reply-To: <m3bq99vx7t.fsf@roke.D-201>

```
On Dec 2, 2007 6:10 PM, Jakub Narebski <jnareb@gmail.com> wrote:
> "Vegard Nossum" <vegard.nossum@gmail.com> writes:
>
> > I am using git 1.5.3.4 and just did the following (v1 and v2 are
> > branches; v1 is a parent of v2):
> >
> > git checkout v1
> > git merge --no-commit v2
> >
> > It simply fast-forwarded AND committed even though I explicitly told
> > it not to. What gives?
>
> The --no-commit option doesn't prevent fast-forward because
> fast-forward doesn't really _create_ a commit (and -no-commit is
> really about commit creation). It just advanced ref (branch head).
>
> You probably wanted to use
>
>   $ git merge --no-commit --no-ff v2
>

Yes. Thanks. Isn't that counter-intuitive, though? The manpage says
that it lets you review the changes first. I assumed this would
include fast-forwarding as well. There is no --no-ff in my git-merge
manpage. Maybe I need a newer version?

> HTH
> --
> Jakub Narebski
> ShadeHawk on #git
> Poland
>

Vegard

```

## Jakub Narebski, 2007-12-02 18:00

Subject: Re: git-merge --no-commit commits
Message-ID: <200712021900.10295.jnareb@gmail.com>
URL: https://gitlist.dev/e/200712021900.10295.jnareb%40gmail.com
In-Reply-To: <19f34abd0712020918w1640389kb0ca006b2051a678@mail.gmail.com>

```
On Sun, 2 Dec 2007, Vegard Nossum wrote:
> On Dec 2, 2007 6:10 PM, Jakub Narebski <jnareb@gmail.com> wrote:
>> "Vegard Nossum" <vegard.nossum@gmail.com> writes:
>>
>>> I am using git 1.5.3.4 and just did the following (v1 and v2 are
>>> branches; v1 is a parent of v2):
>>>
>>> git checkout v1
>>> git merge --no-commit v2
>>>
>>> It simply fast-forwarded AND committed even though I explicitly told
>>> it not to. What gives?
>>
>> The --no-commit option doesn't prevent fast-forward because
>> fast-forward doesn't really _create_ a commit (and -no-commit is
>> really about commit creation). It just advanced ref (branch head).
>>
>> You probably wanted to use
>>
>>   $ git merge --no-commit --no-ff v2
> 
> Yes. Thanks. Isn't that counter-intuitive, though? The manpage says
> that it lets you review the changes first. I assumed this would
> include fast-forwarding as well. 

But for fast-forward there are no "changes" to review. Just updating
branch head. Fast-forward means no new commit.

> There is no --no-ff in my git-merge 
> manpage. Maybe I need a newer version?

It looks like it is not in any released version. I've found description
in 'master' version of Documentation/merge-options.txt
-- 
Jakub Narebski
Poland

```
