MitMaro/git-interactive-rebase-tool

Commit information for renamed files in reverse order

Closed this issue ยท 5 comments

When pressing "c" to view commit information, I see:

renamed: foo/bar.java -> buzz/bar.java

However, bar.java moved from buzz to foo.

git log --stat 1234 displays:

{buzz => foo}/bar.java      | 0

Version: 2.4.0

I'm using the tool for more than a year, if not more, and I had never noticed the c command.

You made my day @StephenGregory

Thanks for the bug report @StephenGregory !

Looks like the mistake is here

match status {
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(to_file_indicator),
LineSegment::new_with_color(from_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(to_file_indicator),
LineSegment::new_with_color(from_name.to_str().unwrap_or("invalid"), DisplayColor::DiffAddColor),
]
},
_ => {
vec![
LineSegment::new_with_color(status_name.as_str(), color),
LineSegment::new_with_color(from_name.to_str().unwrap_or("invalid"), color),
]
},
}

I would like to say that was due to some refactoring I did with the recent release, but it's existed for around 5 years. ๐Ÿ˜…

Thankfully it should be an easy fix, and I can push out a release shortly after.

Do we win something ? like the one who find the oldest bug gets a laptop sticker?

Interestingly enough, I'm pretty sure @StephenGregory has a sticker on a laptop that I probably gave him, though that was years ago.

@ccoVeille , if you were geographically closer, I would gladly provide a sticker for a community group I help run. :D

France here, how far are you?

Canada apparently ๐Ÿ ๐Ÿ‡จ๐Ÿ‡ฆ ๐Ÿ˜