git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git-merge --no-commit commits

From
Jakub Narebski <jnareb@gmail.com>
Date
Dec 2, 2007, 18:00 UTC
Message-ID
<200712021900.10295.jnareb@gmail.com>
In-Reply-To
<19f34abd0712020918w1640389kb0ca006b2051a678@mail.gmail.com>
On Sun, 2 Dec 2007, Vegard Nossum wrote:
Show 23 quoted lines
> 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
Previous: Vegard Nossum
Message 4 of 4 in “git-merge --no-commit commits”
  1. Vegard NossumDec 2, 2007
  2. Jakub NarebskiDec 2, 2007
  3. Vegard NossumDec 2, 2007
  4. Jakub NarebskiDec 2, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.