align definitions scripts with typical git behavior, add docs#735
Merged
align definitions scripts with typical git behavior, add docs#735
Conversation
e573bee to
3204d61
Compare
Co-authored-by: Markus Kühbach <mkuehbach@users.noreply.github.com>
3204d61 to
ec4826d
Compare
3dcb816 to
ef66315
Compare
mkuehbach
approved these changes
Feb 11, 2026
Collaborator
mkuehbach
left a comment
There was a problem hiding this comment.
Comments were addressed appropriately.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change simplifies and unifies how the definitions submodule is managed by aligning the script behaviour with standard Git concepts.
Summary of changes
Previously, the script distinguished between separate
commitandbranchcommands. These have been replaced by a singleoperation, where
<REV>can be any valid Git revision (commit hash, tag, or branch). This mirrors normal Git usage and removes duplicated logic.The submodule handling is now based on the resulting repository state rather than the input type:
<REV>resolves to a branch, the submodule remains on that branch and the branch is written to .gitmodules, enabling branch tracking.<REV>resolves to a commit or tag, the submodule is left in detached HEAD state and any branch tracking entry is removed.Behaviour of the commands
The script now clearly separates three operations:
update: Updates the submodule to the latest commit of the tracked branch usinggit submodule update --remote.checkout <REV>: Checks out an arbitrary revision. Branch checkouts enable tracking via .gitmodules, while commits and tags result in a detached checkout.reset: Restores the submodule to the exact commit recorded in the superproject. This explicitly removes branch tracking configuration and forces checkout of the pinned revision, ensuring that reset is independent of the default branch or latest upstream state.In addition, documentation about the NeXus definitions and how they are integrated in
pynxtoolsis added.