Skip to content

Closes #1550 - allow force-push for non-HEAD commits and from commit widget#2132

Merged
eamodio merged 2 commits intogitkraken:mainfrom
ShafinKhadem:main
Jul 31, 2022
Merged

Closes #1550 - allow force-push for non-HEAD commits and from commit widget#2132
eamodio merged 2 commits intogitkraken:mainfrom
ShafinKhadem:main

Conversation

@ShafinKhadem
Copy link
Contributor

Description

Closes #1550. Force-push was also not working for non-HEAD commits in branches view. To fix these, I had to update git API from the VS Code repo as I needed force parameter for repo.push.

I was also experiencing 2 exceptions before any of my changes - one for circular reference, another for null pr. I have handled them as well.

Checklist

  • I have followed the guidelines in the Contributing document
  • My changes follow the coding style of this project
  • My changes build without any errors or warnings
  • My changes have been formatted and linted
  • My changes include any required corresponding changes to the documentation (including CHANGELOG.md and README.md)
  • My changes have been rebased and squashed to the minimal number (typically 1) of relevant commits
  • My changes have a descriptive commit message with a short title, including a Fixes $XXX - or Closes #XXX - prefix to auto-close the issue that your PR addresses

Copy link
Member

@eamodio eamodio left a comment

Choose a reason for hiding this comment

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

@ShafinKhadem Thanks! I've added some comments and requested a couple of minor changes.

@eamodio eamodio self-assigned this Jul 31, 2022
@eamodio eamodio added this to the 12.2 milestone Jul 31, 2022
@ShafinKhadem
Copy link
Contributor Author

@eamodio I have addressed the requested changes. Thanks.

@eamodio eamodio merged commit 957e76d into gitkraken:main Jul 31, 2022
@eamodio
Copy link
Member

eamodio commented Jul 31, 2022

Thank you so much for your contribution!

Thank you!

@ShafinKhadem
Copy link
Contributor Author

@eamodio Now that non-HEAD commits can be force-pushed, should I add a pushToCommitWithForce view? Even though I don't think gitlens.views.pushWithForce is that useful as gitlens.views.push automatically detects when force is needed, maybe it's better to have the [Alt] Push (force) for new users?

@eamodio
Copy link
Member

eamodio commented Aug 1, 2022

@ShafinKhadem Hrm, if I am understanding correctly, you are asking about adding a new "Push to Commit (Force)" command to the right-click of commits? If so, I don't think that it necessary since "Push to Commit" already handles that case.

@ShafinKhadem
Copy link
Contributor Author

@eamodio I meant this [Alt] Push (Force) for HEAD commits:

image

For non-head commits it's not available:

image

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Push button in commit widget does not trigger "Push force" when ALT is pressed.

2 participants