Git log history simplification, elaborations example in git log's manual

白昼怎懂夜的黑 提交于 2019-12-24 15:33:18

问题


All of you comfortable with example and elaborations in git log's help for history simplification? I encounter some burdens on understanding when using this help/manual and the named example.

  .-A---M---N---O---P---Q
 /     /   /   /   /   /
I     B   C   D   E   Y
 \   /   /   /   /   /
  `-------------'   X
  • I is the initial commit... foo exists with contents “asdf”, and a file quux exists with contents “quux”....
  • In A, foo contains just “foo”...
  • B contains the same change as A...
  • C does not change foo, but its merge N changes it to “foobar”...
  • P is TREESAME to O...
  • The sense of a merge with a change not present in any of its parents included? See merge's N description in git log's help
  • The file's quux undergoes some modifications on the transition from O to merge P, why do the elaborations in help qualify P as treesame against O?

It looks like the terms TREESAME and !TREESAME are to be seen in scope of a single file/directory. Not to be used to express commit property for multiple files. Is this true?


回答1:


The TREESAME expressions in the description are applied to the trees of each commit (pairwise as they are being compared) after doing any file-specific filtering from your git log command. For instance:

git log --simplify-merges

compares every file in each tree to decide whether two commit trees are "the same", while:

git log --simplify-merges -- README

compares only the README file in each tree, and:

git log --simplify-merges -- README dir1 dir2

leaves README and any files within the two directories in the tree before comparing the trees.



来源:https://stackoverflow.com/questions/35133762/git-log-history-simplification-elaborations-example-in-git-logs-manual

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!