Compare commits
14 Commits
1f90abe997
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| c6d4bcff4f | |||
| 61ebacc776 | |||
| ba4cf18cd2 | |||
| 75b88f3a59 | |||
| 8a3b86753a | |||
| 7fb360690d | |||
| d5ae3dbfc8 | |||
| 753778c632 | |||
| 2d898122c3 | |||
| c2e3d6065c | |||
| 0514ccd0c3 | |||
| 2615350bb8 | |||
| e2218750fa | |||
| 2473202cd8 |
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
credentials
|
||||||
|
local
|
||||||
22
config
22
config
@@ -12,7 +12,7 @@
|
|||||||
awk \"{print \\$1}\" | \
|
awk \"{print \\$1}\" | \
|
||||||
sed -e ':a' -e 'N' -e '$!ba' -e 's/\\n/../g') | \
|
sed -e ':a' -e 'N' -e '$!ba' -e 's/\\n/../g') | \
|
||||||
git apply - 2> /dev/null || \
|
git apply - 2> /dev/null || \
|
||||||
echo \"\\e[31merror:\\e[39m last commit was not amended\"
|
echo "\\\\033[31merror:\\\\033[39m last commit was not amended"
|
||||||
fixup = commit --fixup
|
fixup = commit --fixup
|
||||||
squash = commit --squash
|
squash = commit --squash
|
||||||
prepare = rebase -i --fork-point
|
prepare = rebase -i --fork-point
|
||||||
@@ -21,12 +21,18 @@
|
|||||||
local = !git branch -vv | \
|
local = !git branch -vv | \
|
||||||
cut -c 3- | \
|
cut -c 3- | \
|
||||||
awk '$3 !~/\\[/ { print $1 }'
|
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
|
create = checkout -b
|
||||||
delete = branch -D
|
delete = branch -D
|
||||||
refname = rev-parse --abbrev-ref HEAD
|
refname = rev-parse --abbrev-ref HEAD
|
||||||
|
|
||||||
publish = !git push -u origin `git refname`
|
publish = !git push -u `git config --get publish.remote || echo origin` `git refname`
|
||||||
unpublish = !git push -u origin :`git refname`
|
unpublish = !git push -u `git config --get publish.remote || echo origin` :`git refname`
|
||||||
force = push --force-with-lease
|
force = push --force-with-lease
|
||||||
|
|
||||||
changes = !sh -c 'git log --oneline $1..' --
|
changes = !sh -c 'git log --oneline $1..' --
|
||||||
@@ -38,12 +44,17 @@
|
|||||||
|
|
||||||
save = commit -m "temp!"
|
save = commit -m "temp!"
|
||||||
load = !sh -c '[ \"temp!\" = \"`git show --format=%s --no-patch`\" ] && \
|
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 \"\\033[31merror:\\033[39m commit subject is not: temp!\"'
|
||||||
|
|
||||||
[core]
|
[core]
|
||||||
editor = vim
|
|
||||||
excludesfile = ~/.config/git/excludes
|
excludesfile = ~/.config/git/excludes
|
||||||
|
|
||||||
|
[init]
|
||||||
|
defaultBranch = main
|
||||||
|
|
||||||
|
[branch]
|
||||||
|
sort = -committerdate
|
||||||
|
|
||||||
[fetch]
|
[fetch]
|
||||||
prune = true
|
prune = true
|
||||||
|
|
||||||
@@ -80,3 +91,4 @@
|
|||||||
[include]
|
[include]
|
||||||
path = ~/.config/private/gitconfig
|
path = ~/.config/private/gitconfig
|
||||||
path = ~/.config/work/gitconfig
|
path = ~/.config/work/gitconfig
|
||||||
|
path = ~/.config/git/local
|
||||||
|
|||||||
4
excludes
4
excludes
@@ -1,5 +1,9 @@
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
|
.cache
|
||||||
|
.config
|
||||||
.enter
|
.enter
|
||||||
.exit
|
.exit
|
||||||
.local
|
.local
|
||||||
|
.share
|
||||||
.vim
|
.vim
|
||||||
|
compile_commands.json
|
||||||
|
|||||||
23
git-sync
Executable file
23
git-sync
Executable file
@@ -0,0 +1,23 @@
|
|||||||
|
#!/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
|
||||||
27
main.yaml
27
main.yaml
@@ -1,27 +0,0 @@
|
|||||||
---
|
|
||||||
- hosts: localhost
|
|
||||||
tasks:
|
|
||||||
- name: Clone git private config repository
|
|
||||||
git:
|
|
||||||
repo: git@code.infektor.net:benie/config.git
|
|
||||||
dest: ~/.config/private
|
|
||||||
- name: Install git homebrew packages
|
|
||||||
when: ansible_os_family == "Darwin"
|
|
||||||
homebrew:
|
|
||||||
name: gpg
|
|
||||||
state: latest
|
|
||||||
- name: Intall git pip packages
|
|
||||||
pip:
|
|
||||||
name: git+ssh://git@github.com/kbenzie/git-issue.git
|
|
||||||
extra_args: --user
|
|
||||||
state: latest
|
|
||||||
- name: Create git symbolic links
|
|
||||||
file:
|
|
||||||
state: link
|
|
||||||
src: '{{item.src}}'
|
|
||||||
dest: '{{item.dest}}'
|
|
||||||
with_items:
|
|
||||||
- src: ~/.config/git/config
|
|
||||||
dest: ~/.gitconfig
|
|
||||||
- src: ~/.config/git/_git-changes
|
|
||||||
dest: ~/.local/share/zsh/site-functions/_git-changes
|
|
||||||
11
tasks.yaml
Normal file
11
tasks.yaml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
- 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