Created
July 26, 2023 11:47
-
-
Save nkh/75bd5ab4dd98651a4b3d657b4b14339b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
declare -A git_status | |
while IFS= read -r -d $'\0' line ; do git_status[${line:3}]="${line:0:2}" ; done < <(git status $@ --porcelain -z) | |
while IFS= read line ; do [ ! "${git_status[$line]}" ] && git_status[$line]=" " ; done | |
for file in "${!git_status[@]}" ; do | |
echo "$file" >&3 | |
echo "${git_status[$file]}" >&4 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment