Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.6k views
in Technique[技术] by (71.8m points)

Git log graph differs in IntelliJ and VSCode

Below are the snips of the same repository and same branch (master_mt).
If we consider Merge branch 'hotfix-v3.0.3' into master_mt commit, we see,
VS code snip shows the commit on the correct branch (ie blue color).
But IntelliJ doesn't show it correctly, ideally, it should show the same on the magenta line.

Is there anything I am missing while reading the graph on IntelliJ?

vscode

intellij


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

But IntelliJ doesn't show it correctly,

Yes it does.

Is there anything I am missing while reading the graph on IntelliJ?

Yes. Basically, you don’t know how to read a map. At least, this kind of map.

Remember the old joke? Topologically, a donut and a coffee cup are the same object. The same is true here.

Git history describes a directed acyclic graph of node parentage. If you look carefully you will see that on that basis your two screenshots are two perfectly valid ways of drawing the very same graph. They convey exactly the same node parentage information. And that is all that there is to convey.

The two drawings are, in other words, topologically identical. A little bending and stretching turns one into the other without any change in the node parentage indicated. Here is what the drawing says — in both screen shots (reading from the bottom up):

  • As we enter the picture from the bottom, a single chain of parentage represents both master and dev. I presume that you think of this as master.

  • On that same branch, Release 6020.

  • On that same branch, Release 3145.

  • Then a hotfix branch was created and the "Fix app crash issue" commit was created on it, followed by Release 3146. This is probably where you are confused. In right-to-left terms, this line of parentage is horizontally displayed at the far right in the first screenshot and in the middle in the second screenshot — but that is irrelevant because right-to-left (horizontal) position of a branch has no meaning whatever. It's still the same graph showing the same chain of parentage vertically.

  • The hotfix branch was then merged into master and also merged separately into dev. Thus we need to display three branches which are reduced to two, because the hotfix branch has now been merged into the other two and there will be no further development on it. The two branches are displayed in the right-to-left order master–dev in the first screenshot and in the order dev–master in the second screenshot, but as I just remarked, that's meaningless. It's still the same graph!

  • Development now continues just on dev: Await future(s), Minor refactor, and so forth. There is also further development on master but it is above the screenshots and is not shown.

So don’t worry, be happy. The two screenshots show the same thing and are both correct.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...