config: improve some flags
This commit is contained in:
parent
d0b361c748
commit
9d36a94b1a
|
@ -16,7 +16,7 @@ gcn() {
|
||||||
root="$(git rev-parse --show-toplevel)"
|
root="$(git rev-parse --show-toplevel)"
|
||||||
if test "$root" = "$DATA"
|
if test "$root" = "$DATA"
|
||||||
then
|
then
|
||||||
if test $# -eq 0 || test -e $1
|
if test $# -eq 0 || test -e "$1"
|
||||||
then
|
then
|
||||||
fulldir="$(realpath ${1:-$PWD})"
|
fulldir="$(realpath ${1:-$PWD})"
|
||||||
dir="${fulldir#$root/*/}"
|
dir="${fulldir#$root/*/}"
|
||||||
|
|
|
@ -9,5 +9,6 @@ while test $# -gt 1; do
|
||||||
while ! test -e "$dir"
|
while ! test -e "$dir"
|
||||||
do dir="$(dirname "$dir")"
|
do dir="$(dirname "$dir")"
|
||||||
done
|
done
|
||||||
test $flag "$dir"
|
test -L "$dir" ||
|
||||||
|
test $flag "$dir"
|
||||||
done
|
done
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# Stage moved files fitting the already staged ones
|
||||||
|
git diff --name-only --cached >/tmp/staged
|
||||||
|
git add $(git rev-parse --show-toplevel)
|
||||||
|
git status -s | tail +2 | grep -vf /tmp/staged | cut -c4- | sed 's/ -> /\n/' | xargs git restore --staged
|
Loading…
Reference in New Issue