Skip to content

Make the the GitAttributesLineEndingsPolicy relocatable across machines#621

Merged
nedtwigg merged 14 commits intomainfrom
feat/git-attributes-relocatable
Jun 28, 2020
Merged

Make the the GitAttributesLineEndingsPolicy relocatable across machines#621
nedtwigg merged 14 commits intomainfrom
feat/git-attributes-relocatable

Conversation

@nedtwigg
Copy link
Copy Markdown
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