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

Improve handling of truncated class names from git pull #511

Merged
merged 3 commits into from
Oct 2, 2024

Conversation

raymond-rebbeck
Copy link
Contributor

The current way of handling truncated class names from git pull seems to have two major flaws:

  1. It is possible for truncated class names to fail to be expanded if the repository directory structure does not align with class packages
  2. When this failure occurs and no possible classes are found, there is no warning generated

For example if the repository has the following base directory structure:
/foo/bar/ and contains class A.B.C stored on disk as A/B/C.cls (where foo and bar have no relation to any class package names)

then git pull may provide truncated output such as the following:
.../bar/A/B/C.cls

ExpandClasses will try and fail to find a class named bar.A.B.C with no warning generated, the class silently fails to import.

ExpandClasses has been updated so that upon failing to find any class names it will remove period-delimited pieces from the start of the name and try again, until it finds something or runs out of pieces.

This would mean for example that after failing to find bar.A.B.C it would then try A.B.C and find the intended class

@isc-tleavitt
Copy link
Collaborator

@raymond-rebbeck another great catch - thank you!

@isc-tleavitt isc-tleavitt merged commit c712f60 into intersystems:main Oct 2, 2024
1 check passed
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.

2 participants