In our project we use a master branch for merging in regular feature branches (left side of the image), and additionally a long-running branch to integrate upstream commits (right side of image). We use this integration branch because upstream is not a git repo, so that way we have a branch that always mirrors upstream (but that's not very relevant here).

Whenever I open gitk in that repo, it shows me the master branch on the very left of the branch graph, and the integration branch on the right. Instead I would like to have the busier branch on the right (busier meaning more commits), so as to have the commit messages closer to the commit points.

Is there a way to make gitk draw the branches in a specific order? If someone is into the source of gitk, I wouldn't mind some fix that'd require me to compile gitk myself.

I know that, once merged, git can no longer discern which branch old commits were made on; I used the word "branch" above in a purely graphical sense. Gitk has to somehow determine what commits to draw in which "lane" (column) of the graph, and I'd like to influence that.

sample history

(Sorry about the long image)

有帮助吗?

解决方案

If the left branch is the one where the current local HEAD is, then you might try to invoke that gitk log with the"right" branch checked out first (I realize it is a -- poor -- workaround, but my point is: gitk won't do it for you).

However, as far as I know, gitk won't display one branch rather than the other or detect the "busiest" one. Only log options can influence how the history of commits is represented (as in "Visualizing branch topology in git").

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top