Skip to content

#2273: add Git as global tool - #2360

Open
cap-juan wants to merge 1 commit into
devonfw:mainfrom
cap-juan:feature/2273-integrate-git-as-global-tool
Open

#2273: add Git as global tool#2360
cap-juan wants to merge 1 commit into
devonfw:mainfrom
cap-juan:feature/2273-integrate-git-as-global-tool

Conversation

@cap-juan

@cap-juan cap-juan commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

This PR fixes #2273

Implemented changes:

  • Added Git as a global IDEasy tool and registered the Git commandlet.
  • Added Linux installation support through native package managers (apt and zypper).
  • Added Windows installation support using the Git for Windows installer with silent installer arguments.
  • Added Windows registry-based detection and uninstall support for Git.
  • Improved Windows registry matching by validating the application's DisplayName.
  • Added generic installer argument support for global tools.
  • Added support for global tools that do not require repository version resolution when installed through the native Linux package manager.
  • Updated the CHANGELOG.

Testing instructions:

Please add conscise, understandable instructions on how a reviewer can test/verify the functionality of your contribution here:

  1. Build IDEasy and make the local development version available with build-local-dev.sh
  2. For both Linux and Windows run: ide install git and / or ide uninstall git

Checklist for this PR

Make sure everything is checked before merging this PR. For further info please also see
our DoD.

  • When running mvn clean test locally all tests pass and build is successful
  • PR title is of the form #«issue-id»: «brief summary» (e.g. #921: fixed setup.bat and not feature/921 fixed setup.bat). If no issue ID exists, title only.
  • PR top-level comment summaries what has been done and contains link to addressed issue(s)
  • PR and issue(s) have suitable labels
  • Issue is set to In Progress and assigned to you or there is no issue (might happen for very small PRs)
  • You followed all coding conventions
  • You have added the issue implemented by your PR in CHANGELOG.adoc unless issue is labelled
    with internal
  • You have not changed any dependency in pom.xml files or otherwise if runtime dependencies changed, you have updated our LICENSE.asciidoc
  • You have formulated clear instructions on how to test your contribution under "Testing instructions"

Checklist for tool commandlets

Have you added a new «tool» as commandlet? There are the following additional checks:

  • The tool can be installed automatically (during setup via settings) or via the commandlet call
  • The tool is isolated in its IDEasy project, see Sandbox Principle
  • The new tool is added to the table of tools in LICENSE.asciidoc
  • The new commandlet is a command-wrapper for «tool»
  • Proper help texts for all supported languages are added here
  • The new commandlet installs potential dependencies automatically
  • The variables «TOOL»_VERSION and «TOOL»_EDITION are honored by your commandlet
  • The new commandlet is tested on all platforms it is available for or tested on all platforms that are in scope of the linked issue

@github-project-automation github-project-automation Bot moved this to 🆕 New in IDEasy board Aug 24, 2026
@cap-juan cap-juan added enhancement New feature or request commandlet ide sub-command install installation process of IDE + tools and install commandlet git git version management tool integration labels Aug 24, 2026
@cap-juan cap-juan moved this from 🆕 New to Team Review in IDEasy board Aug 24, 2026
@cap-juan
cap-juan force-pushed the feature/2273-integrate-git-as-global-tool branch from 8338e9a to e1ec94b Compare August 24, 2026 09:42
@coveralls

coveralls commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 33513688801

Coverage decreased (-0.02%) to 73.593%

Details

  • Coverage decreased (-0.02%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 295 coverage regressions across 8 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

295 previously-covered lines in 8 files lost coverage.

File Lines Losing Coverage Coverage
com/devonfw/tools/ide/context/AbstractIdeContext.java 135 70.75%
com/devonfw/tools/ide/git/GitContextImpl.java 54 34.3%
com/devonfw/tools/ide/os/WindowsHelperImpl.java 41 56.36%
com/devonfw/tools/ide/tool/ToolCommandlet.java 31 75.96%
com/devonfw/tools/ide/tool/GlobalToolCommandlet.java 25 15.08%
com/devonfw/tools/ide/commandlet/CommandletManagerImpl.java 7 92.13%
com/devonfw/tools/ide/tool/ide/IdeToolCommandlet.java 1 87.42%
com/devonfw/tools/ide/version/VersionSegment.java 1 90.03%

Coverage Stats

Coverage Status
Relevant Lines: 18404
Covered Lines: 14160
Line Coverage: 76.94%
Relevant Branches: 8168
Covered Branches: 5395
Branch Coverage: 66.05%
Branches in Coverage %: Yes
Coverage Strength: 3.28 hits per line

💛 - Coveralls

@cap-juan
cap-juan force-pushed the feature/2273-integrate-git-as-global-tool branch from e1ec94b to 4d0a427 Compare August 24, 2026 10:09
@laim2003
laim2003 requested review from JoelAdbu and laim2003 and removed request for laim2003 August 27, 2026 08:44
@laim2003 laim2003 assigned JoelAdbu and unassigned laim2003 Aug 27, 2026
@cap-juan
cap-juan force-pushed the feature/2273-integrate-git-as-global-tool branch 3 times, most recently from a072d66 to ac2e42e Compare August 27, 2026 16:17

@JoelAdbu JoelAdbu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since Git can now be installed via IDEasy, it would be helpful to improve the error message shown when IDEasy is started without Git being installed.

This change could be implemented in GitContextImpl.java in the findGitRequired() method.

Current message:

String message = "Git " + IdeContext.IS_NOT_INSTALLED_BUT_REQUIRED;

Suggested message:

String message = "Git " + IdeContext.IS_NOT_INSTALLED_BUT_REQUIRED +". Try running `ide install git` to install it."

@cap-juan
cap-juan force-pushed the feature/2273-integrate-git-as-global-tool branch 2 times, most recently from cdafd81 to b5a4595 Compare September 1, 2026 08:37

@JoelAdbu JoelAdbu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for this! ide install git / ide uninstall git is now a first-class global tool, and the overall approach is clean: the requiresVersionResolution() hook to skip repository version resolution for Linux native-package installs, the getInstallerArguments() hook for the Git for Windows silent flags, and the registry DisplayName validation (with proper suffix handling) are all reasonable and well-tested.

CI is green (build, GitGuardian, CLA, coveralls). I don't see any blocking issues — this looks close to ready. A few non-blocking items below, and one behavioral risk worth confirming.

What I verified:

  • addArgs(List<?>) iterates the list, so .addArgs(getInstallerArguments()) is a no-op for the default empty list — no impact on other global tools' installers.
  • The versionless Linux install path tolerates a null resolved version (createToolInstallation / getInstallationPath handle it), and requiresVersionResolution() is only false on Linux, so Windows/macOS behavior is unchanged.
  • New tests extend AbstractIdeContextTest (AssertJ) and the fixtures match the assertions.

Comment thread cli/src/main/java/com/devonfw/tools/ide/context/AbstractIdeContext.java Outdated
Comment thread cli/src/main/java/com/devonfw/tools/ide/context/AbstractIdeContext.java Outdated
Comment thread cli/src/main/resources/nls/Help_de.properties Outdated
Comment thread cli/src/main/java/com/devonfw/tools/ide/tool/ToolCommandlet.java
@cap-juan
cap-juan force-pushed the feature/2273-integrate-git-as-global-tool branch from b5a4595 to a7cd367 Compare September 1, 2026 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commandlet ide sub-command enhancement New feature or request git git version management tool integration install installation process of IDE + tools and install commandlet

Projects

Status: Team Review

Development

Successfully merging this pull request may close these issues.

Integrate git as global tool

4 participants