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

Button to commit should reflect name of the current branch #10318

Closed
Lmpessoa opened this issue Aug 4, 2020 · 5 comments · Fixed by #10324
Closed

Button to commit should reflect name of the current branch #10318

Lmpessoa opened this issue Aug 4, 2020 · 5 comments · Fixed by #10324
Assignees
Labels
bug Confirmed bugs or reports that are very likely to be bugs priority-3 Bugs that affect small number of users and/or relatively cosmetic in nature

Comments

@Lmpessoa
Copy link

Lmpessoa commented Aug 4, 2020

Describe the feature or problem you’d like to solve

While the app correctly displays the name of the current branch on top of the screen, the button to commit says "Commit to master" (bold is not mine but the app's doing). That pulled me from using the app to commit since I had the impression the commit is going to be made to the master branch instead of the current branch (used the command line for this commit).

Proposed solution

Change the commit button label to "Commit to %branch" where %branch is the name of the currently active branch.

Additional context

Add any other context like screenshots or mockups are helpful, if applicable.
Screenshot

@steveward
Copy link
Member

@Lmpessoa thanks for the report. The branch name in the commit button should update when you change branches, so this looks like a bug. Are you able to reproduce this in multiple repositories? Are you running Windows or macOS?

I was unable to reproduce this issue on my machine.

@steveward steveward added the more-info-needed The submitter needs to provide more information about the issue label Aug 4, 2020
@Lmpessoa
Copy link
Author

Lmpessoa commented Aug 4, 2020

I tried reproducing and found this out: By switching to the branch inside the app the button updated correctly, but when I created the branch from the command line and just then opening the app it recognised correctly the current branch but did not change the button label. The app was closed when the branch was created and showed up like the screenshot when open.

Sorry, OS is Windows 10

@niik
Copy link
Member

niik commented Aug 4, 2020

I was able to reproduce this when the branch in question was unborn (i.e had no commits yet).

Steps to reproduce

  • git init test
  • cd test
  • git checkout -b 'im-an-unborn-branch'

image

This seems to be because we (rather sloppily) fall back to master when don't have a current (born) branch, see

https://github.com/desktop/desktop/blob/development/app/src/ui/changes/commit-message.tsx#L482

Gonna open a PR to address this

@niik niik self-assigned this Aug 4, 2020
@niik niik added bug Confirmed bugs or reports that are very likely to be bugs and removed more-info-needed The submitter needs to provide more information about the issue labels Aug 4, 2020
@Lmpessoa
Copy link
Author

Lmpessoa commented Aug 4, 2020

I guess this is it. Since the branch I was on was an orphaned one, might fall on the same spot.

@tierninho tierninho added the priority-3 Bugs that affect small number of users and/or relatively cosmetic in nature label Aug 4, 2020
@SR2374
Copy link

SR2374 commented Aug 5, 2020

My laptop todhiba 7 udgrade to windows 10 but is too much slow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bugs or reports that are very likely to be bugs priority-3 Bugs that affect small number of users and/or relatively cosmetic in nature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants
@Lmpessoa @niik @steveward @tierninho @SR2374 and others