init .config git tracking
This commit is contained in:
commit
114c330966
151 changed files with 4688 additions and 0 deletions
21
config/fish/functions/gtest.fish
Normal file
21
config/fish/functions/gtest.fish
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
# gtest: test a command against git staged changes.
|
||||
#
|
||||
# example usage:
|
||||
# gtest make test
|
||||
function gtest -d "test command on staged changes only"
|
||||
# Stash working dir, keeping index changes.
|
||||
git stash push -q --keep-index --include-untracked; or return
|
||||
|
||||
# Run test command against index changes only.
|
||||
command $argv
|
||||
set cmdstatus $status
|
||||
|
||||
# Return working dir and index to original state.
|
||||
# Note: reset + restore is required to prevent merge conflicts
|
||||
# when popping the stash.
|
||||
git reset -q
|
||||
git restore .
|
||||
git stash pop -q --index; or return $status
|
||||
|
||||
return $cmdstatus
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue