sapling/eden
Wez Furlong 52076f801f eden: improve validation for eden redirect add
Summary:
A user ran into an issue where some buck/build related automation had
added a redirection named `../../../Users/username/reponame/.lsp-buck-out`.

The valid name for this is `.lsp-buck-out` because redirections must always be
repo-root-relative.

This commit adds missing validation for this, and makes it slightly more
convenient for consuming tools to work with by allowing an absolute path to the
redirection to be specified.

Why not simply resolve the path from the cwd and use that?  The command has
always been defined in terms of repo-root-relative paths, and there are a
number of cases where CI and other build tools can start in unexpected
subdirectories and that means that paths like `../buck-out` can have an
ambiguous or surprising resolution.  There are tools that follow the
documentation and correctly specify repo-root-relative paths that would either
be broken outright or left with newly ambiguous behavior if we suddenly started
to accept and resolve relative paths for ourselves.

I'm not opposed to changing the behavior in that way in the future, but it
requires a bit more of a coordinated effort than I have time to wrangle right
now, so this diff is aimed at surfacing breakage rather than magically
resolving it.

This commit fixes up the behavior so that paths like `../foo` are explicitly
checked for and generate an error, but absolute paths like
`/Users/username/reponame/foo` (which are unambiguous) are now resolved to the
appropriate repo-root-relative path automatically.

That makes it a bit easier for consuming tools to swing through a behavior
change; they can now simply pass the absolute path rather than messing around
with trying relativize the paths to the repo root.

Reviewed By: kmancini

Differential Revision: D25261490

fbshipit-source-id: 1706b54fc15c2dad334cdf6c75cca5e6e44ed97a
2020-12-04 14:28:29 -08:00
..
fs eden: improve validation for eden redirect add 2020-12-04 14:28:29 -08:00
integration remove the unused glob() implementation 2020-12-01 13:39:14 -08:00
locale add a copyright header to glibc_en.po 2019-04-26 14:38:27 -07:00
mononoke mononoke: no need to collect walker iterators 2020-12-04 03:07:05 -08:00
scm auth: migrate crate to autocargo 2020-12-04 09:24:18 -08:00
test_support Manually upgrading eden, and fixing their config 2020-08-06 12:37:04 -07:00
test-data enable treemanifest in snapshots 2019-08-28 18:46:03 -07:00
.gitignore eden: wire up mac contbuild 2019-02-05 21:52:30 -08:00
Eden.project.toml Eden.project.toml file for Nuclide 2018-04-26 11:05:23 -07:00