feat(sapling): move log template into the config and add switch alias
When running other log command the template I had setup in `sl` was not getting used. This has now been put into the config so its the default template for any log command. This also adds a quick alias to switch to another head. When reviewing pull requests locally this helps quickly switch between heads.
This commit is contained in:
parent
5c87f2271b
commit
73ecb1604d
2 changed files with 5 additions and 1 deletions
|
|
@ -1,10 +1,12 @@
|
||||||
# Alias sl to s. This is so we can keep the workflow much the same as git. You
|
# Alias sl to s. This is so we can keep the workflow much the same as git. You
|
||||||
# can mostly replace `g` with `s` and you are using sapling instead of git.
|
# can mostly replace `g` with `s` and you are using sapling instead of git.
|
||||||
alias s="\\sl"
|
alias s="\\sl"
|
||||||
alias sl="\\sl log --pager never --remote -T ' {graphnode} {ifeq(phase, \"public\", \"\\033[31m\", \"\\033[34m\")}{node|short}\\033[0m {truncatelonglines(desc|firstline, 80)} \\033[32m({date|age}) \\033[34;1m<{author|person}> {if(github_pull_request_number, \"\033[31mPR #{github_pull_request_number}\")}\\033[0m\n' -r '.::top() or last(::., 40)'"
|
alias sl="\\sl log --pager never --remote -r '.::top() or last(::., 40)'"
|
||||||
alias sc="\\sl commit -iv"
|
alias sc="\\sl commit -iv"
|
||||||
alias sd="\\sl diff"
|
alias sd="\\sl diff"
|
||||||
alias ss="\\sl status"
|
alias ss="\\sl status"
|
||||||
|
alias sco="\\sl log -r 'heads(draft())' -T'{node} {truncatelonglines(desc|firstline, 80)} <{author|person}>\n' | fzf | cut -d' ' -f1 | xargs \\sl goto"
|
||||||
|
|
||||||
|
|
||||||
function sl-convert() {
|
function sl-convert() {
|
||||||
if ! [ -d .git ]; then
|
if ! [ -d .git ]; then
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,8 @@ color = never
|
||||||
# (see 'sl help pager' for details)
|
# (see 'sl help pager' for details)
|
||||||
#paginate = always
|
#paginate = always
|
||||||
|
|
||||||
|
logtemplate = ' {graphnode} {ifeq(phase, "public", "\033[31m", "\033[34m")}{node|short}\033[0m {truncatelonglines(desc|firstline, 80)} \033[32m({date|age}) \033[34;1m<{author|person}>{if(github_pull_request_number, " \033[31mPR #{github_pull_request_number}")}\033[0m{if(bookmarks, " [{bookmarks}]")}\n'
|
||||||
|
|
||||||
# User delta as the pager so that the diff is highlighted nicely.in the
|
# User delta as the pager so that the diff is highlighted nicely.in the
|
||||||
# terminal. This give a better diff coloring than the built in sl pager, also
|
# terminal. This give a better diff coloring than the built in sl pager, also
|
||||||
# keeps things looking the same as git so I can keep the familiarity when
|
# keeps things looking the same as git so I can keep the familiarity when
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue