Skip to content

Instantly share code, notes, and snippets.

@itsjohncs
Created January 22, 2022 03:42
Show Gist options
  • Save itsjohncs/2d64f438a0c5366d6960ae250cad714c to your computer and use it in GitHub Desktop.
Save itsjohncs/2d64f438a0c5366d6960ae250cad714c to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -euo pipefail
mapfile -t RESULT < <(
xargs -0r printf "%s\n" |
git check-ignore --non-matching --stdin --verbose |
grep "^::" |
cut -c 4-
)
printf "%s\0" "${RESULT[@]}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment