-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#520: #645: Update Changelog #600
#520: #645: Update Changelog #600
Conversation
…which does not have an upstream. Pull is skipped in that case
Pull Request Test Coverage Report for Build 11031452954Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your additions. I've added some CRs to resolve first, then this can go into review.
cli/src/main/java/com/devonfw/tools/ide/context/GitContextImpl.java
Outdated
Show resolved
Hide resolved
cli/src/main/java/com/devonfw/tools/ide/context/GitContextImpl.java
Outdated
Show resolved
Hide resolved
cli/src/main/java/com/devonfw/tools/ide/context/GitContextImpl.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we also should add some tests for a better coverage of this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some thoughts on this...
I created a local feature branch that has no remote branch and pulled from it:
$ git pull
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.
git pull <remote> <branch>
If you wish to set tracking information for this branch you can do so with:
git branch --set-upstream-to=<remote>/<branch> feature/556-update-path-on-pc-run
hohwille@CE49454 MSYS /d/projects/IDEasy/workspaces/main/IDEasy/documentation (feature/556-update-path-on-pc-run)
$ echo $?
1
Then I switched back to main, went offline and repeated the pull
:
$ git pull
fatal: unable to access 'https://github.com/hohwille/IDEasy.git/': Could not resolve host: github.com
hohwille@CE49454 MSYS /d/projects/IDEasy/workspaces/main/IDEasy/documentation (main)
$ echo $?
1
So unfortunately we cannot use the return code of git pull to distinguish if we have no remote branch or something else went wrong.
However, if we use this complex code to run git branch -vv
and parse all the results, we could also parse the initial error and search for There is no tracking information for the current branch
.
However, I am unsure if git supports localization and if some user might get the output localized to a different language.
Otherwise, maybe there is a smarter way to ask git if we are on a local branch?
At least you could call git branch -vv --contains
to get only relevant branches.
IMHO there must still be a smarter way to figure this out...
…s://github.com/WorkingAmeise/IDEasy into bug/520-NullPointerException-on-GitContextImpl
The tests will be submitted later via issue #620 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, ready for review after the CI issues were solved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@WorkingAmeise thanks for your PR. You now figured out what is the right way to solve this issue nicely 👍
I left some comments to rework. Please have a look. When resolved, we can merge.
cli/src/main/java/com/devonfw/tools/ide/context/GitContextImpl.java
Outdated
Show resolved
Hide resolved
cli/src/main/java/com/devonfw/tools/ide/context/GitContextImpl.java
Outdated
Show resolved
Hide resolved
cli/src/main/java/com/devonfw/tools/ide/context/GitContextImpl.java
Outdated
Show resolved
Hide resolved
cli/src/main/java/com/devonfw/tools/ide/context/GitContextImpl.java
Outdated
Show resolved
Hide resolved
cli/src/main/java/com/devonfw/tools/ide/context/GitContextImpl.java
Outdated
Show resolved
Hide resolved
cli/src/main/java/com/devonfw/tools/ide/context/GitContextImpl.java
Outdated
Show resolved
Hide resolved
Build failed with this error:
|
Can you please also check DoD: CHANGELOG entry needs to be added. |
…s://github.com/WorkingAmeise/IDEasy into bug/520-NullPointerException-on-GitContextImpl
…-NullPointerException-on-GitContextImpl
…-NullPointerException-on-GitContextImpl
…-NullPointerException-on-GitContextImpl
closes #520 null pointer exception on git context impl
UPDATE: In PR #645 I accidentally fixed #520. Sorry for overlapping with this PR and your work @WorkingAmeise.
After merging the changelog entry is left that I will now merge and thereby close #520 automatically. The NPE fix will be found in #645 however.