Skip to content

view like git diff --color-moved #865

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

Open
skyfaller opened this issue Aug 21, 2021 · 15 comments
Open

view like git diff --color-moved #865

skyfaller opened this issue Aug 21, 2021 · 15 comments

Comments

@skyfaller
Copy link

skyfaller commented Aug 21, 2021

Sometimes code has simply been moved around, rather than deleted or added. It would be nice to be able to see this at a glance. The command git diff --color-moved will display this, or you can set --color-moved to be git's default with a command like git config --global diff.colorMoved default.

Sadly I do not see an option to achieve this behavior in gitui.

Describe the solution you'd like
I would like an option to make code that has been moved visually distinct from code that has been added or deleted. I think this should be visible when viewing diffs in the Status [1] tab.

Personally I think this should be enabled by default, but I'm certain some number of people will disagree with me.

Describe alternatives you've considered
The alternatives are manually looking to see whether code has merely moved, or to drop back to the git command line.

Additional context
delta successfully supports this feature: dandavison/delta#72

Here's a blog post that alerted me to the existence of this feature: https://danyspin97.org/blog/modern-cli-applications-part-1/#bonus-color-moved

@stale
Copy link

stale bot commented Nov 19, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the dormant Marked by stale bot on close label Nov 19, 2021
@skyfaller
Copy link
Author

Please remove stale bot, it contributes nothing to the conversation: #996

This still seems like a desirable feature that shouldn't be too hard to add.

@stale stale bot removed the dormant Marked by stale bot on close label Nov 19, 2021
@extrawurst
Copy link
Collaborator

@skyfaller I appreciate you bringing up this feature request but it did not convince any contributor willing to invest their free time to work on it. the stale bot is not deleting or preventing active conversations. this ticket stays around forever and for future reference.

Still if the bot would not be around I would manually close issues that qualify as:

  • not actively discussed
  • not actively worked on
  • not part of the roadmap
  • not committed to being implemented by a contributor

this reduces the cognitive load of managing this project for me, nothing personal against you

@skyfaller
Copy link
Author

Can you say anything about what it would require to implement this feature, perhaps as guidance for someone looking to get involved with gitui development and finds this issue interesting? For example, where the code is that emits the diffs in the status tab?

Do you have any opinions on the three possible approaches that delta considered? Delta had to make some tradeoffs between syntax highlighting, Git's color-moved option nuances, and complexity/fragility, ultimately choosing to sacrifice syntax highlighting on moved lines for now. Are all of these options open to gitui? Would you want to make the same tradeoffs?

@stale
Copy link

stale bot commented May 31, 2022

This issue has been automatically marked as stale because it has not had any activity half a year. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the dormant Marked by stale bot on close label May 31, 2022
@skyfaller
Copy link
Author

Another related feature that would be cool is git diff --color-moved-ws which controls how whitespace is or isn’t ignored when colorizing diffs. You can think of it like the other space-ignoring options (like --ignore-space-at-eol, --ignore-space-change, or --ignore-all-space), but specifically for when you’re running diff in the --color-moved mode.

Here's an example of how that is useful, when looking at code where the indentation changed but not much else: https://twitter.com/jb55/status/1129758919973396483

@stale stale bot removed the dormant Marked by stale bot on close label May 31, 2022
@stale
Copy link

stale bot commented Dec 21, 2022

This issue has been automatically marked as stale because it has not had any activity half a year. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the dormant Marked by stale bot on close label Dec 21, 2022
@skyfaller
Copy link
Author

I'll think of something productive to say next time stale bot rolls around. Right now I'm visiting my family for the solstice.

Happy holidays and a joyful new year to everyone, especially people working on gitui!

@skyfaller
Copy link
Author

Wait, is stale bot not counting my last comment? Why is this still marked as dormant? Has stale bot become sentient enough to recognize that my last comment only contained holiday greetings?

@stale stale bot removed the dormant Marked by stale bot on close label Dec 24, 2022
@stale
Copy link

stale bot commented Aug 12, 2023

This issue has been automatically marked as stale because it has not had any activity half a year. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the dormant Marked by stale bot on close label Aug 12, 2023
@skyfaller
Copy link
Author

How are you doing? My phone randomly died, but I'm finally back online with a new one. It's a beautiful summer day, maybe I'll go for a bike ride tonight.

Keep up the good work, and please don't mark this issue as stale!

@skyfaller
Copy link
Author

I didn't make it out for a bike ride the other night, but here's an Eastern Tiger Swallowtail on a butterfly bush!

PXL_20230727_165104583~2.jpg

If stale bot likes butterfly pictures, I have more where that came from ;-)

But seriously, what is going on here? Did stale bot level up so that it takes two posts to defeat it now?

@stale stale bot removed the dormant Marked by stale bot on close label Aug 22, 2023
Copy link

stale bot commented Mar 17, 2024

This issue has been automatically marked as stale because it has not had any activity half a year. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

@skyfaller
Copy link
Author

I have nothing to report about git diff --color-moved, but today I saw a house finch up close for the first time in person. It landed on a bird feeder about five feet from my head, and I was able to appreciate its red plumage in detail.

I'm really excited because goldfinches have nested in the trees across the street for the last couple of years, and the other day I heard and saw a goldfinch there again! Maybe we will soon welcome more tiny goldfinches to the neighborhood.

Those colors sure are moving :-)

@skyfaller
Copy link
Author

Aww man, are we still requiring the stale bot double-tap? Here's comment number two.

I had to bike home in the rain today and got really grumpy, but then I thought about this sign I saw in my neighborhood last week.

PXL_20240329_202641841.jpg

What do you get when you get more rain? More rainbows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants