change the default ignore file path to ~/.edenignore

Summary:
Previously the default ignore path was `~/ignore`.  This doesn't really seem
like a great path choice, and I suspect that no one is actually using an
ignore file at this location.  This default was set in D8594297, but I it
looks like this was mostly accidental from just not separating out data for
the system ignore path (`/etc/eden/ignore`) vs the user ignore path.

Using `~/.edenignore` seems reasonable for now, and unlikely to conflict with
other paths.  We used to use `~/.gitignore` as the default before D8906226,
but this did cause problems for a handful of users that treated their entire
home directory as a git repository, and had a `~/.gitignore` file that was
supposed to apply only to their home directory.

Reviewed By: wez

Differential Revision: D13984153

fbshipit-source-id: 887528372b9be789317933f7026dfcbde8cd4539
This commit is contained in:
Adam Simpkins 2019-02-07 18:28:16 -08:00 committed by Facebook Github Bot
parent 386c48e9db
commit 6d44b3e88c
2 changed files with 8 additions and 5 deletions

View File

@ -36,7 +36,8 @@ constexpr std::array<folly::StringPiece, 2> kEnvVars = {
folly::StringPiece{"USER"}};
const facebook::eden::RelativePathPiece kDefaultEdenDirectory{".eden"};
const facebook::eden::RelativePathPiece kDefaultIgnoreFile{"ignore"};
const facebook::eden::RelativePathPiece kDefaultUserIgnoreFile{".edenignore"};
const facebook::eden::RelativePathPiece kDefaultSystemIgnoreFile{"ignore"};
const facebook::eden::AbsolutePath kUnspecifiedDefault{"/"};
namespace {
@ -136,9 +137,11 @@ EdenConfig::EdenConfig(
edenDir_.setValue(
userHomePath_ + kDefaultEdenDirectory, facebook::eden::DEFAULT, true);
userIgnoreFile_.setValue(
userHomePath + kDefaultIgnoreFile, facebook::eden::DEFAULT, true);
userHomePath + kDefaultUserIgnoreFile, facebook::eden::DEFAULT, true);
systemIgnoreFile_.setValue(
systemConfigDir_ + kDefaultIgnoreFile, facebook::eden::DEFAULT, true);
systemConfigDir_ + kDefaultSystemIgnoreFile,
facebook::eden::DEFAULT,
true);
clientCertificate_.setValue(
kUnspecifiedDefault, facebook::eden::DEFAULT, true);
}

View File

@ -39,7 +39,7 @@ class EdenConfigTest : public ::testing::Test {
AbsolutePath defaultSystemConfigPath_{"/etc/eden/edenfs.rc"};
// Used by various tests to verify default values is set
AbsolutePath defaultUserIgnoreFilePath_{"/home/bob/ignore"};
AbsolutePath defaultUserIgnoreFilePath_{"/home/bob/.edenignore"};
AbsolutePath defaultSystemIgnoreFilePath_{"/etc/eden/ignore"};
AbsolutePath defaultEdenDirPath_{"/home/bob/.eden"};
optional<AbsolutePath> defaultClientCertificatePath_;
@ -297,7 +297,7 @@ TEST_F(EdenConfigTest, overRideNotAllowedTest) {
systemConfigPath);
// Check default (starting point)
EXPECT_EQ(edenConfig->getUserIgnoreFile(), "/home/bob/ignore");
EXPECT_EQ(edenConfig->getUserIgnoreFile(), "/home/bob/.edenignore");
// Set from cli and verify that cannot over-ride
AbsolutePath cliIgnoreFile{"/CLI_IGNORE_FILE"};