Skip to content

Commit b5ef9b1

Browse files
author
Stephan Dilly
authored
Stage/unstage lines (#575)
1 parent 64acf1c commit b5ef9b1

File tree

13 files changed

+636
-450
lines changed

13 files changed

+636
-450
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## Unreleased
99

10+
### Changed
11+
- `[s]` key repurposed to trigger line based (un)stage
12+
1013
### Added
11-
- support discarding diff by lines ([#59](https://github.com/extrawurst/gitui/issues/59))
14+
- support stage/unstage selected lines ([#59](https://github.com/extrawurst/gitui/issues/59))
15+
- support discarding selected lines ([#59](https://github.com/extrawurst/gitui/issues/59))
1216
- support for pushing tags ([#568](https://github.com/extrawurst/gitui/issues/568))
1317
- visualize *conflicted* files differently ([#576](https://github.com/extrawurst/gitui/issues/576))
1418

assets/vim_style_key_config.ron

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
tab_toggle: ( code: Tab, modifiers: ( bits: 0,),),
1818
tab_toggle_reverse: ( code: BackTab, modifiers: ( bits: 1,),),
1919

20-
focus_workdir: ( code: Char('w'), modifiers: ( bits: 0,),),
21-
focus_stage: ( code: Char('s'), modifiers: ( bits: 0,),),
2220
focus_right: ( code: Char('l'), modifiers: ( bits: 0,),),
2321
focus_left: ( code: Char('h'), modifiers: ( bits: 0,),),
2422
focus_above: ( code: Char('k'), modifiers: ( bits: 0,),),
@@ -53,6 +51,7 @@
5351
status_reset_item: ( code: Char('U'), modifiers: ( bits: 1,),),
5452
status_reset_lines: ( code: Char('u'), modifiers: ( bits: 0,),),
5553
status_ignore_file: ( code: Char('i'), modifiers: ( bits: 0,),),
54+
diff_stage_lines: ( code: Char('s'), modifiers: ( bits: 0,),),
5655

5756
stashing_save: ( code: Char('w'), modifiers: ( bits: 0,),),
5857
stashing_toggle_untracked: ( code: Char('u'), modifiers: ( bits: 0,),),

asyncgit/src/sync/diff.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ pub(crate) fn get_diff_raw<'a>(
157157
/// returns diff of a specific file either in `stage` or workdir
158158
pub fn get_diff(
159159
repo_path: &str,
160+
//TODO: make &str
160161
p: String,
161162
stage: bool,
162163
) -> Result<FileDiff> {

asyncgit/src/sync/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ pub use remotes::{
4949
tags::PushTagsProgress,
5050
};
5151
pub use reset::{reset_stage, reset_workdir};
52-
pub use staging::discard_lines;
52+
pub use staging::{discard_lines, stage_lines};
5353
pub use stash::{get_stashes, stash_apply, stash_drop, stash_save};
5454
pub use state::{repo_state, RepoState};
5555
pub use tags::{get_tags, CommitTags, Tags};
@@ -62,8 +62,8 @@ pub use utils::{
6262
mod tests {
6363
use super::{
6464
commit, stage_add_file,
65-
staging::repo_write_file,
6665
status::{get_status, StatusType},
66+
utils::repo_write_file,
6767
CommitId, LogWalker,
6868
};
6969
use crate::error::Result;

0 commit comments

Comments
 (0)