Development/gerrit/SubmitPatch/ko

    From The Document Foundation Wiki
    This page is a translated version of the page Development/gerrit/SubmitPatch and the translation is 51% complete.
    Outdated translations are marked like this.

    게릿으로 검토 받을 패치 제출하기

    검토할 패치 제출하기

    Stephan Bergmann gave a helpful presentation in FOSDEM 2021 called The Perfect Gerrit Patch - a consumer report.

    Important: there is normally never a reason to abandon your patch. Please read carefully the section about submitting a new version.

    바꾼 내용을 만들고 검토할 내용을 게릿으로 push 하십시오 (공식 게릿 문서는 여기en에 있습니다).

    git checkout -b <span lang="en" dir="ltr" class="mw-content-ltr"><a_local_branch_name_of_your_choice></span> origin/master
    # <span lang="en" dir="ltr" class="mw-content-ltr">Do your code changes, make sure it will build</span>
    git add file1 <span lang="en" dir="ltr" class="mw-content-ltr">[file2 ...] # all the new files _and_ changed files</span>
    git commit
    ./logerrit submit master

    참고: `logerrit` 명령을 동작하게끔 게릿 설정을 했는지 먼저 확인하십시오. 방법은 여기en에 있습니다.

    The first command creates a new branch, and makes it track origin/master remote branch. This allows following ./g pull -r to rebase your branch automatically on the latest master, which may be a necessary precondition to submit, when your branch gets older than a week.

    If you had created a branch without specifying a remote branch to track, and now ./g pull -r doesn't rebase the branch automatically, you may also use command git branch -u origin/master on an existing branch to start tracking.

    참고: git add + git commit 단계는 'git gui' 명령으로 처리할 수 있으며, 제출 제목줄은 65문자를 넘으면 안되며, 제출 메시지는 한 줄 당 문자 갯수가 70개를 넘으면 안됨을 기억하세요.

    참고: 마스터 브랜치로 제출하고나면, 마스터 브랜치 최근 버전으로 (re)base하여, 젠킨스에서 가능한한 ccache를 통해 CI 를 빌드하는 이득을 취할 수 있습니다.

    참고: 리브레오피스는 정해둔 규칙에 따르기 위해 패치를 점검할 때 clang-format을 따릅니다. clang-format의 특정 버전을 활용합니다(이렇게 하여 마이너 출시버전 간 그리고 다른 버전간의 비일관성 문제를 해결합니다). 시스템에 clang-format 을 미리 설치해두지 않으면, git commit 을 실행할 때 경고가 뜨며, 필요한 바이너리를 어떻게 설치하는지에 대한 방법도 나타납니다. 어떤 버전을 미리 설치해두었다면, 경고는 뜨지 않거나(다만 일관적이지 못한 결과물로 빌드봇에서 문제가 나타나면 다른 방식으로 포매팅을 바꾸라고 알려줍니다), 미리 설치한 버전이 동작하지 않을 수도 있습니다(명령행 옵션에 문제가 있다는 식으로 메시지가 뜨거나...). 리브레오피스에서 사용하는 버전은 다음 주소에서 찾을 수 있습니다: https://dev-www.libreoffice.org/bin/.

    마지막 줄은 특별한 내용이며 master 브랜치의 검토 큐에 대한 리뷰 큐로 이름이 붙은 로컬 브랜치로 모든 패치를 push 합니다(릴리즈 브랜치 또는 다른 브랜치 중 한 곳으로 패치를 제출하려 한다면, 바로 수정하세요). 보통의 기여자분들은 전자메일 주소를 게릿 계정과 맞추셔야합니다. 그렇지 않으면 push할 수 없습니다.

    push가 끝나면, git에서 검토 대기중인 주소를 알려줍니다. URL은 https://gerrit.libreoffice.org/#/c/229/ 비스무레하게 나타냅니다.

    패치를 검토하는 중에는 패치의 새 버전을 쉽게 올릴 수 있도록 로컬 브랜치를 그대로 두는게 좋습니다. 그 동안에

    git checkout master

    명령으로 마스터 브랜치로 돌아올 수 있... 고 위 과정을 통해 다른 패치 작업을 시작할 수 있습니다(로컬 브랜치를 만들고, 코드 작성후, 제출, 그리고 게릿으로 push).

    기여자 명단에 자신을 추가하기

    리브레오피스 프로젝트에 처음 패치를 기여한다면, 개발자 및 기여자 명단en에 우선 자신을 추가하고(방법은 페이지에 다 나와있습니다) 기여 라이선스 상태를 적어넣으십시오.

    Please only send the statement no earlier than when you post your first submission to gerrit and ensure you have permission from your parents!

    패치 제출 더 보기

    위 내용 말고도, Development/GitReviewen에서 설명하는대로 "git review" 명령을 사용해볼 수 있습니다.

    Reviewing patches

    The next step after submitting a patch is collaboratively reviewing it on gerrit. See Development/gerrit/PatchReview to learn more.

    패치 제출에 대한 일부 자세한 내용

    새 버전 제출

    패치 중 하나를 검토중인 경우 새 버전을 제출하려고 할 때 다음 명령을 내리세요:

    git checkout <div lang="en" dir="ltr" class="mw-content-ltr">
    <local_branch_associated_with_your_patch>
    <do your modification>
    </div>
    git add ...
    git commit --amend  # <span lang="en" dir="ltr" class="mw-content-ltr">this modifies the last commit on the branch rather than creating a new one</span>
    ./logerrit submit master

    게릿에서는 기존 내용의 새 버전을 알아서 찾습니다(어우~ 고마우셔라... Change-Id).

    Tip.svg

    Tip:
    --amend를 깜빡 잊고 사용하지 못한 상태에서 이미 두번 제출한 상태라면, 해당 제출 내용을 git rebase -i 명령으로 병합할 수 있습니다. 방법은 Git For LibreOffice Developers을 참고하세요.

    git review로 바뀐 내용을 다시 수정하고 패치 새 버전을 제출하기

    위 방법대로 바뀐 내용을 개정하면 쉽사리 혼동이 오고 local_branch_associated_with_your_patch 추적 상태는 오류에 취약하게 됩니다(어떻게 붙었을까?). 여러 변경 패치를 게릿에 제출하면 마스터 브랜치에서 관리하며, 따로 개정하는게 안됩니다. 이렇게 되면 매번 제출할 때마다 HEAD^로 되돌리고 다운로드/수정/개정/제출/되돌리기를 매 패치 세트마다 해야 하거나, 각 브랜치별로 해아합니다. 이 과정은 git review 로 쉽게 해결할 수 있습니다.

    어떻게 하는지는 Development/GitReview#Amending_a_gerrit_changeen 문서를 참고하세요.

    Submitting patches as private or work-in-progress

    If you use ./logerrit submit master%private instead of ./logerrit submit master, you will create a private change.

    Such a change will only be visible to yourself and whoever you add as a reviewer with the 'add reviewer' button in gerrit.

    If you don't need to hide your change from the general public, you can use ./logerrit submit master%wip to create a work-in-progress change.

    If you are not using logerrit, push to refs/for/branch%private or refs/for/branch%wip.

    You can also toggle the private and WIP states from the gerrit UI.

    dictionaries, helpcontent2, translations 하위 모듈에 검토 대상 패치 제출

    Submodulesen 페이지를 참고하세요.

    Cherry picking yourself out of trouble

    Ignoring the advice about submitting new versions of patches is common. This might lead to deleting a local branch or submitting a new patch depending on an older patch. In order to work on your original patch locally again, do the following:

    1. In a terminal, check out a new branch from master
    2. Click the kebab menu in the top right corner of the Gerrit patch view
    3. Select Download patch
    4. Click the copy button next to Cherry Pick
    5. Paste the copied command into your terminal
    6. Follow the modifying and amending advice from the section about submitting a new version