Skip to content

Commit

Permalink
Revert change to ,gitignore.d behavior in #196
Browse files Browse the repository at this point in the history
Fixes #333.

In git 2.7.0, new git behavior changed gitignore to no longer require
un-ignoring every parent directory above an un-ignored file. vcsh
updated its logic around this in PR #196 (vcsh commit e4f4ecf).
Unfortunately, git's change was reverted before 2.8.0-rc4 (git commit
5cee349).

This change therefore reverts the logic change in #196 causing `vcsh
write-gitignore` to once again emit parent directories into generated
`.gitignore.d/<repo>` files.

See #333 for the gory details.
  • Loading branch information
jwhitley committed Dec 28, 2023
1 parent 30a2241 commit da79e9b
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions vcsh.in
Original file line number Diff line number Diff line change
Expand Up @@ -569,16 +569,11 @@ write_gitignore() {
OLDIFS=$IFS
IFS=$(printf '\n\t')
gitignores=$(for file in $(@GIT@ ls-files); do
if [ "$GIT_VERSION_MAJOR" -ge 2 ] \
&& [ "$GIT_VERSION_MINOR" -ge 7 ]; then
echo "$file";
else
while true; do
echo "$file"; new=${file%/*}
[ x"$file" = x"$new" ] && break
file=$new
done;
fi
while true; do
echo "$file"; new=${file%/*}
[ x"$file" = x"$new" ] && break
file=$new
done;
done | sort -u)

# Contrary to GNU mktemp, mktemp on BSD/OSX requires a template for temp files
Expand Down

0 comments on commit da79e9b

Please sign in to comment.