Skip to content

align definitions scripts with typical git behavior, add docs#735

Merged
lukaspie merged 5 commits intomasterfrom
definitions-script
Feb 11, 2026
Merged

align definitions scripts with typical git behavior, add docs#735
lukaspie merged 5 commits intomasterfrom
definitions-script

Conversation

@lukaspie
Copy link
Collaborator

@lukaspie lukaspie commented Feb 11, 2026

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 commit and branch commands. These have been replaced by a single

checkout <REV>

operation, 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:

  • If <REV> resolves to a branch, the submodule remains on that branch and the branch is written to .gitmodules, enabling branch tracking.
  • If <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 using git 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 pynxtools is added.

@lukaspie lukaspie changed the title align definitions scripts with typical git behavior align definitions scripts with typical git behavior, add docs Feb 11, 2026
Copy link
Collaborator

@mkuehbach mkuehbach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Useful

@lukaspie lukaspie marked this pull request as ready for review February 11, 2026 12:49
Copy link
Collaborator

@mkuehbach mkuehbach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments were addressed appropriately.

@lukaspie lukaspie merged commit 367b6cd into master Feb 11, 2026
15 of 17 checks passed
@lukaspie lukaspie deleted the definitions-script branch February 11, 2026 13:41
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