Compare commits
2 commits
ef9e2a036f
...
5f217de747
Author | SHA1 | Date | |
---|---|---|---|
5f217de747 | |||
4578a05a00 |
4 changed files with 43 additions and 70 deletions
|
@ -104,49 +104,3 @@ function gp {
|
|||
function mdtoc {
|
||||
grep --recursive --include="*.md" ^# | sort --version-sort --field-separator=":" | awk 'BEGIN {FS=":"}{print $2 "&&" $1}' | column --table --separator "&&" --table-truncate 1,2
|
||||
}
|
||||
# "scrolle" durch die commit-history
|
||||
ghist() {
|
||||
# shellcheck disable=2155
|
||||
local total_commits=$(git rev-list HEAD --count)
|
||||
local current_commit=$total_commits
|
||||
|
||||
show_commit_diff() {
|
||||
if [ "$current_commit" -le "$total_commits" ] && [ "$current_commit" -ge 1 ]; then
|
||||
# shellcheck disable=2155
|
||||
local commit_hash=$(git rev-list --reverse HEAD | sed -n "${current_commit}p")
|
||||
git --no-pager show "$commit_hash"
|
||||
fi
|
||||
}
|
||||
|
||||
while true; do
|
||||
clear # Clear the terminal
|
||||
show_commit_diff
|
||||
|
||||
# Display navigation options
|
||||
echo "-----------------------------------------------------------"
|
||||
echo "Navigation: N - Next Commit, P - Previous Commit, Q - Quit"
|
||||
echo "-----------------------------------------------------------"
|
||||
read -r -n1 -s option
|
||||
|
||||
case $option in
|
||||
p|P)
|
||||
# shellcheck disable=2086
|
||||
if [ $current_commit -gt 1 ]; then
|
||||
((current_commit--))
|
||||
fi
|
||||
;;
|
||||
n|N)
|
||||
# shellcheck disable=2086
|
||||
if [ $current_commit -lt $total_commits ]; then
|
||||
((current_commit++))
|
||||
fi
|
||||
;;
|
||||
q|Q)
|
||||
break
|
||||
;;
|
||||
*)
|
||||
echo "Invalid option"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
---
|
||||
steps:
|
||||
gitleaks:
|
||||
image: zricethezav/gitleaks:v8.18.2
|
||||
commands:
|
||||
- gitleaks detect --no-git --verbose --source $CI_WORKSPACE
|
||||
when:
|
||||
- event: [push, pull_request]
|
||||
evaluate: 'CI_COMMIT_AUTHOR_EMAIL != "renovate@mgrote.net"'
|
||||
|
||||
shellcheck:
|
||||
image: "koalaman/shellcheck-alpine:v0.10.0"
|
||||
commands:
|
||||
- |
|
||||
find . -type f -not -path './.git/*' -exec file {} \; | while IFS= read -r line; do
|
||||
if echo "$line" | grep -q "shell script"; then
|
||||
file_path=$(echo "$line" | awk -F':' '{print $1}')
|
||||
shellcheck "$file_path"
|
||||
fi
|
||||
done
|
||||
when:
|
||||
- event: [push, pull_request]
|
||||
evaluate: 'CI_COMMIT_AUTHOR_EMAIL != "renovate@mgrote.net"'
|
||||
...
|
42
scripts/ghist
Executable file
42
scripts/ghist
Executable file
|
@ -0,0 +1,42 @@
|
|||
#!/bin/bash
|
||||
total_commits=$(git rev-list HEAD --count)
|
||||
current_commit=$total_commits
|
||||
|
||||
show_commit_diff() {
|
||||
if [ "$current_commit" -le "$total_commits" ] && [ "$current_commit" -ge 1 ]; then
|
||||
commit_hash=$(git rev-list --reverse HEAD | sed -n "${current_commit}p")
|
||||
git --no-pager show "$commit_hash"
|
||||
fi
|
||||
}
|
||||
|
||||
while true; do
|
||||
clear # Clear the terminal
|
||||
show_commit_diff
|
||||
|
||||
# Display navigation options
|
||||
echo "-----------------------------------------------------------"
|
||||
echo "Navigation: N - Next Commit, P - Previous Commit, Q - Quit"
|
||||
echo "-----------------------------------------------------------"
|
||||
read -r -n1 -s option
|
||||
|
||||
case $option in
|
||||
p|P)
|
||||
# shellcheck disable=2086
|
||||
if [ $current_commit -gt 1 ]; then
|
||||
((current_commit--))
|
||||
fi
|
||||
;;
|
||||
n|N)
|
||||
# shellcheck disable=2086
|
||||
if [ $current_commit -lt $total_commits ]; then
|
||||
((current_commit++))
|
||||
fi
|
||||
;;
|
||||
q|Q)
|
||||
break
|
||||
;;
|
||||
*)
|
||||
echo "Invalid option"
|
||||
;;
|
||||
esac
|
||||
done
|
1
scripts/git_history
Symbolic link
1
scripts/git_history
Symbolic link
|
@ -0,0 +1 @@
|
|||
ghist
|
Loading…
Reference in a new issue