Comments (5)
Calling find_similar
in diff_staged
here did the trick:
diff.find_similar(Some(&mut DiffFindOptions::new().renames(true)))?;
Using git status
![image](https://private-user-images.githubusercontent.com/12673605/352864467-0faf8df4-8249-471c-be55-34c47bde8f9e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjMyNjA4NjUsIm5iZiI6MTcyMzI2MDU2NSwicGF0aCI6Ii8xMjY3MzYwNS8zNTI4NjQ0NjctMGZhZjhkZjQtODI0OS00NzFjLWJlNTUtMzRjNDdiZGU4ZjllLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODEwVDAzMjkyNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTJmYjI1NzBlZjljOTQ2NzFlY2YwYTYyY2IxZTY2MzJhYTAzNjRhYzE0MjVkZTlkOGI0Yjk4ZWU5YzBmYjdlMWQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.09bkQiVy-98xBWyw6WP_TiczHaWxOi_G6xZV9yUmfZo)
Using gitu
![image](https://private-user-images.githubusercontent.com/12673605/352864521-3775748d-0c1f-47b7-89c5-2b3bbe335ff2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjMyNjA4NjUsIm5iZiI6MTcyMzI2MDU2NSwicGF0aCI6Ii8xMjY3MzYwNS8zNTI4NjQ1MjEtMzc3NTc0OGQtMGMxZi00N2I3LTg5YzUtMmIzYmJlMzM1ZmYyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODEwVDAzMjkyNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWZkOWExOTc0NzFhNTUyODFmZWM5YzQ2Nzg5NjQ0MmUwMmFmNTYxMDI5ZWQ3YjkxNTViZjNkNmQxZDhjZWI3MTMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.5rhVWmybXa7e7ablovN-N3rNrFjboxRx2SAZA1vl1fE)
I tried to adjust the rendering to match the git status
output e.g. renamed old_file -> new_file
but my non-existent Rust experience failed me. I couldn't find the responsible code. Any pointers @altsem 😅? also, the misalignment of the columns is super annoying.
from gitu.
Thanks @altsem. I will open a PR shortly
Edit: PR is live
from gitu.
Sorry that I accidentally opened multiple duplicates of this issue. I really don't know how it happened. 🤷 😅
I hope it's easy to remove them.
from gitu.
Np! This is something I've been wanting to get right. Think there's some "move detection" you can configure in libgit2 to make it work. Haven't looked into it too deep.
from gitu.
Cool! 🙌
@z0al this should be the piece of code responsible for formatting those lines:
https://github.com/altsem/gitu/blob/master/src/items.rs#L55
from gitu.
Related Issues (20)
- Log graph
- Log authors
- Disable/enable push ops depending on whether the HEAD is detached or not.
- [Bug] incorrect diff if file uses CRLF line endings HOT 3
- did 0.19.2 get re-tagged? HOT 2
- error compiling version 20.1 HOT 6
- [Feature Request] Not to show files listed in `.git/info/exclude` HOT 7
- Vim hangs when opening from gitu on Windows HOT 8
- building with flake failed
- Thank you! HOT 1
- Leading tabs not displayed in diffs HOT 2
- Compile error on Windows HOT 1
- Add to winget-pkgs
- option to change bar character for non-nerd fonts HOT 3
- Linux: invalid data in index - calculated checksum does not match expected HOT 2
- Getting "Standard input is not a terminal" with nano
- [Feature request] Support renamed' status for a file that have been moved/renamed via 'git mv'
- [Feature request] Support "renamed" status for a file that have been moved/renamed via "git mv
- Autostash when doing instant fixup
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gitu.