Skip to content

Commit bdc2974

Browse files
committed
.git/info/exclude instead of multiple .gitignore
#107
1 parent 035ccc9 commit bdc2974

File tree

6 files changed

+36
-43
lines changed

6 files changed

+36
-43
lines changed

buddypressorg.dev/provision/vvv-init.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ if [ ! -L $SITE_DIR ]; then
4646

4747
# Ignore external dependencies and Meta Environment tweaks
4848
IGNORED_FILES=(
49-
/wordpress
50-
/wp-content/mu-plugins/sandbox-functionality.php
51-
/wp-config.php
49+
**/wordpress
50+
**/wp-content/mu-plugins/sandbox-functionality.php
51+
**/wp-config.php
5252
)
5353
IGNORED_FILES=( "${IGNORED_FILES[@]}" "${SVN_PLUGINS[@]}" "${WPCLI_PLUGINS[@]}" )
54-
wme_create_gitignore $SITE_DIR
54+
wme_create_git_exclude "$BASE_DIR/meta-repository"
5555

5656
else
5757
printf "\n#\n# Updating $SITE_DOMAIN\n#\n"

helper-functions.sh

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,15 @@ function wme_symlink_logs_dir {
4747
mkdir -p $LOGS_DIR_PATH
4848
}
4949

50-
# Add entries to a .gitignore file
51-
#
52-
# todo use .git/info/exclude instead, that's more appropriate for this situation
50+
# Add entries to the .git/info/exclude file
5351
#
5452
# $1 - the site's web root
55-
function wme_create_gitignore {
56-
# Ignore the .gitignore file itself
57-
echo "/.gitignore" >> $1/.gitignore
58-
53+
function wme_create_git_exclude {
5954
for i in "${IGNORED_FILES[@]}"
6055
do :
61-
echo "$i" >> $1/.gitignore
56+
echo "$i" >> $1/.git/info/exclude
6257
done
58+
awk '!a[$0]++' $1/.git/info/exclude > exclude && mv exclude $1/.git/info/exclude
6359
}
6460

6561
# Download the global WordPress.org header into the given directory.

jobs.wordpressnet.dev/provision/vvv-init.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ if [ ! -L $SITE_DIR ]; then
3737

3838
# Ignore external dependencies and Meta Environment tweaks
3939
IGNORED_FILES=(
40-
/wordpress
41-
/wp-content/mu-plugins/sandbox-functionality.php
42-
/wp-content/plugins/si-contact-form
43-
/wp-config.php
40+
**/wordpress
41+
**/wp-content/mu-plugins/sandbox-functionality.php
42+
**/wp-content/plugins/si-contact-form
43+
**/wp-config.php
4444
)
45-
wme_create_gitignore $SITE_DIR
45+
wme_create_git_exclude "$BASE_DIR/meta-repository"
4646

4747
else
4848
printf "\n#\n# Updating $SITE_DOMAIN\n#\n"

wordcamp.dev/provision/vvv-init.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ if [ ! -L $SITE_DIR ]; then
5252

5353
# Ignore external dependencies and Meta Environment tweaks
5454
IGNORED_FILES=(
55-
/wordpress
56-
/wp-content/mu-plugins/sandbox-functionality.php
57-
/wp-content/plugins/camptix
58-
/wp-config.php
55+
**/wordpress
56+
**/wp-content/mu-plugins/sandbox-functionality.php
57+
**/wp-content/plugins/camptix
58+
**/wp-config.php
5959
)
6060
IGNORED_FILES=( "${IGNORED_FILES[@]}" "${SVN_PLUGINS[@]}" "${WPCLI_PLUGINS[@]}" "${WPCLI_THEMES[@]}" )
61-
wme_create_gitignore $SITE_DIR
61+
wme_create_git_exclude "$BASE_DIR/meta-repository"
6262

6363
else
6464
printf "\n#\n# Updating $SITE_DOMAIN\n#\n"

wordpressorg.dev/provision/vvv-init.sh

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ fi
1414
PROVISION_DIR="$BASE_DIR/$SITE_DOMAIN/provision"
1515
SITE_DIR="$BASE_DIR/$SITE_DOMAIN/public_html"
1616
SVN_PLUGINS=( akismet bbpress debug-bar debug-bar-cron email-post-changes speakerdeck-embed supportflow syntaxhighlighter wordpress-importer )
17+
GIT_PLUGINS=( phpdoc-parser glotpress wp-multibyte-patch )
1718
WPCLI_PLUGINS=( jetpack tinymce-code-element wp-multibyte-patch )
19+
THEMES=( twenty* rosetta p2 )
1820
WP_LOCALES=( ja es_ES )
1921

2022
wme_svn_git_migration $SITE_DIR
@@ -98,24 +100,19 @@ if [ ! -L $SITE_DIR ]; then
98100

99101
# Ignore external dependencies and Meta Environment tweaks
100102
IGNORED_FILES=(
101-
/wordpress
102-
/wp-content/languages
103-
/wp-content/mu-plugins/cavalcade*
104-
/wp-content/mu-plugins/global_wordpressorg_dev
105-
/wp-content/mu-plugins/sandbox-functionality.php
106-
/wp-content/plugins/phpdoc-parser
107-
/wp-content/plugins/glotpress
108-
/wp-content/themes/p2
109-
/wp-content/themes/rosetta
110-
/wp-content/themes/twenty*
111-
/wp-content/sunrise.php
112-
/footer.php
113-
/header.php
114-
/wp-config.php
115-
/wp-cli.yml
103+
**/wordpress
104+
**/wp-content/languages
105+
**/wp-content/mu-plugins/cavalcade*
106+
**/wp-content/mu-plugins/global_wordpressorg_dev
107+
**/wp-content/mu-plugins/sandbox-functionality.php
108+
**/wp-content/sunrise.php
109+
wordpress.org/footer.php
110+
wordpress.org/header.php
111+
**/wp-config.php
112+
**/wp-cli.yml
116113
)
117-
IGNORED_FILES=( "${IGNORED_FILES[@]}" "${SVN_PLUGINS[@]}" "${WPCLI_PLUGINS[@]}" )
118-
wme_create_gitignore $SITE_DIR
114+
IGNORED_FILES=( "${IGNORED_FILES[@]}" "${SVN_PLUGINS[@]}" "${GIT_PLUGINS[@]}" "${WPCLI_PLUGINS[@]}" "${THEMES[@]}" )
115+
wme_create_git_exclude "$BASE_DIR/meta-repository"
119116

120117
else
121118
printf "\n#\n# Updating $SITE_DOMAIN\n#\n"

wordpresstv.dev/provision/vvv-init.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ if [ ! -L $SITE_DIR ]; then
3838

3939
# Ignore external dependencies and Meta Environment tweaks
4040
IGNORED_FILES=(
41-
/wordpress
42-
/wp-content/mu-plugins/sandbox-functionality.php
43-
/wp-config.php
41+
**/wordpress
42+
**/wp-content/mu-plugins/sandbox-functionality.php
43+
**/wp-config.php
4444
)
4545
IGNORED_FILES=( "${IGNORED_FILES[@]}" "${WPCLI_PLUGINS[@]}" )
46-
wme_create_gitignore $SITE_DIR
46+
wme_create_git_exclude "$BASE_DIR/meta-repository"
4747

4848
else
4949
printf "\n#\n# Updating $SITE_DOMAIN\n#\n"

0 commit comments

Comments
 (0)