~tardypad/dotfiles

ref: 7dd5e02494e2821ff6b4fd5758a590ef03b5403b dotfiles/packages/rbtools/reviewboardrc -rw-r--r-- 2.3 KiB
7dd5e024 — Damien Tardy-Panis add mako package config 3 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
TRACKING_BRANCH = "origin/master"
STAMP_WHEN_POSTING = True
OPEN_BROWSER = False
PUBLISH = False

ALIASES = {
    'post-head': '! \
        review_id=`git commit-review-id`; \
        if [[ -z "${review_id}" ]]; then \
            repository=`grep REPOSITORY .reviewboardrc | grep -o \'".*"\' | tr -d \\"`; \
            commit_subject=`git commit-subject`; \
            commit_description=`git commit-description`; \
            current_branch=`git current-branch`; \
            issue_id=`git commit-issue-id`; \
            diff_url=`rbt post \
              --summary "[${repository}] ${commit_subject}" \
              --description "${commit_description:-$commit_subject} " \
              --branch "${current_branch}" \
              --bugs-closed "${issue_id:-NONE}" \
              --testing-done "unit tests" \
              --parent HEAD~ \
              | grep diff`; \
        else \
          diff_url=`rbt post \
            --update \
            --review-request-id "$review_id" \
            --parent HEAD~ \
            | grep diff`; \
        fi; \
        xdg-open "${diff_url}"; \
    ',
    'publish-head': '! \
        review_id=`git commit-review-id`; \
        rbt publish "${review_id}"; \
    ',
    'publish-all': '! \
        rbt status \
          | grep Draft \
          | cut -f2 -d/ \
          | cut -f1 -d- \
          | tr -d " " \
          | sort \
          | xargs -I {} rbt publish {}; \
    ',
    'discard-head': '! \
        review_id=`git commit-review-id`; \
        rbt close --close-type discarded "${review_id}"; \
    ',
    'submit-head': '! \
        review_id=`git commit-review-id`; \
        rbt close --close-type submitted "${review_id}"; \
    ',
    'submit-all': '! \
        rbt status \
          | grep "r/" \
          | cut -f2 -d/ \
          | cut -f1 -d- \
          | tr -d " " \
          | sort \
          | xargs -I {} rbt close --close-type submitted {}; \
    ',
    'apply': '! \
        rbt patch --commit-no-edit $1; \
        git commit --amend \
            -m \'`  \
                git log -1 --pretty=%s \
                | sed "s/^\[.*\] //" \
            `\' \
            -m \'` \
                git log -1 --pretty=%b \
                    | sed "/Testing Done/,/^\s*$/{d}" \
                    | sed "s/^Bugs closed/Issue/"\
            `\' \
    '
}