Skip to content

#1108: Fix git authentication in terminal#1287

Merged
hohwille merged 13 commits intodevonfw:mainfrom
alfeilex:#1108-fi-git-credentials
May 20, 2025
Merged

#1108: Fix git authentication in terminal#1287
hohwille merged 13 commits intodevonfw:mainfrom
alfeilex:#1108-fi-git-credentials

Conversation

@alfeilex
Copy link
Member

@alfeilex alfeilex commented May 6, 2025

Fixes: #1108

This PR fixes the issue with missing git authentication if no credentials are stored. The previous behavior was that the env variable GIT_TERMINAL_PROMPT=0 was set during each git command. This is removed within this PR since this was the reason for the missing git credentials prompt. Further, if run commands in --batch mode, GIT_TERMINAL_PROMPT=0 is set.

I tested the fix by creating native images for Windows and Linux. It is also notable that for git pull commands the credentials login prompt is not shown

Further I disabled GUI interaction when running git commands in Windows by setting specific environment variables.
See here: https://serverfault.com/questions/544156/git-clone-fail-instead-of-prompting-for-credentials/1054253#answer-1054253

@github-project-automation github-project-automation bot moved this to 🆕 New in IDEasy board May 6, 2025
@alfeilex alfeilex self-assigned this May 6, 2025
@alfeilex alfeilex moved this from 🆕 New to Team Review in IDEasy board May 6, 2025
@coveralls
Copy link
Collaborator

coveralls commented May 6, 2025

Pull Request Test Coverage Report for Build 15143174113

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 10 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.02%) to 67.704%

Files with Coverage Reduction New Missed Lines %
com/devonfw/tools/ide/tool/ide/IdeToolCommandlet.java 1 77.59%
com/devonfw/tools/ide/git/GitContextImpl.java 9 55.8%
Totals Coverage Status
Change from base Build 15143165608: -0.02%
Covered Lines: 8017
Relevant Lines: 11433

💛 - Coveralls

@alfeilex alfeilex changed the title #1108: Fix git authentification in terminal #1108: Fix git authentication in terminal May 13, 2025
@alfeilex alfeilex marked this pull request as ready for review May 14, 2025 08:20
@alfeilex alfeilex marked this pull request as draft May 14, 2025 10:07
@alfeilex alfeilex marked this pull request as ready for review May 14, 2025 12:22
@hohwille hohwille added this to the release:2025.05.002 milestone May 15, 2025
Copy link
Member

@hohwille hohwille left a comment

Choose a reason for hiding this comment

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

@alfeilex thanks for this PR. Great solution - together with PR #1305 all should work perfect now. 👍

@hohwille hohwille merged commit f34447a into devonfw:main May 20, 2025
4 checks passed
@github-project-automation github-project-automation bot moved this from Team Review to ✅ Done in IDEasy board May 20, 2025
@jan-vcapgemini
Copy link
Contributor

Tested on Windows and on WSL 2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

git fails if not authenticated, request for login/password not visible to the user

4 participants