~tardypad/dotfiles

ref: 7dd5e02494e2821ff6b4fd5758a590ef03b5403b dotfiles/packages/git/config.d/aliases -rw-r--r-- 4.1 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
[alias]
    aa = add --all
    amend = commit --amend -a --no-edit
    argument= "! \
        h() {  \
          if [[ -z $1 ]]; then \
            echo HEAD; \
          elif [[ $1 =~ [0-9]+ ]] && ! git rev-parse --verify $1 &> /dev/null; then \
            echo HEAD~$1; \
          else \
            echo $1; \
          fi \
        }; h"
    bl = blame --color-by-age --color-lines
    br = branch
    brd = branch -D
    browse = "! \
        f() { \
          URL=$( git url $@ ); \
          [[ -z \"${URL}\" ]] && return 1; \
          xdg-open \"${URL}\"; \
        }; f"
    bw = browse
    bwc = "! f() { git browse --type commit --commit $( git argument $1 ); }; f"
    bwi = "! f() { git browse --type issue --commit $( git argument $1 ); }; f"
    bwr = "! f() { git browse --type review --commit $( git argument $1 ); }; f"
    cb = checkout -b
    ci = commit
    cia = commit -a
    cl = clone
    co = checkout
    coma = checkout master
    commit-description = "! \
        f() { \
          git log -1 $( git argument $1 ) --pretty=%b \
          | grep -vE 'Issue|Reviewed at|^$'; \
        }; f"
    commit-issue-id = "! \
        f() { \
          git log -1 $( git argument $1 ) --pretty=%b \
          | grep 'Issue' \
          | tail --lines 1 \
          | sed -r 's%.* ([A-Za-z0-9-]+).*%\\1%'; \
        }; f"
    commit-review-id = "! \
        f() { \
          git log -1 $( git argument $1 ) --pretty=%b \
          | grep 'Reviewed at' \
          | tail --lines 1 \
          | sed -r 's%.*/r/([0-9]+)/%\\1%'; \
        }; f"
    commit-subject = "! \
        f() { \
          git log -1 $( git argument $1 ) --pretty=%s; \
        }; f"
    count = rev-list --count HEAD
    cfg = config --includes
    cp = cherry-pick
    cpa = cherry-pick --abort
    cpc = cherry-pick --continue
    current-branch = symbolic-ref --short HEAD
    df = diff
    df0 = diff --unified=0
    dfc = diff --cached
    dfc0 = diff --cached --unified=0
    fe = fetch --all
    first-commit = ! git rev-list --max-parents=0 HEAD | tail --lines 1
    hist = "! \
        f() { \
          git log --color --oneline --max-count=10 \"$@\" \
            | nl --starting-line-number=0 --number-width=2 --number-separator=' '; \
        }; f"
    issue = stamp -r Issue
    head = "! f() { git whatchanged -1 $( git argument $1 ); }; f"
    log1 = log --oneline
    mg = merge
    mga = merge --abort
    mgc = merge --continue
    mgrbma = "!f(){ git co $1 && git rbma && git coma && git mg -; }; f"
    pl = pull
    push-perso = "!git push origin --set-upstream HEAD:$(git current-branch)"
    push-upstream = "!git push upstream HEAD:$(git current-branch)"
    rb = rebase
    rbma = rebase -i master
    rba = rebase --abort
    rbc = rebase --continue
    rbi = "! f() { git rebase -i $( git argument $1 ); }; f"
    recent = "! \
        git for-each-ref --count=5 --sort=-committerdate --color \
        --format \"%(HEAD) %(color:$(git config color.recent.refname))%(refname:short)%(color:reset) | %(color:$(git config color.recent.committerdate))%(committerdate:human)%(color:reset) | %(subject)\" refs/heads \
        | column --table --separator '|'"
    reword = commit --amend
    reset-upstream = reset --hard @{upstream}
    root = rev-parse --show-toplevel
    rv = revert
    rva = revert --abort
    rvc = revert --continue
    sh = "! f() { git show $( git argument $1 ); }; f"
    sh0 = "! f() { git show --unified=0 $( git argument $1 ); }; f"
    st = status --short --branch
    tag-list = "! \
        git tag --sort=creatordate --color \
        --format \"%(color:$(git config color.tag-list.refname))%(refname:short)%(color:reset) | %(taggerdate:iso) | %(taggeremail) | %(subject)\" \
        | column --table --separator '|'"
    urlc = "! f() { git url --type commit --commit $( git argument $1 ); }; f"
    urli = "! f() { git url --type issue --commit $( git argument $1 ); }; f"
    urlr = "! f() { git url --type review --commit $( git argument $1 ); }; f"
    wip = "! \
        git add --all \
        && git commit --message WIP \
        && git push --force origin HEAD:wip-$(git current-branch) \
        && git reset HEAD~"