Skip to content

Stage/unstage lines #575

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Mar 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Loading