fun generateCommitLabel()

in src/main/kotlin/com/jetbrains/interactiveRebase/visuals/LabeledBranchPanel.kt [256:297]


    fun generateCommitLabel(
        i: Int,
        circle: CirclePanel,
    ): JBLabel {
        val truncatedMessage = truncateMessage(i)

        val commitLabel = JBLabel(truncatedMessage)

        val visualChanges = branch.currentCommits[i].getChangesAfterPick()
        if (visualChanges.any { it is CollapseCommand }) {
            commitLabel.text = ""
        } else {
            visualChanges.forEach {
                if (it is RewordCommand) {
                    commitLabel.text = TextStyle.addStyling(it.newMessage, TextStyle.ITALIC)
                    commitLabel.foreground = JBColor.BLUE
                }
                if (it is DropCommand) {
                    commitLabel.text = TextStyle.addStyling(commitLabel.text, TextStyle.CROSSED)
                    commitLabel.foreground = JBColor.LIGHT_GRAY.brighter()
                    commitLabel.horizontalAlignment = alignment
                    commitLabel.alignmentX = RIGHT_ALIGNMENT
                }

                if (it is SquashCommand) {
                    if (it.parentCommit == branch.currentCommits[i]) {
                        commitLabel.text = it.newMessage
                    }
                }
            }

            if (branch.currentCommits[i].isSelected) {
                commitLabel.text = TextStyle.addStyling(commitLabel.text, TextStyle.BOLD)
            }
        }
        commitLabel.autoscrolls = true
        commitLabel.labelFor = circle
        commitLabel.horizontalAlignment = alignment
        commitLabel.verticalTextPosition = SwingConstants.CENTER

        return commitLabel
    }