<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                # Threads > 原文:[https://docs.gitlab.com/ee/user/discussions/](https://docs.gitlab.com/ee/user/discussions/) * [Resolvable comments and threads](#resolvable-comments-and-threads) * [Commit threads in the context of a merge request](#commit-threads-in-the-context-of-a-merge-request) * [Jumping between unresolved threads](#jumping-between-unresolved-threads) * [Marking a comment or thread as resolved](#marking-a-comment-or-thread-as-resolved) * [Move all unresolved threads in a merge request to an issue](#move-all-unresolved-threads-in-a-merge-request-to-an-issue) * [Moving a single thread to a new issue](#moving-a-single-thread-to-a-new-issue) * [Only allow merge requests to be merged if all threads are resolved](#only-allow-merge-requests-to-be-merged-if-all-threads-are-resolved) * [Automatically resolve merge request diff threads when they become outdated](#automatically-resolve-merge-request-diff-threads-when-they-become-outdated) * [Commit threads](#commit-threads) * [Threaded discussions](#threaded-discussions) * [Image threads](#image-threads) * [Lock discussions](#lock-discussions) * [Merge Request Reviews](#merge-request-reviews) * [Starting a review](#starting-a-review) * [Resolving/Unresolving threads](#resolvingunresolving-threads) * [Submitting a review](#submitting-a-review) * [Filtering notes](#filtering-notes) * [Suggest Changes](#suggest-changes) * [Multi-line Suggestions](#multi-line-suggestions) * [Code block nested in Suggestions](#code-block-nested-in-suggestions) * [Configure the commit message for applied Suggestions](#configure-the-commit-message-for-applied-suggestions) * [Batch Suggestions](#batch-suggestions) * [Enable or disable Batch Suggestions](#enable-or-disable-batch-suggestions) * [Start a thread by replying to a standard comment](#start-a-thread-by-replying-to-a-standard-comment) * [Assign an issue to the commenting user](#assign-an-issue-to-the-commenting-user) # Threads[](#threads "Permalink") 整個 GitLab 都提供了進行對話的能力. 您可以在以下位置發表評論: * Issues * Epics * 合并要求 * Snippets * Commits * 提交差異 有標準注釋,您還可以選擇以線程形式創建注釋. 收到回復后,評論也可以[變成主題](#start-a-thread-by-replying-to-a-standard-comment) . 評論區域支持[Markdown](../markdown.html)和[快速操作](../project/quick_actions.html) . 您可以隨時編輯自己的評論,擁有" [維護者"訪問級別](../permissions.html)或更高[權限的](../permissions.html)任何人也可以編輯其他人的評論. 如果為您的 GitLab 實例配置了" [通過電子郵件回復",](../../administration/reply_by_email.html)您還可以回復評論通知電子郵件以回復評論. 回復標準評論會創建另一個標準評論. 回復主題注釋會在主題中創建回復. 電子郵件回復支持[Markdown](../markdown.html)和[快速操作](../project/quick_actions.html) ,就像您從網絡上回復一樣. **注意:**每個對象最多只能有 5,000 條注釋,例如:issue,epic 和 merge request. ## Resolvable comments and threads[](#resolvable-comments-and-threads "Permalink") 版本歷史 * 在 GitLab 8.11 中[引入](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/5022) . * 可解決的線程只能添加到合并請求差異中. 線程解析有助于跟蹤計劃或代碼審查期間的進度. 合并請求,提交,提交差異和摘要中的每個標準注釋或線程最初都顯示為未解決. 然后,至少具有開發人員訪問項目權限的任何人或所檢查的更改的作者都可以單獨解決這些問題. 如果該線程已解決,并且非成員取消了他們自己的響應,則這也將取消解決討論線程. 如果非成員然后解決了相同的答復,則將解決討論線程. 解決所有標準注釋或線程的需求可以防止您忘記處理反饋,并可以隱藏不再相關的線程. [!["A thread between two people on a piece of code"](https://img.kancloud.cn/52/f8/52f80e88ea24f104c1f8749b66556954_1936x1946.png)](img/thread_view.png) ### Commit threads in the context of a merge request[](#commit-threads-in-the-context-of-a-merge-request "Permalink") 在 GitLab 10.3 中[引入](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/31847) . 對于具有基于提交的工作流的審閱者,在合并請求的上下文中將線程添加到特定的提交差異可能很有用. 在以下情況下,這些線程將通過更改提交 ID 保持不變: * 重新設置后強制推動 * 修改提交 創建提交差異線程: 1. 導航到合并請求的" **提交"**選項卡. 將顯示構成合并請求的提交列表. [![Merge request commits tab](https://img.kancloud.cn/c2/b5/c2b5320f8e21cde5f7b7b117b2670dc9_1954x574.png)](img/merge_request_commits_tab.png) 2. 導航到特定的提交,單擊" **更改"**選項卡(在該選項卡中,將僅顯示與所選提交不同的內容),并留下評論. [![Commit diff discussion in merge request context](https://img.kancloud.cn/f8/de/f8de7d4b046ad6bfa76d5ce1a1df61b1_1944x1490.png)](img/commit_comment_mr_context.png) 3. 以這種方式創建的任何線程都將顯示在合并請求的" **討論"**選項卡中,并且可以解決. [![Merge request Discussions tab](https://img.kancloud.cn/30/b5/30b55fe8ae9570d500c8d4c89a10509e_1958x1158.png)](img/commit_comment_mr_discussions_tab.png) 以這種方式創建的線程將僅出現在原始合并請求中,而不是導航到項目的" **存儲庫">"提交"**頁面下的**提交時** . **提示:**在合并請求內的線程中找到提交引用的鏈接時,它將在當前合并請求的上下文中自動轉換為鏈接. ### Jumping between unresolved threads[](#jumping-between-unresolved-threads "Permalink") 當合并請求中包含大量注釋時,可能很難跟蹤仍未解決的問題. 您可以使用線程上"回復"字段旁邊的"跳轉"按鈕在未解決的線程之間跳轉. 您也可以從已解決的線程跟蹤器旁邊的按鈕跳轉到下一個未解決的線程. 您還可以使用鍵盤快捷鍵在線程之間導航: * 使用`n`跳到下一個未解決的線程. * 使用`p`跳到上一個未解決的線程. [!["8/9 threads resolved"](https://img.kancloud.cn/81/f0/81f032c2d0dc78f04f6843098b3072a0_524x92.png)](img/threads_resolved.png) ### Marking a comment or thread as resolved[](#marking-a-comment-or-thread-as-resolved "Permalink") 您可以通過單擊**線程**底部的" **解決線程"**按鈕將其標記為已解決. [!["Resolve thread" button](https://img.kancloud.cn/ff/41/ff413a521a06f2ca9ca112e13db12d4d_1932x156.png)](img/resolve_thread_button.png) 或者,您可以將每個評論標記為單獨解決. [!["Resolve comment" button](https://img.kancloud.cn/51/39/5139cdd936c6b9705cf9abe7bce14d2e_324x144.png)](img/resolve_comment_button.png) ### Move all unresolved threads in a merge request to an issue[](#move-all-unresolved-threads-in-a-merge-request-to-an-issue "Permalink") 在 GitLab 9.1 中[引入](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/8266) 要在新問題中繼續執行來自合并請求的所有打開的線程,請單擊" **解決新問題中的所有線程"**按鈕. [![Open new issue for all unresolved threads](https://img.kancloud.cn/62/1a/621adee65ef1ea032b20594826a0db09_602x168.png)](img/btn_new_issue_for_all_threads.png) 或者,當您的項目僅[在解決所有線程](#only-allow-merge-requests-to-be-merged-if-all-threads-are-resolved)后才接受合并請求[時](#only-allow-merge-requests-to-be-merged-if-all-threads-are-resolved) ,將存在**一個問題,即以后**在合并請求小部件中**解決它們的**鏈接. [![Link in merge request widget](https://img.kancloud.cn/80/d4/80d49effeb486fc562770d744983abfe_1240x254.png)](img/resolve_thread_open_issue.png) 這將準備一個問題,其內容涉及合并請求和未解決的線程. [![Issue mentioning threads in a merge request](https://img.kancloud.cn/19/99/19996a46d7843d9c76fa8e303d013484_2130x696.png)](img/preview_issue_for_threads.png) 擊中" **提交"問題**將導致所有線程被標記為已解決,并添加注釋以引用新創建的問題. [![Mark threads as resolved notice](https://img.kancloud.cn/8c/6d/8c6da6aa5cdbff7813b6200d7385b982_1258x282.png)](img/resolve_thread_issue_notice.png) 現在,您可以繼續從 UI 合并合并請求. ### Moving a single thread to a new issue[](#moving-a-single-thread-to-a-new-issue "Permalink") 在 GitLab 9.1 中[引入](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/8266) 要為單個線程創建新問題,可以使用" **在新問題中解決此線程"**按鈕. [![Create issue for thread](https://img.kancloud.cn/c8/7e/c87e224645cd5ee447f9f5659cdb1ac9_526x198.png)](img/new_issue_for_thread.png) 這會將您定向到預填充了線程內容的新問題,類似于為一次委派多個線程而創建的問題. 保存問題將把該線程標記為已解決,并在合并請求線程中添加引用新問題的注釋. [![New issue for a single thread](https://img.kancloud.cn/40/60/406091102e237dd99796e04a82f91ddd_2146x696.png)](img/preview_issue_for_thread.png) ### Only allow merge requests to be merged if all threads are resolved[](#only-allow-merge-requests-to-be-merged-if-all-threads-are-resolved "Permalink") 在 GitLab 8.14 中[引入](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/7125) . 在解決所有線程之前,可以阻止合并請求. 導航到項目的設置頁面,選中" **僅在解決所有線程后才允許合并請求"**復選框,然后單擊" **保存"**以使更改生效. [![Only allow merge if all the threads are resolved settings](https://img.kancloud.cn/2f/a7/2fa792408e0423379b40f41d9e5499d8_878x390.png)](img/only_allow_merge_if_all_threads_are_resolved.png) 從現在開始,直到所有線程解決后,您才能從 UI 進行合并. [![Only allow merge if all the threads are resolved message](https://img.kancloud.cn/80/d4/80d49effeb486fc562770d744983abfe_1240x254.png)](img/resolve_thread_open_issue.png) ### Automatically resolve merge request diff threads when they become outdated[](#automatically-resolve-merge-request-diff-threads-when-they-become-outdated "Permalink") 在 GitLab 10.0 中[引入](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/14053) . 您可以在使用新的推送修改的行上自動解決合并請求差異線程. 導航到您的項目的設置頁面,選中" **使用推送更改的行上**的**自動解析合并請求差異線程"**復選框,然后單擊" **保存"**以使更改生效. [![Automatically resolve merge request diff threads when they become outdated](https://img.kancloud.cn/fb/94/fb94c4e1363f14ec10d099d3a6194a39_1248x248.png)](img/automatically_resolve_outdated_discussions.png) 從現在開始,如果推送使 diff 部分過時,默認情況下將解決 diff 上的所有線程. 不變的線上線程和頂級可解析線程不會自動解析. ## Commit threads[](#commit-threads "Permalink") 您可以在項目的**Repository> Commits**下向特定提交添加注釋和線程. **注意:**如果在強制推送后更改了提交 ID,則以這種方式創建的線程將丟失. ## Threaded discussions[](#threaded-discussions "Permalink") 在 GitLab 9.1 中[引入](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/7527) . 盡管可解析線程僅可用于合并請求差異,但也可以添加沒有差異的線程. 您可以針對問題,提交,摘要和合并請求啟動一個看起來像線程的特定線程. 要開始主題討論,請單擊" **評論"**按鈕切換下拉列表,選擇" **開始主題",**并在準備發布評論時單擊" **開始主題** ". [![Comment type toggle](https://img.kancloud.cn/ab/ef/abef7d5ec2d0bc265570886d346f2147_906x432.png)](img/comment_type_toggle.gif) 這將以單個線程發布評論,使您可以更詳細地討論特定評論. [![Thread comment](https://img.kancloud.cn/e2/c1/e2c1c766251f65d095ae39acd8476d38_1930x330.png)](img/discussion_comment.png) ## Image threads[](#image-threads "Permalink") 在 GitLab 10.1 中[引入](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/14061) . 有時線程圍繞圖像旋轉. 使用圖像線程,您可以輕松地定位圖像的特定坐標并在其周圍啟動線程. 圖像線程在合并請求和提交詳細信息視圖中可用. 要啟動圖像線程,請將鼠標懸停在圖像上. 您的鼠標指針應轉換為圖標,表示該圖像可用于注釋. 只需單擊圖像上的任意位置以創建新線程. [![Start image thread](https://img.kancloud.cn/45/03/4503f28f4ee31165a3bb3d87901db515_1354x610.png)](img/start_image_discussion.gif) 單擊圖像后,將顯示注釋表單,該注釋表單將成為您線程的開始. 保存評論后,您會在圖像頂部看到一個新的徽章. 此徽章代表您的話題. > **注意:**該線程標志通常與一個數字關聯,該數字僅用作每個線程的可視參考. 在合并請求線程選項卡中,此標記將帶有注釋圖標,因為每個線程都會呈現一個新的圖像部分. 圖像線程還可以在替換現有圖像的差異上工作. 在此差異查看模式下,您可以切換不同的查看模式,但仍可以看到線點標記. | 2-up | Swipe | 洋蔥皮 | | --- | --- | --- | | [![2-up view](https://img.kancloud.cn/ca/9f/ca9fc2c20cca60aa96f06899108c0587_1844x582.png)](img/two_up_view.png) | [![swipe view](https://img.kancloud.cn/b7/20/b72035b588e729921212551a2a718d06_1842x528.png)](img/swipe_view.png) | [![onion skin view](https://img.kancloud.cn/35/02/35021a4ddd1c49311f0ed2d0e5df8eb2_1846x526.png)](img/onion_skin_view.png) | 映像線程也可與可解析線程一起很好地工作. 差異上的已解析線程(不在"合并請求討論"選項卡上)在頁面加載時將顯示為折疊狀態,并且將具有對應的標記計數器以匹配圖像上的計數器. [![Image resolved thread](https://img.kancloud.cn/08/cd/08cd741b5bc0c0c8cdcd90c6ad086182_1846x996.png)](img/image_resolved_discussion.png) ## Lock discussions[](#lock-discussions "Permalink") 在 GitLab 10.1 中[引入](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/14531) . For large projects with many contributors, it may be useful to stop threads in issues or merge requests in these scenarios: * 項目維護者已經解決了該線程,對于繼續反饋沒有幫助. * 項目維護者已經將新對話指向新問題或合并請求. * 參與線程的人正在拖釣,辱罵或沒有生產力. 在這些情況下,項目中具有開發者權限或更高權限的用戶可以使用邊欄中的"鎖定"部分來鎖定(和解鎖)問題或合并請求. 對于問題,具有記者權限的用戶可以鎖定(和解鎖). | Unlock | Lock | | --- | --- | | [![Turn off discussion lock](https://img.kancloud.cn/65/af/65af1adfa68aa34ad86c6f2739b0d628_558x336.png)](img/turn_off_lock.png) | [![Turn on discussion lock](https://img.kancloud.cn/1d/03/1d03d78783e97c3c3fdf530e5ee26502_564x374.png)](img/turn_on_lock.png) | 系統注釋指示鎖定和解鎖. [![Discussion lock system notes](https://img.kancloud.cn/19/8e/198ed9e0d8fbe9ea499f375c0b6500b3_1836x230.png)](img/discussion_lock_system_notes.png) 在鎖定的問題或合并請求中,只有團隊成員才能添加新評論和編輯現有評論. 禁止非團隊成員添加或編輯評論. | 隊員 | 非團隊成員 | | --- | --- | | [![Comment form member](https://img.kancloud.cn/4a/f6/4af67a28b1387b9f494212307894558a_1952x684.png)](img/lock_form_member.png) | [![Comment form non-member](https://img.kancloud.cn/d8/a8/d8a8ee82e0c853cda71c6bedc6cad9af_1958x432.png)](img/lock_form_non_member.png) | 此外,無法重新打開鎖定的問題和合并請求. ## Merge Request Reviews[](#merge-request-reviews "Permalink") 版本歷史 * 在[GitLab Premium](https://about.gitlab.com/pricing/) 11.4 中[引入](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/4213) . * 在 13.1 版中[移至](https://gitlab.com/gitlab-org/gitlab/-/issues/28154) GitLab Core. 查看"合并請求"差異時,您可以開始審閱. 這樣,您便可以在"合并請求"中創建**僅**在發布之前才對**您可見的**注釋,以便您可以將所有注釋作為單個操作提交. ### Starting a review[](#starting-a-review "Permalink") 為了開始審閱,只需像往常一樣在 MR 的" **更改"**選項卡下對差異添加注釋,然后單擊" **開始審閱"**按鈕. [![Starting a review](https://img.kancloud.cn/71/49/7149348bfd9199f680f73a116fff66df_1876x1274.png)](img/mr_review_start.png) Once a review is started, you will see any comments that are part of this review marked `Pending`. All comments that are part of a review show two buttons: * **完成審閱** :提交**審閱中的**所有評論,使其他用戶可以看到它們. * **立即添加評論** :提交特定評論作為常規評論,而不是審閱的一部分. [![A comment that is part of a review](https://img.kancloud.cn/bd/97/bd973c8a80ae9a04b30a12ec029343b7_1870x928.png)](img/pending_review_comment.png) 您可以在評論中使用[快速操作](../project/quick_actions.html) . 注釋將顯示發布后將執行的操作. [![A review comment with quick actions](https://img.kancloud.cn/ad/06/ad0605e57aad54ff662228c3f4bd42ed_1878x1102.png)](img/review_comment_quickactions.png) 要向評論添加更多評論,請照常開始寫評論,然后單擊**添加到評論**按鈕. [![Adding a second comment to a review](https://img.kancloud.cn/2c/04/2c04637edfbfe15645999eeb7db79792_1892x816.png)](img/mr_review_second_comment.png) 這會將評論添加到評論中. [![Second review comment](https://img.kancloud.cn/3c/6b/3c6be6bc8e110900b7b0c08c7de6aa9e_1888x476.png)](img/mr_review_second_comment_added.png) ### Resolving/Unresolving threads[](#resolvingunresolving-threads "Permalink") 評論注釋也可以解決/無法解決[可解決的線程](#resolvable-comments-and-threads) . 回復評論時,您將看到一個復選框,您可以單擊該復選框以在發布后解決或取消解決線程. [![Resolve checkbox](https://img.kancloud.cn/e3/f6/e3f6a37681557b9d584ea29c99c5453b_1898x1228.png)](img/mr_review_resolve.png) 如果特定的待處理注釋將解決或取消解決該線程,它將顯示在待處理注釋本身上. [![Resolve status](https://img.kancloud.cn/72/22/7222e5fe277e9ffa6373c83e7fa824be_1906x886.png)](img/mr_review_resolve2.png) [![Unresolve status](https://img.kancloud.cn/38/c2/38c2c4e909d8d583f658094cad24334d_1908x1162.png)](img/mr_review_unresolve.png) ### Submitting a review[](#submitting-a-review "Permalink") If you have any comments that have not been submitted, you will see a bar at the bottom of the screen with two buttons: * **舍棄** : **舍棄**所有尚未提交的評論. * **完成審閱** :打開準備提交審閱的評論列表. 單擊**提交評論**將發布所有評論. 此時將執行所有提交的快速操作. 另外,要通過待審核的評論完成整個審核,請執行以下操作: * 單擊**評論**上的" **完成審閱"**按鈕. * 在非評論注釋的文本中使用`/submit_review` [快速操作](../project/quick_actions.html) . [![Review submission](https://img.kancloud.cn/d4/7e/d47efd5b42df9c108d85b4ee69609d1b_774x570.png)](img/review_preview.png) 提交審閱將向合并請求的每個應通知用戶發送一封電子郵件,其中包含與之相關的所有注釋. 因此,回復此電子郵件將在關聯的合并請求上創建一個新注釋. ## Filtering notes[](#filtering-notes "Permalink") 在 GitLab 11.5 中[引入](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/26723) . 對于活動注釋和用戶注釋等具有許多注釋的問題,有時很難找到有用的信息. 有一種方法可以針對合并請求和問題從單個注釋和線程中過濾注釋. 從合并請求的" **討論"**選項卡,或史詩/問題概述中,找到頁面右側的過濾器下拉菜單,您可以從中選擇以下選項之一: * **顯示所有活動** :顯示所有用戶評論和系統注釋(問題更新,對其他問題的提及,對描述的更改等). * **僅顯示評論** :僅在列表中顯示用戶評論. * **僅顯示歷史記錄** :僅顯示活動記錄. [![Notes filters dropdown options](https://img.kancloud.cn/c8/3e/c83e69ab67a26871867c5d715aae15e4_1254x378.png)](img/index_notes_filters.png) 在給定問題或 MR 中選擇過濾器之一后,GitLab 將保存您的首選項,這樣當您從已登錄的任何設備再次訪問同一頁面時,該首選項將保持不變. ## Suggest Changes[](#suggest-changes "Permalink") 在 GitLab 11.6 中[引入](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/18008) . 作為審閱者,您可以在 Merge Request Diff 線程中使用簡單的 Markdown 語法建議代碼更改. 然后,合并請求作者(或具有適當[權限的](../permissions.html)其他用戶)能夠通過單擊來應用這些建議,這將在應用了這些建議的用戶創作的合并請求中生成提交. 1. 選擇要更改的代碼行,添加新注釋,然后單擊工具欄中的" **插入建議"**圖標: [![Add a new comment](https://img.kancloud.cn/43/aa/43aafb569f650264d9400fdeac8b7be6_2098x726.png)](img/suggestion_button_v12_7.png) 2. 在注釋中,將您的建議添加到預填充的代碼塊中: [![Add a suggestion into a code block tagged properly](https://img.kancloud.cn/21/7e/217e7dae220957e3c16423eaa7399b1c_2094x841.png)](img/make_suggestion_v12_7.png) 3. 單擊**開始審查**或**加入審查** ,以您的評論添加到[審查](#merge-request-reviews) ,或者**現在添加注釋** ,注釋立即加入到線程. 注釋中的"建議"可由合并請求作者直接從合并請求中應用: [![Apply suggestions](https://img.kancloud.cn/37/8f/378f246ede6ea61b88afcc6405248bdc_2098x924.png)](img/apply_suggestion_v12_7.png) 一旦作者應用了一個建議,它將被標記為"已**應用"**標簽,該線程將被自動解析,并且 GitLab 將創建一個新的提交,并將建議的更改直接推送到合并請求分支中的代碼庫中. 這樣做需要[開發人員許可](../permissions.html) . ### Multi-line Suggestions[](#multi-line-suggestions "Permalink") 在 GitLab 11.10 中[引入](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/53310) . 審閱者還可以通過調整范圍偏移,在合并請求差異線程中使用單個"建議"來建議對多行進行更改. 偏移量相對于 diff 線程的位置,并指定應用建議時要被建議替換的范圍. [![Multi-line suggestion syntax](https://img.kancloud.cn/89/6e/896e2f67e64b6fa2bed4768f9eee1070_1005x310.png)](img/multi-line-suggestion-syntax.png) 在上面的示例中,建議涵蓋了注釋行上方的三行和注釋行下方的四行. 應用時,它將用建議的更改從注釋行*上方的* 3 行替換為注釋行*下方*的 4 行. [![Multi-line suggestion preview](https://img.kancloud.cn/74/05/74053c2973d3fe887646b3543b30caca_1005x431.png)](img/multi-line-suggestion-preview.png) **注意:**涵蓋多行的建議僅限于已注釋差異行*上方的* 100 行和*下方*的差異行*下方*的 100 行,每個建議最多可更改 200 行. ### Code block nested in Suggestions[](#code-block-nested-in-suggestions "Permalink") 如果您需要提出涉及[受限制的代碼塊](../markdown.html#code-spans-and-blocks)的建議,請將您的建議換成四個反引號,而不是通常的三個. [![A comment editor with a suggestion with a fenced code block](https://img.kancloud.cn/a0/ac/a0acffd41ff0953a7692d749519bf61f_890x298.png)](img/suggestion_code_block_editor_v12_8.png) [![Output of a comment with a suggestion with a fenced code block](https://img.kancloud.cn/77/96/77968a55f884e01e752e8baa7ce6f21b_1162x412.png)](img/suggestion_code_block_output_v12_8.png) ### Configure the commit message for applied Suggestions[](#configure-the-commit-message-for-applied-suggestions "Permalink") 在 GitLab 12.7 中[引入](https://gitlab.com/gitlab-org/gitlab/-/issues/13086) . GitLab 在應用建議時使用默認的提交消息: `Apply %{suggestions_count} suggestion(s) to %{files_count} file(s)` 例如,假設用戶將 3 條建議應用于 2 個不同的文件,則默認的提交消息將是: **將 3 條建議應用于 2 個文件** 可以自定義這些提交消息,以遵循您可能擁有的任何準則. 為此, **請**在項目的" **常規"**設置中展開" **合并請求"**選項卡,然后更改" **合并建議"**文本: [![Custom commit message for applied Suggestions](https://img.kancloud.cn/52/ae/52ae80703e924e54545fdc578a402512_902x219.png)](img/suggestions_custom_commit_messages_v13_1.jpg) 除了靜態文本,您還可以使用以下變量: | Variable | Description | 輸出示例 | | --- | --- | --- | | `%{branch_name}` | 建議所應用到的分支的名稱. | `my-feature-branch` | | `%{files_count}` | 應用了建議的文件數. | **2** | | `%{file_paths}` | 應用了建議文件的路徑. 路徑用逗號分隔. | `docs/index.md, docs/about.md` | | `%{project_path}` | 項目路徑. | `my-group/my-project` | | `%{project_name}` | 項目的可讀名稱. | **我的項目** | | `%{suggestions_count}` | 應用的建議數. | **3** | | `%{username}` | 應用建議的用戶的用戶名. | `user_1` | | `%{user_full_name}` | 應用建議的用戶的全名. | **用戶 1** | 例如,要自定義提交消息以輸出**Addresses user_1 的評論** ,請將自定義文本設置為`Addresses %{username}'s review` . **注意:** [#25381](https://gitlab.com/gitlab-org/gitlab/-/issues/25381)將為每個應用的建議(以及批量建議)引入自定義提交消息. ### Batch Suggestions[](#batch-suggestions "Permalink") 版本歷史 * 在 GitLab 13.1 中作為[Alpha 功能](https://about.gitlab.com/handbook/product/#alpha) [引入](https://gitlab.com/gitlab-org/gitlab/-/issues/25486) . * 它部署在功能標記后面,默認情況下處于禁用狀態. * 在 GitLab.com 上已禁用. * 要在 GitLab 自管實例中使用它,請讓 GitLab 管理員[啟用它](#enable-or-disable-batch-suggestions) . 您可以一次應用多個建議,以減少為滿足審閱者的請求而添加到分支的提交數量. 1. 要啟動將在一次提交中應用的一批建議,請單擊" **將建議添加到批處理"** : [![A code change suggestion displayed, with the button to add the suggestion to a batch highlighted.](https://img.kancloud.cn/d1/56/d156a1e0b60913963a73c154413c5fce_871x157.png "Add a suggestion to a batch")](img/add_first_suggestion_to_batch_v13_1.jpg) 2. 根據需要向批處理中添加盡可能多的其他建議: [![A code change suggestion displayed, with the button to add an additional suggestion to a batch highlighted.](https://img.kancloud.cn/c8/4a/c84ada16c535d81b315b19ce5661a065_871x161.png "Add another suggestion to a batch")](img/add_another_suggestion_to_batch_v13_1.jpg) 3. 要刪除建議,請單擊" **從批處理中刪除"** : [![A code change suggestion displayed, with the button to remove that suggestion from its batch highlighted.](https://img.kancloud.cn/8b/7c/8b7c62ddc6a921d2880aba03b96483e4_871x155.png "Remove a suggestion from a batch")](img/remove_suggestion_from_batch_v13_1.jpg) 4. 將所有建議添加到您的喜好中后,準備好后,請點擊**應用建議** : [![A code change suggestion displayed, with the button to apply the batch of suggestions highlighted.](https://img.kancloud.cn/66/73/667365869aae7ffe5f4095cac7e88fa8_876x162.png "Apply a batch of suggestions")](img/apply_batch_of_suggestions_v13_1.jpg) #### Enable or disable Batch Suggestions[](#enable-or-disable-batch-suggestions "Permalink") 批處理建議部署在**默認情況下禁用**的功能標志的后面. [有權訪問 GitLab Rails 控制臺的 GitLab 管理員](../../administration/feature_flags.html)可以為您的實例啟用它. 要啟用它: ``` # Instance-wide Feature.enable(:batch_suggestions) ``` 禁用它: ``` # Instance-wide Feature.disable(:batch_suggestions) ``` ## Start a thread by replying to a standard comment[](#start-a-thread-by-replying-to-a-standard-comment "Permalink") 在 GitLab 11.9 中[引入](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/30299) 要回復標準(非線程)評論,可以使用" **回復評論"**按鈕. [![Reply to comment button](https://img.kancloud.cn/51/1e/511e27c0a7d94cd3089b8899bd08055a_889x87.png)](img/reply_to_comment_button.png) 僅當您有權回復現有主題或從標準評論啟動主題時,才會顯示" **回復評論"**按鈕. 單擊" **回復評論"**按鈕將使回復區域成為焦點,您可以鍵入回復. [![Reply to comment feature](https://img.kancloud.cn/1e/f5/1ef5f2fed9afde74334a2ee9d459c0cd_1832x812.png)](img/reply_to_comment.gif) 提交回復后,回復非線程注釋將把非線程注釋轉換為線程. 該轉換被認為是對原始評論的修改,因此在其下方會出現一條有關上次編輯時間的注釋. 此功能僅適用于"問題","合并請求"和"事件". 尚不支持提交,摘要和合并請求差異線程. ## Assign an issue to the commenting user[](#assign-an-issue-to-the-commenting-user "Permalink") 在 GitLab 13.1 中[引入](https://gitlab.com/gitlab-org/gitlab/-/issues/191455) . 您可以將問題分配給發表評論的用戶. 在評論中,單擊" **更多操作"**菜單,然后單擊" **分配給評論用戶"** . 再次單擊按鈕以取消分配評論者. [![Assign to commenting user](https://img.kancloud.cn/4d/6b/4d6beef3a322b352e3613416861f6ecc_1654x882.png)](img/quickly_assign_commenter_v13_1.png)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看