From 980cf95c728f02610649fc4dee37a24f00d8dfd3 Mon Sep 17 00:00:00 2001
From: Richard Hartmann <richih.mailinglist@gmail.com>
Date: Tue, 22 Nov 2011 19:46:53 +0100
Subject: [PATCH] Improve seeg-gitignore to work around git's issues; still not
 happy

---
 vcsh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

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" &&
-- 
GitLab