Is there a way to get the same output directly from git?
Nope. You can handle spaces in filenames by setting IFS
though, and git status
is doing some hidden recursing, to not do any of it you can use find
's depth cutoff:
(IFS=$'
'; ls -ltrh $(git ls-files -o `find -maxdepth 1 ! -type d`))
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…