Skip to content

Commit

Permalink
Auto-configure ignoreRevsFile for git blame
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiX committed Aug 26, 2023
1 parent 260151d commit 9d1674c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
1 change: 0 additions & 1 deletion dot.config-git/config
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
serve = daemon --reuseaddr --verbose --base-path=. --export-all ./.git
timeline = log --oneline --graph --decorate
[blame]
ignoreRevsFile = .git-blame-ignore-revs
markIgnoredLines = true
markUnblamableLines = true
[branch]
Expand Down
21 changes: 19 additions & 2 deletions zsh/rc.apps
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@ then
alias td='todo' # For devtodo, two chars shorter :)
alias tdl='todo --link' # Debian...

# Called on every directory change!
chpwd ()
# Run on directory changes
functions[chpwd]="${functions[chpwd]//chpwd_devtodo}
chpwd_devtodo"

chpwd_devtodo ()
{
[[ -t 0 && -r .todo ]] && devtodo "$TODO_OPTIONS[@]"
}
Expand Down Expand Up @@ -62,6 +65,20 @@ then
}
fi

if [[ -x =git ]]
then
functions[chpwd]="${functions[chpwd]//chpwd_gitblame}
chpwd_gitblame"

chpwd_gitblame ()
{
if [[ -d .git && -f .git-blame-ignore-revs ]]
then
git config blame.ignoreRevsFile .git-blame-ignore-revs
fi
}
fi

# PostgreSQL XDG redirects
if [[ -x =psql ]]
then
Expand Down

0 comments on commit 9d1674c

Please sign in to comment.