Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

diff: correct diff stat alignment in presence of renames w/ common prefix.#7057

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ethomson merged 3 commits intolibgit2:mainfromkivikakk:diff-stat-alignment
Jun 5, 2025

Conversation

kivikakk
Copy link
Contributor

Hi old friends!

I noticed that libgit2's diff stat has its alignment get thrown out in the presence of renames where there's a common prefix, e.g.:

 lib/nos_web/controllers/user_controller.ex                                   | 7 ++++++- lib/nos_web/controllers/{page_html.ex => user_html.ex} | 8 ++----- lib/nos_web/controllers/user_html/show.html.heex                             | 3 +++-

This PR adds a test for this (fails onmain), and then fixes it by reproducing the common prefix detection when calculatinggit_diff_stats'smax_name member. That now fully accounts for the various formats (i.e.samename,oldname => newname,prefix{oldsuffix => newsuffix}).

This removed the sole use ofrenames in the same struct, so I dropped it.

@ethomson
Copy link
Member

Thanks for the fix!

kivikakk reacted with heart emoji

@ethomsonethomson merged commitd0da681 intolibgit2:mainJun 5, 2025
14 checks passed
@kivikakk
Copy link
ContributorAuthor

Thanks! :)

@kivikakkkivikakk deleted the diff-stat-alignment branchJune 5, 2025 13:02
@ethomsonethomson added the bug labelJun 6, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ethomsonethomsonethomson approved these changes

Assignees
No one assigned
Labels
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@kivikakk@ethomson

[8]ページ先頭

©2009-2025 Movatter.jp