-
Notifications
You must be signed in to change notification settings - Fork 335
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
Draw ruler and box around headers #398
Conversation
fde773f
to
86fdffd
Compare
# Mercurial coloring is slightly different so we need to hard reset colors | ||
if ($is_mercurial) { | ||
print $reset_color; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
horizontal_rule was already printing $reset_color at the end of the line, so an extra $reset_color here was redundant.
Several of the things you fixed are already fixed on |
Hi @scottchiefbaker, sure! Let me rebase it. |
This comment has been minimized.
This comment has been minimized.
@scottchiefbaker, I apologize about the confusion I've made around the fix for the "Use of uninitialized value $less_charset in pattern match" error. I didn't notice it was already fixed in the The only failure still left in this PR is in the macOS build, which seems to have been fixed in #403, but was merged to |
I've been hemming and hawing over this issue for a while. Personally I don't think I would use, but I can definitely some people in the community wanting it. The issue then becomes that we need to make this a configuration option to allow people to opt in/out of this feature. Right now every time d-s-f starts up we shell out to |
Cool. I see d-s-f is already caching the git config output in Besides that, the code also uses Also, I'm doing the following in the only config-related code that I've added:
meaning it's first tries to use the color matched in the regexp, using the same optimization that you already pointed out before. So there's room to make it even more optimized than what it was before this PR. :- ) Are you benchmarking d-s-f with any specific script? |
@ericbn I just landed some commits to handle caching of |
@ericbn I'm circling back to this now that I got our startup issues figured out. I removed the |
Hi @scottchiefbaker. I'm loving all the recent optimizations. I've just rebased the PR commit and updated it to hardcode the UTF-8 encodings. Thanks! |
Does this kick in if there is a commit line, or all the time? Seems like this is a |
@scottchiefbaker, correct: the "commit lines" show up in Do you want me to change it so the "top hierarchical lines" (commits in show and log, meta in diff) will always show with the wide lines, and the "bottom hierarchical lines" (meta in show and log, N/A in diff) will always show with the tighter box? |
Rulers are drawn around the first level of headers, and boxes around the second level of headers, if any. The `diff-so-fancy.rulerWidth` config still applies, but only to the rulers. Boxes have just the size of the text inside them. `git show` and `git log` have two levels of headers: (1) commit, and (2) meta (e.g. `modified: diff-so-fancy`). `git diff` only has one level of headers: meta. This allows for a better hierarchical view of commits specifically, with commit lines having a configurable wider ruler around them and meta lines ("children" of commits) having a shorter box around them.
@scottchiefbaker, I've updated the PR so the behavior with |
Hi @scottchiefbaker. Anything I can still do in this PR for you to reconsider it? I'm refactoring some of the current code here, and at the end the change only has 10 extra lines (and 5 of those are comment lines). |
@ericbn thanks for bringing this back up... It slipped off my radar. Ultimately I think it boils down to "do our users want this". It adds two additional lines to each commit line, and changes how the added/modified/removed lines work. Anytime there is change, users notice (and complain). I think it boils down to "is this a good enough addition to warrant the change", and I don't have a good answer to that. Perhaps we should take a vote of the core developers to see what their take is? |
Hi @scottchiefbaker. Sure, votes from the core developers sounds good to me. Please all note that the changes I'm proposing here don't affect the output of EDIT: Hopefully this is the kind of change the users will notice and appreciate! :- ) |
I for one would definitely vote for this feature enhancement! |
Any news about this change? This PR seems to have been here a while. I also support making more visible the distinction between different commits; after all, if one is trying to show multiple commits rather than one large patch it means that looking at each commit's diff individually is valuable, and so the start and end point of each commit should be more visible (certainly more visible than the header for each individual file change). |
@scottchiefbaker wrote:
and later:
personally I do like it, but given a config option it could just be default off if concerned about that? Leave default-on for a major version bump? |
I'm going to close this issue and move discussion over to #497. |
Rulers are drawn around the first level of headers, and boxes around the second level of headers, if any.
The
diff-so-fancy.rulerWidth
config still applies, but only to the rulers. Boxes have just the size of the text inside them. E.g.git show
andgit log
have two levels of headers: (1) commit, and (2) meta (e.g.modified: diff-so-fancy
).git diff
only has one level of headers: meta.This allows for a better hierarchical view of commits specifically, with commit lines having a configurable wider ruler around them and meta lines ("children" of commits) having a shorter box around them.