Skip to content
This repository was archived by the owner on Apr 1, 2020. It is now read-only.

Conversation

akinsho
Copy link
Member

@akinsho akinsho commented Jul 25, 2018

This PR adds the ability to unstage a file, as well undo the last commit

Issues/Limitations:

Currently although the git logs is shown the last 25 commits (for performance sake only 25 as testing with a large repo with loads of commits rendering and fetching that log is much slower) they can only interact with the one that is the latest as the uncommit functionality uses git reset --soft HEAD^ to remove the last commit.

with the log though other functionality like checkout etc. can eventually be added but if the user were able to select each commit atm they would have to scroll throw all 25 to reach the next section, in order to get round this the VimNavigator would have to be expanded to allow dynamically setting a selected ID and some functionality added to allow skipping sections so for now I have removed the option to do that

uncommit

Help Section
screen shot 2018-07-25 at 17 07 42

Outstanding:

  • Update commands in help section
  • Add tests for help section

@akinsho akinsho changed the title Feature/uncommit unstage functionality [WIP] Feature/uncommit unstage functionality Jul 25, 2018
@codecov
Copy link

codecov bot commented Jul 25, 2018

Codecov Report

Merging #2457 into master will increase coverage by 0.18%.
The diff coverage is 57.31%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2457      +/-   ##
==========================================
+ Coverage   43.26%   43.45%   +0.18%     
==========================================
  Files         341      341              
  Lines       13434    13463      +29     
  Branches     1768     1769       +1     
==========================================
+ Hits         5812     5850      +38     
+ Misses       7346     7336      -10     
- Partials      276      277       +1
Impacted Files Coverage Δ
...src/Services/VersionControl/VersionControlStore.ts 65.38% <0%> (-2.62%) ⬇️
browser/src/Input/KeyBindings.ts 1.9% <0%> (-0.02%) ⬇️
.../Services/VersionControl/VersionControlProvider.ts 100% <100%> (ø) ⬆️
browser/src/Services/InputManager.ts 92.2% <100%> (+0.1%) ⬆️
...src/Services/VersionControl/VersionControlPane.tsx 48.81% <42.85%> (+0.91%) ⬆️
...src/Services/VersionControl/VersionControlView.tsx 73.01% <60%> (+0.43%) ⬆️
...owser/src/UI/components/VersionControl/Commits.tsx 95% <83.33%> (+1.66%) ⬆️
browser/src/UI/components/VersionControl/Help.tsx 90.47% <88.88%> (+4.76%) ⬆️
...src/Services/Configuration/DefaultConfiguration.ts 87.5% <0%> (ø) ⬆️
browser/src/neovim/NeovimWindowManager.ts 10.81% <0%> (+0.19%) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c667874...f5ed790. Read the comment docs.

@akinsho akinsho changed the title [WIP] Feature/uncommit unstage functionality Feature/uncommit unstage functionality Jul 25, 2018
this._onFileStatusChanged.dispatch()
} catch (error) {
this._oni.log.warn(`
Git Provider unable to get logs because of: ${error.message}`)
Copy link
Member

Choose a reason for hiding this comment

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

Tiny change, but this should be unable to undo most recent commit.

@CrossR
Copy link
Member

CrossR commented Jul 25, 2018

Functionally seems to all work well! Code looks good too.

I tried both unstaging files, as well as undoing commits.

One comment I would make is that the UX for undoing commits potentially could do with being changed, since my first instinct on an item is usually to hit enter, but if I did that to a commit message it would undo it, with no confirmation. Though, that is more polish rather than functionality like this PR is adding.

I'll wait on approving till the CI passes.

@akinsho
Copy link
Member Author

akinsho commented Jul 26, 2018

@CrossR thanks for the review 👍 yeah think I should have stuck with u convention re uncommit was the simplest at the time to use enter but can definitely change that in a follow up PR

@akinsho akinsho merged commit e2c3fef into onivim:master Jul 26, 2018
@akinsho akinsho deleted the feature/uncommit-unstage-functionality branch July 26, 2018 10:37
@akinsho akinsho restored the feature/uncommit-unstage-functionality branch October 1, 2018 09:35
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.

2 participants