Skip to content

Remove file from PR #1901

Closed
Closed

Description

@just-be-dev

Issuehunt badges

Basically a duplicate of #1127.

Sometimes in a PR file changes slip in that you didn't intend. Maybe you didn't correctly stash, a commit hook made a formatting change, or some other thing happened.

The ultimate result is that you want to undo changes to a particular file in your PR. It'd be nice to have a button on the header of every file in the diff to revert that change.

Something like this...

image

It seems like this was added in #1398, but it's no longer present or working now. At least not in the FF version of the plugin. GitHub added the trashcan icon to actually delete a file... heh, I almost did that >_>.


IssueHunt Summary

fregante fregante has been rewarded.

Backers (Total: $80.00)

Submitted pull Requests


Tips


IssueHunt has been backed by the following sponsors. Become a sponsor

Activity

  1. fregante commented on Apr 1, 2019

    @fregante
    Member

    They’re different.

    “Delete file” fully deletes the files, it’s a feature that was added by GitHub.

    “Revert all changes in file” is a feature that would indeed be nice to have, arguably this is the only button PRs need 👍

  2. changed the title [-]Add (or restore) button to remove file from PR[/-] [+]Remove file from PR[/+] on Apr 1, 2019
  3. hardikmodha commented on Apr 2, 2019

    @hardikmodha
    Contributor

    @bfred-it I would be more than happy to contribute to this. Can you point me towards the starting point? Thanks!

  4. fregante commented on Apr 2, 2019

    @fregante
    Member

    Honestly I don’t know if there’s an easy way to do this, you’d have to look the API for reverting

  5. just-be-dev commented on Apr 2, 2019

    @just-be-dev
    Author

    Yeahhh... I was looking into this. It's definitely non-trivial.

    I think the easiest way to is to follow this path:

    1. Get the base branch of the PR
    2. Use the contents api to grab the base version of the file
    3. Use the contents api to create a new commit of the file as it was at its original state.
  6. fregante commented on Apr 3, 2019

    @fregante
    Member
    1. Not the base branch, but the parent commit of the first commit in the PR. The base branch might have changed.
    2. Maybe you can skip this step if you can just checkout the file like you can in git: https://stackoverflow.com/questions/215718/reset-or-revert-a-specific-file-to-a-specific-revision-using-git
  7. just-be-dev commented on Apr 3, 2019

    @just-be-dev
    Author

    GitHub's api doesn't really expose higher level git actions like checkout. We could use the commit api to try to replicate this process, but I'm not sure how to go about doing that.

  8. fregante commented on Apr 4, 2019

    @fregante
    Member
  9. added
    💵 Funded on Issuehunt
    on Jun 24, 2019
  10. issuehunt-oss commented on Jun 24, 2019

    @issuehunt-oss

    @issuehunt has funded $80.00 to this issue.


  11. issuehunt-oss commented on Aug 11, 2019

    @issuehunt-oss

    @sindresorhus has rewarded $72.00 to @fregante. See it on IssueHunt

    • 💰 Total deposit: $80.00
    • 🎉 Repository reward(0%): $0.00
    • 🔧 Service fee(10%): $8.00
  12. added and removed
    💵 Funded on Issuehunt
    on Aug 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions