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

Git makes a merge commit but as a normal (non-merge) commit

From
hIpPy <hippy2981@gmail.com>
Date
Aug 18, 2017, 22:35 UTC
Message-ID
<CAM_JFCzZWfyUiFVrYOztdJD8iSYvYUavbzKOX2bxDV0_hMz7Eg@mail.gmail.com>

While merging if I do certain actions then the merge commit is made with the merge message but as a normal (non-merge) commit.

Repro steps:
- Set GIT_MERGE_AUTOEDIT=yes (set other than "no") in .bashrc
- Make a merge commit with no conflicts.
  (external text editor shows the generated merge message)
- Focus on Git Bash and Ctrl-C.
- Commit (git commit).

Actual behavior: Git makes a normal (non-merge) commit (squash merge) but with the merge commit message.

It looks like a bug to me. This is very confusing later on as the repo topology would show that the branch is not merged in and there is not an easy way to find out when the merge was made.

Expected behavior: Git should stay in a MERGING state. The user can choose to either abort the merge or continue the merge (git merge --continue OR git commit).

This does not happen in case of conflicts (at least I'm not able to repro). I get a (master|MERGING) prompt till I resolve the conflicts and commit, which goes through correctly as a merge commit.

Environment: $ git version git version 2.14.0.windows.2 $ bash --version GNU bash, version 4.4.12(1)-release (x86_64-pc-msys)

Thanks, RM

Next: Michael J Gruber
Message 1 of 22 in “Git makes a merge commit but as a normal (non-merge) commit”
  1. hIpPyAug 18, 2017
  2. Michael J GruberAug 21, 2017
  3. merge: save merge state earlierMichael J Gruber, Aug 21, 2017
  4. 1/3 Documentation/git-merge: explain --continueMichael J Gruber, Aug 21, 2017
  5. Martin ÅgrenAug 21, 2017
  6. Michael J GruberAug 22, 2017
  7. Martin ÅgrenAug 22, 2017
  8. hIpPyAug 22, 2017
  9. Junio C HamanoAug 22, 2017
  10. 1/4 Documentation/git-merge: explain --continueMichael J Gruber, Aug 23, 2017
  11. 0/4 Keep merge during killsMichael J Gruber, Aug 23, 2017
  12. 2/4 merge: clarify call chainMichael J Gruber, Aug 23, 2017
  13. 3/4 merge: split write_merge_state in twoMichael J Gruber, Aug 23, 2017
  14. 4/4 merge: save merge state earlierMichael J Gruber, Aug 23, 2017
  15. Junio C HamanoAug 22, 2017
  16. 3/3 merge: save merge state earlierMichael J Gruber, Aug 21, 2017
  17. Junio C HamanoAug 22, 2017
  18. Michael J GruberAug 22, 2017
  19. Junio C HamanoAug 22, 2017
  20. 0/3 Keep merge during killsMichael J Gruber, Aug 21, 2017
  21. 2/3 merge: split write_merge_state in twoMichael J Gruber, Aug 21, 2017
  22. Junio C HamanoAug 22, 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.