zsh:funcs: Add git-log-staged-files
Display the log for the staged files (excluding additions, as they do not have a history and I prefer the full log instead of nothing in that case).
This commit is contained in:
@@ -433,6 +433,18 @@ git-rebase-add-stash() {
|
|||||||
git rebase --continue
|
git rebase --continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Display the log for the staged files (excluding additions, as they do not have
|
||||||
|
# a history and I prefer the full log instead of nothing in that case).
|
||||||
|
git-log-staged-files() {
|
||||||
|
# No quotes around the filename expansion as they are only field splitted on
|
||||||
|
# newlines anyway and `git log -- ""` complains with:
|
||||||
|
#
|
||||||
|
# fatal: empty string is not a valid pathspec.
|
||||||
|
#
|
||||||
|
# As the `git-diff` command can return nothing, this is important.
|
||||||
|
git log --name-only "$@" -- ${(f)"$(git diff --name-only --cached --diff-filter=a)"}
|
||||||
|
}
|
||||||
|
|
||||||
# Create copy with a .bkp extension
|
# Create copy with a .bkp extension
|
||||||
bkp() {
|
bkp() {
|
||||||
for f; do
|
for f; do
|
||||||
|
|||||||
Reference in New Issue
Block a user