renderdag: box: option to pad between nodes from separate branches#1163
renderdag: box: option to pad between nodes from separate branches#1163thomasa88 wants to merge 3 commits intofacebook:mainfrom
Conversation
Makes it easier to visually scan the branches and find the heads quickly.
Before:
│ │ │ o F some text message
│ ├───╯ that continues on the next line
│ │ │ o E some text message
│ ├───╯ that continues on the next line
│ │ o D some text message
│ │ │ that continues on the next line
│ │ o C some text message
│ │ │ that continues on the next line
│ o │ B some text message
│ ├─╯ that continues on the next line
│ o A some text message
├─╯ that continues on the next line
After:
│ │ │ o F some text message
│ ├───╯ that continues on the next line
│ │ │
│ │ │ o E some text message
│ ├───╯ that continues on the next line
│ │ │
│ │ o D some text message
│ │ │ that continues on the next line
│ │ o C some text message
│ │ │ that continues on the next line
│ │ │
│ o │ B some text message
│ ├─╯ that continues on the next line
│ o A some text message
├─╯ that continues on the next line
90f5bb8 to
f0d2cc3
Compare
|
@thomasa88 has updated the pull request. You must reimport the pull request before landing. |
|
@facebook-github-bot has imported this pull request. If you are a Meta employee, you can view this in D89118021. (Because this pull request was imported automatically, there will not be any future comments.) |
quark-zju
left a comment
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
|
Sorry for the slow review. In your example it seems inconsistent that there are no spaces between (A, B), or (D, C) but there are spaces between (E, F), (B, C), and (D, E). If you want more spaces, have you tried appending new lines |
quark-zju
left a comment
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
Hi, DC is in fact correct as it is. It is more apparent if there are more nodes. All nodes belonging to the same branch get grouped and spacing is added between nodes from different branches. If you look at the nodes ( Looking closer, I realize that AB should likely have the spacing, since even though they are on the same vertical line, the branch between A B should likely make them be considered belonging to different branches. 🤔 . I will have to dig in to the code a bit and see if I can fix it. |
I see. I'm not sure renderdag is the best place to implement this. Could you check from the call-site and pass an extra newline as commit message as needed? e.g. if a commit's parent has multiple children, in your example, F, E, C, B, then just make their commit message longer by appending a new line. Also note there is a "shorten graph" mode inherited from https://repo.mercurial-scm.org/hg/rev/ac30adb260ea for compact output. We control this mode via |
|
I think I ended up adding the implementation into renderdag instead of the call-site (Jujutsu), as the direct caller only has information on each node's parent edges and not information on which branch a node belongs to or the number of children, as it does not, from what I remember, build the graph. Breaking other render options does not sound good 😅 . I will look to see if I can pass more information to the caller in some good way. |
|
Got it. If you change renderdag could you make it customizable? This way we can keep current behaviors unchanged. |
Makes it easier to visually scan the branches and find the heads quickly.
Before:
After: