summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorick Peterse <yorick@yorickpeterse.com>2019-09-03 15:21:04 +0200
committerYorick Peterse <yorick@yorickpeterse.com>2019-09-03 17:03:53 +0200
commit55063f854d52f4adec0d62e883bdd9cf8c2277f7 (patch)
treee9c3e29b13cf27a5d481ce87c18f30f83d41dde2
parentda0a5c7cc20194b71c41bd5572717fd9ac382cf4 (diff)
downloadgitlab-ce-fix-tmp-gitignore.tar.gz
Fix Git ignore for tmp/, shared/, and plugins/fix-tmp-gitignore
The old rules meant that any future changes to these directories would require the use of `git add -f` to be staged. This is problematic for the upcoming FOSS-only mirror of GitLab. Any changes to be synced to this mirror are staged using `git add --all .`, which due to the Git ignore rules would not add the tmp/ and shared/ directories. This then leads to various specs failing because they expect certain sub-directories of these directories to be available. This commit changes the rules so that we include the .gitkeep files, ignore other files, and completely ignore anything in tmp/test. This requires that the rules are specified in tmp/.gitignore and shared/.gitignore, instead of the top-level .gitignore, without this I could not get Git to include the .gitkeep files properly.
-rw-r--r--.gitignore3
-rw-r--r--plugins/.gitignore5
-rw-r--r--shared/.gitignore4
-rw-r--r--tmp/.gitignore5
4 files changed, 14 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index 3ffe4263c4f..fcbb4c352a9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -61,11 +61,9 @@ eslint-report.html
/shared/artifacts/
/rails_best_practices_output.html
/tags
-/tmp/*
/vendor/bundle/*
/vendor/gitaly-ruby
/builds*
-/shared/*
/.gitlab_workhorse_secret
/webpack-report/
/knapsack/
@@ -73,7 +71,6 @@ eslint-report.html
/locale/**/LC_MESSAGES
/locale/**/*.time_stamp
/.rspec
-/plugins/*
/.gitlab_pages_secret
/.gitlab_smime_key
/.gitlab_smime_cert
diff --git a/plugins/.gitignore b/plugins/.gitignore
new file mode 100644
index 00000000000..e4ccdc9e2ec
--- /dev/null
+++ b/plugins/.gitignore
@@ -0,0 +1,5 @@
+*
+!*/
+!.gitignore
+!.gitkeep
+!examples/*
diff --git a/shared/.gitignore b/shared/.gitignore
new file mode 100644
index 00000000000..5c0276adafd
--- /dev/null
+++ b/shared/.gitignore
@@ -0,0 +1,4 @@
+*
+!*/
+!.gitignore
+!.gitkeep
diff --git a/tmp/.gitignore b/tmp/.gitignore
new file mode 100644
index 00000000000..a383b23fb78
--- /dev/null
+++ b/tmp/.gitignore
@@ -0,0 +1,5 @@
+*
+!*/
+!.gitignore
+!.gitkeep
+/tests/