Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Add ability to discard #50

Closed
benogle opened this issue Feb 26, 2016 · 11 comments · Fixed by #487
Closed

Add ability to discard #50

benogle opened this issue Feb 26, 2016 · 11 comments · Fixed by #487

Comments

@benogle
Copy link
Contributor

benogle commented Feb 26, 2016

I want to be able to discard files / hunks / lines. Maybe lines is a little extreme, but definitely allowing the discard of files and hunks would be nice.

  • From the keyboard, I want to use backspace. We could pop a confirmation.
  • From the UI, not sure. @simurai, have any ideas?
@benogle benogle changed the title Add discarding Add ability to discard Feb 26, 2016
@simurai
Copy link
Contributor

simurai commented Feb 27, 2016

Diff

The initial idea was to have those ✅ icons, to show if something is staged/unstaged. We would still have to implement them, but when you hover them, an ❎ is shown to discard the change. Can be used for both, lines and hunks.

screen shot 2016-02-27 at 5 22 27 pm

Panel

Then you probably want to discard entire files or all changes. In the panel, there could be ❎ buttons, but only when you hover the title or a file.

Discard all changes Discard a single file
screen shot 2016-02-27 at 6 08 17 pm screen shot 2016-02-27 at 6 08 45 pm

An alternative is to use a right-click context menu. Maybe if "show on hover" feels too noisy. Also, less risk of accidental clicks.

screen shot 2016-02-27 at 6 20 21 pm

Status Bar

Discard all files directly from the status-bar with a right-click context menu:

screen shot 2016-07-15 at 5 57 48 pm

Could also be enabled for the per file diff.

@benogle
Copy link
Contributor Author

benogle commented Feb 29, 2016

I am into the hover actions. Overall 👍

@iolsen iolsen added this to the 2: MVP Public Release milestone Jun 1, 2016
@as-cii as-cii modified the milestones: 1: Staff Ship, 2: MVP Public Release Jul 12, 2016
@kuychaco
Copy link
Contributor

I'm thinking we may want to move this to a later milestone. 💭 @iolsen

@iolsen
Copy link

iolsen commented Aug 23, 2016

I'm fine with that. I really like this feature but agree we can definitely live without it for staff ship.

@nathansobo
Copy link
Contributor

@kuychaco @iolsen I'm finding the inability to discard driving me back to GitX. I think we should reconsider because it wouldn't be that hard to implement.

@kuychaco
Copy link
Contributor

@nathansobo Yeah that sounds reasonable. Was just thinking about how I really wanted to be able to discard lines when I forget to delete a console.log. Would be a really awesome and handy feature to have

@simurai can we get your thoughts on what this should look like given the current state of things (which is a bit different than your mock-ups above)

Something to consider - if the user tries to delete an unsaved file, or a hunk or line in an unsaved file, how should we handle that? Just have a system dialog that says they must save before discarding?

@iolsen
Copy link

iolsen commented Sep 13, 2016

I'm OK with moving this up to staff ship. At our next sync we should go through all the open M1 issues and see if there's anything we can push back.

@simurai
Copy link
Contributor

simurai commented Sep 14, 2016

How about initially use the context menu (right click)? Then it could be used consistently in the status-bar, StagingView lists and for hunks and lines. And have no confirmation because it already needs two clicks.

And delete/backspace with the keyboard. Not sure if that needs a confirmation dialog.

@nathansobo
Copy link
Contributor

Just for context, GitX allows hunks to be discarded but not lines. If I need to do a partial discard I just stage some of the lines and discard the remaining hunk. They only show the discard button in the unstaged diff view.

screen shot 2016-09-14 at 7 09 02 am

@ungb
Copy link

ungb commented Jan 12, 2017

+1, I'd like to see this enhancement as well!

@nathansobo
Copy link
Contributor

YES!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants