ICode9

精准搜索请尝试: 精确搜索
首页 > 系统相关> 文章详细

【Shell】【Gerrit】for循环之批量设置gerrit submit-type类型为REBASE_IF_NECESSARY

2022-02-26 14:35:34  阅读:209  来源: 互联网

标签:Shell NECESSARY -- REBASE xxx gerrit project set id


1.shell中for循环语法:

for L_PROJECT in $(ssh -p xxxx xxx.xxx.xxx gerrit ls-projects); do
    echo ${L_PROJECT}
    ssh -p xxxx xxx.xxx.xxx gerrit set-project ${L_PROJECT} --submit-type REBASE_IF_NECESSARY
done

2.gerrit ssh常用命令:

annie.wu@xxxx:~/work$ ssh -p xxxx xxx.xxx.xxx gerrit --help
gerrit [COMMAND] [ARG ...] [--] [--help (-h)]

 --          : end of options (default: false)
 --help (-h) : display this help text (default: true)

Available commands of gerrit are:

   apropos               Search in Gerrit documentation
   ban-commit            Ban a commit from a project's repository
   close-connection      Close the specified SSH connection
   convert-ref-storage   Convert ref storage to reftable (experimental)
   create-account        Create a new batch/role account
   create-branch         Create a new branch
   create-group          Create a new account group
   create-project        Create a new project and associated Git repository
   flush-caches          Flush some/all server caches from memory
   gc                    Run Git garbage collection
   index
   logging
   ls-groups             List groups visible to the caller
   ls-members            List the members of a given group
   ls-projects           List projects visible to the caller
   ls-user-refs          List refs visible to a specific user
   plugin
   query                 Query the change database
   receive-pack          Standard Git server side command for client side git push
   reload-config         Reloads the Gerrit configuration
   rename-group          Rename an account group
   review                Apply reviews to one or more patch sets
   sequence
   set-account           Change an account's settings
   set-head              Change HEAD reference for a project
   set-members           Modify members of specific group or number of groups
   set-project           Change a project's settings
   set-project-parent    Change the project permissions are inherited from
   set-reviewers         Add or remove reviewers on a change
   set-topic             Set the topic for one or more changes
   show-caches           Display current cache statistics
   show-connections      Display active client SSH connections
   show-queue            Display the background work queues
   stream-events         Monitor events occurring in real time
   test-submit
   version               Display gerrit version

See 'gerrit COMMAND --help' for more information.

3.gerrit set-project命令选项:

annie.wu@xxxx:~/work$ ssh -p xxxx xxx.xxx.xxx gerrit set-project --help
gerrit set-project NAME [--] [--change-id [TRUE | FALSE | INHERIT]] [--content-merge [TRUE | FALSE | INHERIT]] [--contributor-agreements [TRUE | FALSE | INHERIT]] [--description (-d) DESCRIPTION] [--help (-h)] [--max-object-size-limit VAL] [--no-change-id (--nid)] [--no-content-merge] [--no-contributor-agreements (--nca)] [--no-signed-off-by (--nso)] [--project-state (--ps) [ACTIVE | READ_ONLY | HIDDEN]] [--require-change-id (--id)] [--signed-off-by [TRUE | FALSE | INHERIT]] [--submit-type (-t) [INHERIT | FAST_FORWARD_ONLY | MERGE_IF_NECESSARY | REBASE_IF_NECESSARY | REBASE_ALWAYS | MERGE_ALWAYS | CHERRY_PICK]] [--trace] [--trace-id VAL] [--use-content-merge] [--use-contributor-agreements (--ca)] [--use-signed-off-by (--so)]

 NAME                                   : name of the project
 --                                     : end of options (default: false)
 --change-id [TRUE | FALSE | INHERIT]   : if change-id is required
 --content-merge [TRUE | FALSE |        : allow automatic conflict resolving
 INHERIT]                                 within files
 --contributor-agreements [TRUE |       : if contributor agreement is required
 FALSE | INHERIT]
 --description (-d) DESCRIPTION         : description of project
 --help (-h)                            : display this help text (default: true)
 --max-object-size-limit VAL            : max Git object size for this project
 --no-change-id (--nid)                 : if change-id is not required
 --no-content-merge                     : don't allow automatic conflict
                                          resolving within files
 --no-contributor-agreements (--nca)    : if contributor agreement is not
                                          required
 --no-signed-off-by (--nso)             : if signed-off-by is not required
 --project-state (--ps) [ACTIVE |       : project's visibility state
 READ_ONLY | HIDDEN]
 --require-change-id (--id)             : if change-id is required
 --signed-off-by [TRUE | FALSE |        : if signed-off-by is required
 INHERIT]
 --submit-type (-t) [INHERIT |          : project submit type
 FAST_FORWARD_ONLY | MERGE_IF_NECESSARY   (default: MERGE_IF_NECESSARY)
 | REBASE_IF_NECESSARY | REBASE_ALWAYS
 | MERGE_ALWAYS | CHERRY_PICK]
 --trace                                : enable request tracing (default:
                                          false)
 --trace-id VAL                         : trace ID (can only be set if --trace
                                          was set too)
 --use-content-merge                    : allow automatic conflict resolving
                                          within files
 --use-contributor-agreements (--ca)    : if contributor agreement is required
 --use-signed-off-by (--so)             : if signed-off-by is required

标签:Shell,NECESSARY,--,REBASE,xxx,gerrit,project,set,id
来源: https://www.cnblogs.com/wucaiyun1/p/15939154.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有