git log History Simplification

History Simplification

A more detailed explanation follows.

Suppose you specified foo as the <paths>. We shall call commits that modify foo !TREESAME, and the rest TREESAME. (In a diff filtered for foo, they look different and equal, respectively.)

In the following, we will always refer to the same example history to illustrate the differences between simplification settings. We assume that you are filtering for a file foo in this commit graph:

	 /     /   /   /   /   /
	I     B   C   D   E   Y
	 \   /   /   /   /   /
	  `-------------'   X

The horizontal line of history A---Q is taken to be the first parent of each merge. The commits are:

  • I is the initial commit, in which foo exists with contents “asdf”, and a file quux exists with contents “quux”. Initial commits are compared to an empty tree, so I is !TREESAME.

  • In A, foo contains just “foo”.

  • B contains the same change as A. Its merge M is trivial and hence TREESAME to all parents.   M有兩個parent,分別是A和B,但是相對A和B而言,從文件內容來看,是沒有差異的

  • C does not change foo, but its merge N changes it to “foobar”, so it is not TREESAME to any parent.

  • D sets foo to “baz”. Its merge O combines the strings from N and D to “foobarbaz”; i.e., it is not TREESAME to any parent.

  • E changes quux to “xyzzy”, and its merge P combines the strings to “quux xyzzy”. P is TREESAME to O, but not to E.

  • X is an independent root commit that added a new file side, and Y modified it. Y is TREESAME to X. Its merge Q added side to P, and Q is TREESAME to P, but not to Y.

rev-list walks backwards through history, including or excluding commits based on whether --full-history and/or parent rewriting (via --parents or --children) are used. The following settings are available.


還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.