如何放弃关于Gerrit的整个话题? [英] How to abandon a whole topic on Gerrit?

查看:86
本文介绍了如何放弃关于Gerrit的整个话题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题的长期存在或不足之处在于,狂热地遵守代码审查原则和用户归因....

So the long and short of the issue is that, in a fit of fanatical adherence to code review principles and user attribution....

我从上游分支推送了834次提交到项目的Gerrit服务器.

I pushed around 834 commits from an upstream branch to a project's gerrit server.

从那以后,我被告知我应该(合理地)首先推送一个压缩的提交以测试Gerrit,然后将它们指向我的仓库以进行合并...

I was since then informed me that I ought to have (reasonably) first pushed a squashed commit for testing on gerrit and then pointed them to my repo for a merge...

幸运的是,我在上传提交时用主题标记了提交(为了便于测试....-_-)

Luckily I had tagged the commits with a topic while uploading them (for ease of testing.... -_-)

我现在如何大规模抛弃那里该死的整个话题? (将替换为压缩的提交)

How can I now mass abandon the whole damn topic there? (to be replaced with a squashed commit)

也许应该有某种终端命令?我的gerrit-fu很弱,但是我没有对该服务器的任何特权访问.

There ought to maybe be some sort of terminal command? My gerrit-fu is weak and I haven't any privileged access to the server though..

推荐答案

AFAIK,尚无现成的方法来实现.但是,gerrit是很棒的工具,您可以通过编写自定义脚本来解决此问题.

AFAIK, there is no ready method to achieve this. However, gerrit is awesome tool and you can solve this problem by writing a custom script.

对不起,我太懒了,无法为您提供随时可用的解决方案,但这是我的脚本会执行的操作:

Sorry, I'm too lazy to make you a ready to use solution, but here's what my script would do:

  1. 准备环境

  1. Prepare environment

alias gerrit="ssh -p 29418 gerrit.yourdomain.com gerrit"

  • 列出所有带有主题的提交:

  • List all the commits with topic:

    gerrit query topic:<topic>
    

  • 条状Change-Id

    放弃一步一步提交:

    gerrit review <id> --abandon
    

  • 更新

    感谢Marcelo Avila de Oliveira,您现在有了可以使用的脚本:

    Thanks to Marcelo Avila de Oliveira, you have now the script you can use:

    #!/bin/bash
    
    alias gerrit="ssh -p 29418 gerrit.yourdomain.com gerrit"
    
    for c in $(gerrit query topic:trololo | grep "сhange" | cut -d ' ' -f 2);
        do gerrit review $c --abandon;
    done
    

    用任何所需的内容替换trololo,或修改脚本以接受参数.

    Replace trololo with whatever you need, or adapt the script to take the argument.

    这篇关于如何放弃关于Gerrit的整个话题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆