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

Re: --no-commit option does not work.

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 27, 2017, 05:44 UTC
Message-ID
<xmqqfuhz2s0a.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<CY4PR14MB1238D2E5D35E99405AA8BF61CB300@CY4PR14MB1238.namprd14.prod.outlook.com>
BongHo Lee <techcap@live.com> writes:
> If I add --no-ff option, it works properly.
> I think --no-commit option should be worked without --no-ff.

It is understandable that this is confusing, but --no-commit is an instruction not to create a new commit object. As fast-forwarding to the commit that is a strict descendant of your old tip does not involve creation of any new commit, the command is working exactly as instructed. If you say "--no-ff", you are explicitly forbidding the command to fast-forward, so the command attempts to create a (needless) new commit that is a merge, and then --no-commit stops the command after it prepared the tree state ready to be committed.

So with or without --no-ff, the option and the command are working correctly.

Having said all that, my gut feeling is that a backward incompatible change to make --no-commit "imply" --no-ff may not hurt too many existing users, but I am saying this without thinking things through. I may very well be missing a valid use case where --no-commit that does not fail but does fast-forward when the user does not give --no-ff is useful, so if that is the case, such a change will be breaking those users.

Previous: BongHo Lee
Message 2 of 2 in “--no-commit option does not work.”
  1. BongHo LeeMar 26, 2017
  2. Junio C HamanoMar 27, 2017

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.