如何在 UI 中显示 Gerrit ID?

How can I display the Gerrit ID in the UI?

Gerrit 曾经将 ID 显示为 UI 中的第一列。我使用的是 2.9 版(是的,我知道,很旧,但我们目前无法升级),而且它不再可见。我知道我可以单击更改并查看 ID 或将鼠标悬停在更改上并在浏览器状态行的 URL 中查看它,但我确实需要能够一眼看到其中的一堆。

有什么方法可以增加我用来添加的 URL 吗?

转到您的首选项(即 your-gerrit.com/#/settings/preferences)并选中 在更改中显示更改编号 Table 选项。

正如我在 this issue 中看到的那样,它是在 2.10 中引入的,但如果我没记错的话,我记得之前使用过它。

编辑: 它带来的变化是 here,它包含在 2.10 中。您将必须更新才能获得列表中的 Change-Id 列。

编辑 2: 我创建了一个简单的 JS 脚本,它将显示带有 ChangeId 的列。查看更改列表时,只需将其粘贴到 URL 栏即可:

javascript:var cols = document.getElementsByClassName("cSUBJECT"); for (var i = 0; i < cols.length; i++) { var id = cols[i].children[0].getAttribute('href').substr(cols[0].children[0].getAttribute('href').lastIndexOf('/') + 1); cols[i].insertAdjacentHTML('beforebegin', '<td>' + id + '</td>'); } document.getElementsByClassName("iconHeader")[0].insertAdjacentHTML('afterend', '<td class="iconHeader"></td>');

您可以根据需要将其添加为书签,并在需要显示更改号码时单击它:-) 不过可能需要进行一些调整。