Compare commits
1 Commits
master
...
24f77fb550
| Author | SHA1 | Date | |
|---|---|---|---|
| 24f77fb550 |
9
.conduit.yaml
Normal file
9
.conduit.yaml
Normal file
@@ -0,0 +1,9 @@
|
||||
---
|
||||
- location: ~/.config/git
|
||||
- symlink:
|
||||
- {src: config, dst: ~/.gitconfig}
|
||||
- {src: _git-changes, dst: ~/.local/share/zsh/site-functions/_git-changes}
|
||||
- {src: _git-fixup, dst: ~/.local/share/zsh/site-functions/_git-fixup}
|
||||
- {src: _git-squash, dst: ~/.local/share/zsh/site-functions/_git-squash}
|
||||
- repo:
|
||||
- git@code.infektor.net:benie/config.git
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +0,0 @@
|
||||
credentials
|
||||
16
README.md
16
README.md
@@ -8,16 +8,19 @@ rather than remembering the plumbing term of a specific command.
|
||||
* `abandon` abandons all local changes leave a clean repository.
|
||||
* `unstage` unstage staged changes, shorthand for `git reset -q HEAD --`.
|
||||
* `amend` amends the last commit, shorthand for `git commit --amend`.
|
||||
* `unamend` applies a negative diff of the last `git commit --amend`.
|
||||
* `fixup` prepare to fixup a commit, shorthand for `git commit --fixup`.
|
||||
* `squash` prepare to squash a commit, shorthand for `git commit --squash`.
|
||||
* `fixup` prepare a fixup commit for use with `git rebase --autosquash`,
|
||||
shorthand for `git commit --fixup=<commit>`.
|
||||
* `squash` prepare a squash commit for use with `git rebase --autosquash`,
|
||||
shorthand for `git commit --squash=<commit>`.
|
||||
* `prepare` prepare a branch for merging into another, shorthand for
|
||||
`git rebase --interactive --fork-point`.
|
||||
* `list` list local branches, a shorthand for `git branch`.
|
||||
* `local` list local branches which don't have remote tracking branches.
|
||||
* `create` creates a new branch, shorthand for `git checkout -b`.
|
||||
* `delete` deletes an existing branch, shorthand for `git branch -D`.
|
||||
* `refname` the name of the current branch.
|
||||
* `name` the name of the current branch.
|
||||
* `last` the name of the last branch checked out before the current branch.
|
||||
* `checkout-last` checkout the last branch, shorthand for
|
||||
`git checkout $(git last)`.
|
||||
* `publish` push and set the tracking branch of a local branch to origin,
|
||||
shorthand for `git push -u origin <branch>`.
|
||||
* `unpublish` delete a remote branch, shorthand for `git push origin :<branch>`.
|
||||
@@ -26,7 +29,6 @@ rather than remembering the plumbing term of a specific command.
|
||||
* `changes` compare the list of commits on the local branch to another branch,
|
||||
e.g. when on a feature branch `git changes master` lists the commits which are
|
||||
not present on the master branch.
|
||||
* `touched` lists the files which were touched by a selected commit.
|
||||
* `save` like pushing to the stash but attached to the current branch, shorthand
|
||||
for `git commit -am "temp!"`.
|
||||
* `load` like popping from the stash but attached to the current branch, if
|
||||
@@ -41,6 +43,8 @@ rely on the shell to function. The following aliases extend the default
|
||||
[Git][git] completions.
|
||||
|
||||
* `git changes` completions for the branch name to compare with are provided.
|
||||
* `git fixup`/`git squash` completions for recent commits to fixup/squash are
|
||||
provided.
|
||||
|
||||
[git]: https://git-scm.com
|
||||
[aliases]: https://git-scm.com/book/en/v2/Git-Basics-Git-Aliases
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#compdef git-changes
|
||||
#description Compare changes on this branch with another.
|
||||
|
||||
_alternative \
|
||||
'branches::__git_branch_names' \
|
||||
'remote-branches::__git_remote_branch_names'
|
||||
_arguments '1: :__git_remote_branch_names_noprefix'
|
||||
|
||||
# vim: ft=zsh
|
||||
|
||||
6
_git-fixup
Normal file
6
_git-fixup
Normal file
@@ -0,0 +1,6 @@
|
||||
#compdef git-fixup
|
||||
#description Prepare a commit for fixup during autosquash rebase.
|
||||
|
||||
_arguments '1: :__git_recent_commits'
|
||||
|
||||
# vim: ft=zsh
|
||||
6
_git-squash
Normal file
6
_git-squash
Normal file
@@ -0,0 +1,6 @@
|
||||
#compdef git-squash
|
||||
#description Prepare a commit for squashing during autosquash rebase.
|
||||
|
||||
_arguments '1: :__git_recent_commits'
|
||||
|
||||
# vim: ft=zsh
|
||||
70
config
70
config
@@ -1,93 +1,63 @@
|
||||
# vim: ft=gitconfig
|
||||
|
||||
[alias]
|
||||
root = rev-parse --show-toplevel
|
||||
|
||||
abandon = !git reset --hard HEAD && git clean -d -f
|
||||
uncommit = !git reset --soft HEAD~1 && git unstage
|
||||
unstage = reset -q HEAD --
|
||||
|
||||
amend = commit --amend
|
||||
unamend = !git diff $(git reflog -2 | \
|
||||
awk \"{print \\$1}\" | \
|
||||
sed -e ':a' -e 'N' -e '$!ba' -e 's/\\n/../g') | \
|
||||
git apply - 2> /dev/null || \
|
||||
echo \"\\e[31merror:\\e[39m last commit was not amended\"
|
||||
fixup = commit --fixup
|
||||
squash = commit --squash
|
||||
fixup = !sh -c 'git commit --fixup=$1' --
|
||||
squash = !sh -c 'git commit --squash=$1' --
|
||||
prepare = rebase -i --fork-point
|
||||
|
||||
list = branch
|
||||
local = !git branch -vv | \
|
||||
cut -c 3- | \
|
||||
awk '$3 !~/\\[/ { print $1 }'
|
||||
recent = !git reflog show --pretty=format:'%gs ~ %gd' --date=relative | \
|
||||
grep 'checkout:' | \
|
||||
grep -oE '[^ ]+ ~ .*' | \
|
||||
awk -F~ '!seen[$1]++' | \
|
||||
head -n 10 | \
|
||||
awk -F ' ~ HEAD@{' '{printf(\" %s \\033[33m%s\\033[0m\\n\", $1, substr($2, 1, length($2)-1))}'
|
||||
create = checkout -b
|
||||
delete = branch -D
|
||||
refname = rev-parse --abbrev-ref HEAD
|
||||
name = rev-parse --abbrev-ref HEAD
|
||||
last = !sh -c 'git reflog | grep \" checkout: moving from\" | head -n 1 | awk \"{ print \\$6 }\"'
|
||||
checkout-last = !git checkout `git last`
|
||||
|
||||
publish = !git push -u `git config --get publish.remote || echo origin` `git refname`
|
||||
unpublish = !git push -u `git config --get publish.remote || echo origin` :`git refname`
|
||||
publish = !git push -u origin `git name`
|
||||
unpublish = !git push -u origin :`git name`
|
||||
force = push --force-with-lease
|
||||
|
||||
changes = !sh -c 'git log --oneline $1..' --
|
||||
touched = diff-tree --no-commit-id --name-only -r
|
||||
tree = log --graph --format=format:'%C(yellow)%h%C(reset) \
|
||||
%C(blue)%aD%C(reset) %C(green)(%ar)%C(reset)%C(bold)%d%C(reset)%n \
|
||||
%C(white)%s%C(reset) %C(dim white)- %an%C(reset)'
|
||||
tracking = rev-parse --abbrev-ref --symbolic-full-name @{u}
|
||||
tree = log --graph --abbrev-commit --oneline --decorate \
|
||||
--format=format:'%C(yellow)%h%C(reset) %C(blue)%aD%C(reset) %C(green)(%ar)%C(reset)%C(bold)%d%C(reset)%n %C(white)%s%C(reset) %C(dim white)- %an%C(reset)'
|
||||
|
||||
save = commit -m "temp!"
|
||||
save = commit -am "temp!"
|
||||
load = !sh -c '[ \"temp!\" = \"`git show --format=%s --no-patch`\" ] && \
|
||||
git reset --mixed HEAD~ || echo \"\\e[31merror:\\e[39m commit subject is not: temp!\"'
|
||||
git reset --mixed HEAD~ || echo \"error: commit subject is not: temp!\"'
|
||||
|
||||
[commit]
|
||||
verbose = true
|
||||
|
||||
[core]
|
||||
editor = vim
|
||||
excludesfile = ~/.config/git/excludes
|
||||
|
||||
[init]
|
||||
defaultBranch = main
|
||||
|
||||
[branch]
|
||||
sort = -committerdate
|
||||
|
||||
[fetch]
|
||||
prune = true
|
||||
|
||||
[help]
|
||||
autocorrect = -1
|
||||
|
||||
[merge]
|
||||
tool = vimdiff
|
||||
conflictstyle = diff3
|
||||
prompt = false
|
||||
|
||||
[pager]
|
||||
status = true
|
||||
|
||||
[push]
|
||||
default = simple
|
||||
|
||||
[pull]
|
||||
rebase = false
|
||||
|
||||
[rebase]
|
||||
autoSquash = true
|
||||
|
||||
[user]
|
||||
useConfigOnly = true
|
||||
|
||||
[diff]
|
||||
tool = vimdiff
|
||||
algorithm = patience
|
||||
[difftool]
|
||||
prompt = false
|
||||
|
||||
[merge]
|
||||
tool = vimdiff2
|
||||
algorithm = patience
|
||||
[mergetool]
|
||||
prompt = false
|
||||
|
||||
[include]
|
||||
path = ~/.config/private/gitconfig
|
||||
path = ~/.config/work/gitconfig
|
||||
|
||||
8
excludes
8
excludes
@@ -1,9 +1,3 @@
|
||||
.DS_Store
|
||||
.cache
|
||||
.config
|
||||
.local
|
||||
.enter
|
||||
.exit
|
||||
.local
|
||||
.share
|
||||
.vim
|
||||
compile_commands.json
|
||||
|
||||
23
git-sync
23
git-sync
@@ -1,23 +0,0 @@
|
||||
#!/usr/bin/env zsh
|
||||
|
||||
autoload -U colors && colors
|
||||
|
||||
git_sync=${GIT_SYNC:-~/.config/git-sync}
|
||||
|
||||
if [ ! -f "$git_sync" ]; then
|
||||
echo "$fg[yellow]warning:${reset_color} sync list does not exist: $git_sync"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
||||
local repos=($(cat $git_sync))
|
||||
if [ ${#repos[@]} = 0 ]; then
|
||||
echo "$fg[yellow]warning:${reset_color} sync list is empty: $git_sync"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
for repo in $repos; do
|
||||
print -P "$fg[cyan]synchronizing: $repo${reset_color}"
|
||||
repo="${repo/#\~/$HOME}"
|
||||
git -C "$repo" fetch
|
||||
done
|
||||
11
tasks.yaml
11
tasks.yaml
@@ -1,11 +0,0 @@
|
||||
---
|
||||
- name: git create symbolic links
|
||||
file:
|
||||
state: link
|
||||
src: '{{item.src}}'
|
||||
dest: '{{item.dest}}'
|
||||
with_items:
|
||||
- src: ~/.config/git/_git-changes
|
||||
dest: ~/.local/share/zsh/site-functions/_git-changes
|
||||
- src: ~/.config/git/git-sync
|
||||
dest: ~/.local/bin/git-sync
|
||||
Reference in New Issue
Block a user