Skip to content

Improve handling of truncated class names from git pull#511

Merged
isc-tleavitt merged 3 commits intointersystems:mainfrom
raymond-rebbeck:main
Oct 2, 2024
Merged

Improve handling of truncated class names from git pull#511
isc-tleavitt merged 3 commits intointersystems:mainfrom
raymond-rebbeck:main

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!

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