Skip to content

Commit

Permalink
Stage/unstage lines (#575)
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan Dilly committed Mar 10, 2021
1 parent 64acf1c commit b5ef9b1
Show file tree
Hide file tree
Showing 13 changed files with 636 additions and 450 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Expand Up @@ -7,8 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### Changed
- `[s]` key repurposed to trigger line based (un)stage

### Added
- support discarding diff by lines ([#59](https://github.com/extrawurst/gitui/issues/59))
- support stage/unstage selected lines ([#59](https://github.com/extrawurst/gitui/issues/59))
- support discarding selected lines ([#59](https://github.com/extrawurst/gitui/issues/59))
- support for pushing tags ([#568](https://github.com/extrawurst/gitui/issues/568))
- visualize *conflicted* files differently ([#576](https://github.com/extrawurst/gitui/issues/576))

Expand Down
3 changes: 1 addition & 2 deletions assets/vim_style_key_config.ron
Expand Up @@ -17,8 +17,6 @@
tab_toggle: ( code: Tab, modifiers: ( bits: 0,),),
tab_toggle_reverse: ( code: BackTab, modifiers: ( bits: 1,),),

focus_workdir: ( code: Char('w'), modifiers: ( bits: 0,),),
focus_stage: ( code: Char('s'), modifiers: ( bits: 0,),),
focus_right: ( code: Char('l'), modifiers: ( bits: 0,),),
focus_left: ( code: Char('h'), modifiers: ( bits: 0,),),
focus_above: ( code: Char('k'), modifiers: ( bits: 0,),),
Expand Down Expand Up @@ -53,6 +51,7 @@
status_reset_item: ( code: Char('U'), modifiers: ( bits: 1,),),
status_reset_lines: ( code: Char('u'), modifiers: ( bits: 0,),),
status_ignore_file: ( code: Char('i'), modifiers: ( bits: 0,),),
diff_stage_lines: ( code: Char('s'), modifiers: ( bits: 0,),),

stashing_save: ( code: Char('w'), modifiers: ( bits: 0,),),
stashing_toggle_untracked: ( code: Char('u'), modifiers: ( bits: 0,),),
Expand Down
1 change: 1 addition & 0 deletions asyncgit/src/sync/diff.rs
Expand Up @@ -157,6 +157,7 @@ pub(crate) fn get_diff_raw<'a>(
/// returns diff of a specific file either in `stage` or workdir
pub fn get_diff(
repo_path: &str,
//TODO: make &str
p: String,
stage: bool,
) -> Result<FileDiff> {
Expand Down
4 changes: 2 additions & 2 deletions asyncgit/src/sync/mod.rs
Expand Up @@ -49,7 +49,7 @@ pub use remotes::{
tags::PushTagsProgress,
};
pub use reset::{reset_stage, reset_workdir};
pub use staging::discard_lines;
pub use staging::{discard_lines, stage_lines};
pub use stash::{get_stashes, stash_apply, stash_drop, stash_save};
pub use state::{repo_state, RepoState};
pub use tags::{get_tags, CommitTags, Tags};
Expand All @@ -62,8 +62,8 @@ pub use utils::{
mod tests {
use super::{
commit, stage_add_file,
staging::repo_write_file,
status::{get_status, StatusType},
utils::repo_write_file,
CommitId, LogWalker,
};
use crate::error::Result;
Expand Down

0 comments on commit b5ef9b1

Please sign in to comment.