From: Richard Hartmann Date: Tue, 22 Nov 2011 18:46:53 +0000 (+0100) Subject: Improve seeg-gitignore to work around git's issues; still not happy X-Git-Url: https://git.madduck.net/code/vcsh.git/commitdiff_plain/980cf95c728f02610649fc4dee37a24f00d8dfd3?ds=sidebyside;hp=31149fc284678effd9ab58aaff41c67175e9e866 Improve seeg-gitignore to work around git's issues; still not happy --- diff --git a/vcsh b/vcsh index bcd416c..d583dbc 100755 --- a/vcsh +++ b/vcsh @@ -214,12 +214,13 @@ elif [ "$VCSH_COMMAND" = 'seed-gitignore' ]; then [ "$file" = "$new" ] && break file="$new" done; - done | sort -u | sed 's/^/!/') + done | sort -u) tempfile=$(mktemp) || (echo "$SELF: fatal: could not create tempfile" && exit 1) echo '*' > "$tempfile" for gitignore in $gitignores; do - echo "$gitignore" >> "$tempfile" + echo "$gitignore" | sed 's/^/!/' >> "$tempfile" + [ -d "$gitignore" ] && echo "$gitignore/*" | sed 's/^/!/'>> "$tempfile" done diff -N "$tempfile" "$HOME/.gitignore.d/$VCSH_REPO_NAME" > /dev/null && rm -f "$tempfile" &&