Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the the GitAttributesLineEndingsPolicy relocatable across machines #621

Merged
merged 14 commits into from
Jun 28, 2020

Conversation

nedtwigg
Copy link
Member

...and remove FileSignature from it completely.

The easy way to understand it is this commit: 082f867, which introduces the new policy. The rest of the PR just removes the old one. The only downside is that now, when the line endings property is checked for equality (so on task up-to-dateness), the line-endings of every file in the target is computed and stored into this data structure:

/** this is transient, to simulate PathSensitive.RELATIVE */
transient final String rootDir;
/** the line ending used for most files */
final String defaultEnding;
/** any exceptions to that default, in terms of relative path from rootDir */
final ConcurrentRadixTree<String> hasNonDefaultEnding = new ConcurrentRadixTree<>(new DefaultCharSequenceNodeFactory());

The expensive part of this is iterating over a possibly large target. But we were doing this before anyway, and users can avoid it if they want by using LineEndings.UNIX, and taking on the git battle themselves.

@nedtwigg nedtwigg merged commit 3ceeafa into main Jun 28, 2020
@nedtwigg nedtwigg deleted the feat/git-attributes-relocatable branch June 28, 2020 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant