开发者

What does MM stand for in git show --raw output for merge commits?

开发者 https://www.devze.com 2023-02-20 15:46 出处:网络
I\'m looking at output of git show --numstat --shortstat --raw --pretty=medium -p command and see that for merge commits output differs. This is what I\'m getting:

I'm looking at output of git show --numstat --shortstat --raw --pretty=medium -p command and see that for merge commits output differs. This is what I'm getting:

commit cec68e2b00d86357c18b576cbaed52cc1ea42a74
Merge: b2ea79c e4900df
Author: jeresig <jeresig@gmail.com>
Date:   Thu Dec 9 12:44:30 2010 -0500

    Merge branch 'bug5566' of https://github.com/csnover/j开发者_StackOverflow中文版query into csnover-bug5566

16      16      src/manipulation.js
76      56      test/unit/manipulation.js
::100644 100644 100644 e09dd7e... c592b7a... 8d951b6... MM      src/manipulation.js
::100644 100644 100644 4805016... 8ee3688... 23ed898... MM      test/unit/manipulation.js

Why there's no diff information and what does MM stand for? I haven't seen this modifier before.


There's no diff information because --raw suppresses that output. (Admittedly this is non-obvious from the documentation.)

The "raw" output is documented in the git diff-tree man page, in the sections Raw Output Format and diff Format for Merges. There are two Ms in your example because it's a merge commit with two parents. To look at this example in more detail:

::100644 100644 100644 e09dd7e... c592b7a... 8d951b6... MM src/manipulation.js

... the three file modes (100644 100644 100644) give you the file mode in the first parent, the second parent and this commit. Similarly, the next three fields (e09dd7e... c592b7a... 8d951b6..) give you the object names of the blob that represents that file's content in the first parent, the second parent and the merge commit. The MM is then two "score" fields, telling you that this file was modified with respect to parent 1 and also modified with respect to parent 2.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号