git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* --no-commit option does not work.
       [not found] <CY4PR14MB1238A8AC2BFECB56B9B68056CB300@CY4PR14MB1238.namprd14.prod.outlook.com>
@ 2017-03-26 23:57 ` BongHo Lee
  2017-03-27  5:44   ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: BongHo Lee @ 2017-03-26 23:57 UTC (permalink / raw)
  To: git@vger.kernel.org

Setup
Version : git version 2.12.1.windows.1

OS Version : Microsoft Windows [Version 10.0.14393]

Options 
$ cat /etc/install-options.txt
Path Option: Cmd
SSH Option: OpenSSH
CURL Option: OpenSSL
CRLF Option: CRLFCommitAsIs
Bash Terminal Option: MinTTY
Performance Tweaks FSCache: Enabled
Use Credential Manager: Enabled
Enable Symlinks: Disabled


Git Command : git merge --no-commit origin/workingBranch

. What did you expect to occur after running these commands?
merge but no commit.
. What actually happened instead?
commited

Reference URL : https://github.com/techcap/nf-interpreter

Details
I tried to merge from MergeTest to master.
After checking out master, I run below command.

C:\work\nf-interpreter-techcap>git branch
  MergeTest
  TemplateModification
  UpdateBuildInstruction
* master

C:\work\nf-interpreter-techcap>git merge --no-commit origin/MergeTest
Updating 197ad33..028f9f5
Fast-forward
mergeTest.txt | 1 +
1 file changed, 1 insertion(+)
create mode 100644 mergeTest.txt

C:\work\nf-interpreter-techcap>git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)
nothing to commit, working tree clean

If I add --no-ff option, it works properly.
I think --no-commit option should be worked without --no-ff.

https://github.com/git-for-windows/git/issues/1102#issuecomment-289206961

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: --no-commit option does not work.
  2017-03-26 23:57 ` --no-commit option does not work BongHo Lee
@ 2017-03-27  5:44   ` Junio C Hamano
  0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2017-03-27  5:44 UTC (permalink / raw)
  To: BongHo Lee; +Cc: git@vger.kernel.org

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.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-27  5:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CY4PR14MB1238A8AC2BFECB56B9B68056CB300@CY4PR14MB1238.namprd14.prod.outlook.com>
2017-03-26 23:57 ` --no-commit option does not work BongHo Lee
2017-03-27  5:44   ` Junio C Hamano

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).