Skip to content
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

Fix #1939 - Show tag name instead of commit in GitStatusbar #12584

Merged
merged 2 commits into from
Oct 21, 2016
Merged

Fix #1939 - Show tag name instead of commit in GitStatusbar #12584

merged 2 commits into from
Oct 21, 2016

Conversation

Krzysztof-Cieslak
Copy link
Contributor

If there exist tag with same ps1 as checkout commit show tag name, otherwise use ps1 as before

CC @joaomoreno, issue #1939

@msftclas
Copy link

Hi @Krzysztof-Cieslak, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!
You've already signed the contribution license agreement. Thanks!

The agreement was validated by Microsoft and real humans are currently evaluating your PR.

TTYL, MSBOT;

@coveralls
Copy link

Coverage Status

Coverage remained the same at 61.185% when pulling 30f618d on Krzysztof-Cieslak:fix_1939 into 8911a6a on Microsoft:master.

@joaomoreno joaomoreno added this to the October 2016 milestone Sep 27, 2016
Copy link
Member

@joaomoreno joaomoreno left a comment

Choose a reason for hiding this comment

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

This functionality should be done in model.getPS1(), not outside of it.

@@ -100,14 +100,17 @@ export class GitStatusbarItem implements IStatusbarItem {

private onGitServiceChange(): void {
const model = this.gitService.getModel();
const ps1 = model.getPS1();
const tags = model.getRefs().filter(iref => iref.commit.substr(0,8) === ps1);
Copy link
Member

Choose a reason for hiding this comment

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

You should use model.getHEAD().commit to compare with iref.commit.

@@ -100,14 +100,17 @@ export class GitStatusbarItem implements IStatusbarItem {

private onGitServiceChange(): void {
const model = this.gitService.getModel();
const ps1 = model.getPS1();
const tags = model.getRefs().filter(iref => iref.commit.substr(0,8) === ps1);
const name = tags.length > 0 ? tags[0].name : model.getPS1();
Copy link
Member

Choose a reason for hiding this comment

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

This breaks the +*! symbols in front of branches, since whenever a branch is checked out, model.getPS1 is never called.

@Krzysztof-Cieslak
Copy link
Contributor Author

@joaomoreno: Fixed.

@Krzysztof-Cieslak
Copy link
Contributor Author

@joaomoreno: Any idea about CI errors? Error messages are really ... unhelpful. And it builds fine on My Machine™️

@joaomoreno joaomoreno closed this Oct 21, 2016
@joaomoreno joaomoreno reopened this Oct 21, 2016
@msftclas
Copy link

Hi @Krzysztof-Cieslak, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!
You've already signed the contribution license agreement. Thanks!

The agreement was validated by Microsoft and real humans are currently evaluating your PR.

TTYL, MSBOT;

@joaomoreno joaomoreno merged commit 677aa3d into microsoft:master Oct 21, 2016
@joaomoreno
Copy link
Member

Thanks!

@Krzysztof-Cieslak Krzysztof-Cieslak deleted the fix_1939 branch October 21, 2016 11:35
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants