Skip to content

Commit

Permalink
Fix reversed file names reversed in show commit
Browse files Browse the repository at this point in the history
The source and destination paths in the show commit summary and diff
views were reversed from the correct order. This ensures the correct
order of these file paths.
  • Loading branch information
MitMaro committed Jun 27, 2024
1 parent 2d458aa commit 30c7199
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 16 deletions.
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/).

## [2.4.1] - 2024-06-26
### Fixed
- Renamed and copied file order reversed in show commit view ([#926](https://github.com/MitMaro/git-interactive-rebase-tool/pull/926))

## [2.4.0] - 2024-06-13
### Added
- Add support for `NO_COLOR` environment variable ([#896](https://github.com/MitMaro/git-interactive-rebase-tool/pull/896))
- Add support for `NO_COLOR` environment variable ([#896](https://github.com/MitMaro/git-interactive-rebase-tool/pull/896))
- Post modified line exec command ([#888](https://github.com/MitMaro/git-interactive-rebase-tool/pull/890))

### Changed
Expand Down Expand Up @@ -184,7 +188,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
### Added
- Initial project release

[Unreleased]: https://github.com/MitMaro/git-interactive-rebase-tool/compare/2.4.0...HEAD
[Unreleased]: https://github.com/MitMaro/git-interactive-rebase-tool/compare/2.4.1...HEAD
[2.4.1]: https://github.com/MitMaro/git-interactive-rebase-tool/compare/2.4.0...2.4.1
[2.4.0]: https://github.com/MitMaro/git-interactive-rebase-tool/compare/2.3.0...2.4.0
[2.3.0]: https://github.com/MitMaro/git-interactive-rebase-tool/compare/2.2.1...2.3.0
[2.2.1]: https://github.com/MitMaro/git-interactive-rebase-tool/compare/2.2.0...2.2.1
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "git-interactive-rebase-tool"
version = "2.4.0"
version = "2.4.1"
authors = ["Tim Oram <[email protected]>"]
license = "GPL-3.0-or-later"
description = "Full feature terminal based sequence editor for git interactive rebase."
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ Native cross-platform full feature terminal based [sequence editor][git-sequence

[![Git Interactive Rebase Tool](/docs/assets/images/girt-demo.gif?raw=true)](https://youtu.be/q3tzb-gQC0w)

**This is the documentation for the development build. For the current stable release, please use the [2.4.x documentation](https://github.com/MitMaro/git-interactive-rebase-tool/tree/2.4.0/README.md).**

## Table of Contents

* [Features](./README.md#features)
Expand Down
12 changes: 6 additions & 6 deletions src/modules/show_commit/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -386,10 +386,10 @@ fn render_overview_with_file_stats() {
test_context.build_view_data(&mut module),
"{IndicatorColor}0{Normal} files with {DiffAddColor}0{Normal} insertions and \
{DiffRemoveColor}0{Normal} deletions",
"{DiffChangeColor} renamed: {DiffRemoveColor}file.1b{Normal} → {DiffAddColor}file.1a",
"{DiffChangeColor} renamed: {DiffRemoveColor}file.1a{Normal} → {DiffAddColor}file.1b",
"{DiffAddColor} added: file.2a",
"{DiffRemoveColor} deleted: file.3a",
"{DiffAddColor} copied: {Normal}file.4b → {DiffAddColor}file.4a",
"{DiffAddColor} copied: {Normal}file.4a → {DiffAddColor}file.4b",
"{DiffChangeColor}modified: file.5a",
"{DiffChangeColor} changed: file.6a",
"{Normal} unknown: file.7a"
Expand Down Expand Up @@ -455,10 +455,10 @@ fn render_overview_with_file_stats_compact() {
Skip 2,
test_context.build_view_data(&mut module),
"{IndicatorColor}0{Normal} / {DiffAddColor}0{Normal} / {DiffRemoveColor}0",
"{DiffChangeColor}R {DiffRemoveColor}file.1b{Normal}→{DiffAddColor}file.1a",
"{DiffChangeColor}R {DiffRemoveColor}file.1a{Normal}→{DiffAddColor}file.1b",
"{DiffAddColor}A file.2a",
"{DiffRemoveColor}D file.3a",
"{DiffAddColor}C {Normal}file.4b→{DiffAddColor}file.4a",
"{DiffAddColor}C {Normal}file.4a→{DiffAddColor}file.4b",
"{DiffChangeColor}M file.5a",
"{DiffChangeColor}T file.6a",
"{Normal}X file.7a"
Expand Down Expand Up @@ -735,13 +735,13 @@ fn render_diff_basic_file_stats() {
{DiffRemoveColor}0{Normal} deletions",
"{BODY}",
"{Normal}{Pad(―)}",
"{DiffChangeColor} renamed: {DiffRemoveColor}file.1b{Normal} → {DiffAddColor}file.1a",
"{DiffChangeColor} renamed: {DiffRemoveColor}file.1a{Normal} → {DiffAddColor}file.1b",
"{Normal}{Pad(―)}",
"{DiffAddColor} added: file.2a",
"{Normal}{Pad(―)}",
"{DiffRemoveColor} deleted: file.3a",
"{Normal}{Pad(―)}",
"{DiffAddColor} copied: {Normal}file.4b → {DiffAddColor}file.4a",
"{DiffAddColor} copied: {Normal}file.4a → {DiffAddColor}file.4b",
"{Normal}{Pad(―)}",
"{DiffChangeColor}modified: file.5a",
"{Normal}{Pad(―)}",
Expand Down
8 changes: 4 additions & 4 deletions src/modules/show_commit/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,17 @@ pub(super) fn get_stat_item_segments(
Status::Copied => {
vec![
LineSegment::new_with_color(status_name.as_str(), color),
LineSegment::new_with_color(to_name.to_str().unwrap_or("invalid"), DisplayColor::Normal),
LineSegment::new_with_color(from_name.to_str().unwrap_or("invalid"), DisplayColor::Normal),
LineSegment::new(to_file_indicator),
LineSegment::new_with_color(from_name.to_str().unwrap_or("invalid"), DisplayColor::DiffAddColor),
LineSegment::new_with_color(to_name.to_str().unwrap_or("invalid"), DisplayColor::DiffAddColor),
]
},
Status::Renamed => {
vec![
LineSegment::new_with_color(status_name.as_str(), color),
LineSegment::new_with_color(to_name.to_str().unwrap_or("invalid"), DisplayColor::DiffRemoveColor),
LineSegment::new_with_color(from_name.to_str().unwrap_or("invalid"), DisplayColor::DiffRemoveColor),
LineSegment::new(to_file_indicator),
LineSegment::new_with_color(from_name.to_str().unwrap_or("invalid"), DisplayColor::DiffAddColor),
LineSegment::new_with_color(to_name.to_str().unwrap_or("invalid"), DisplayColor::DiffAddColor),
]
},
_ => {
Expand Down

0 comments on commit 30c7199

Please sign in to comment.