-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Allow 'bat' application to built without git feature, remove PrettyPrint git support when feature not enabled. #997
Conversation
Thank you, looks good to me!
Okay.
I guess that's something we can live with. Help text ( I have two comments:
For now, I have set up a "saved reply" along the lines of:
|
visible_lines: match self.matches.is_present("diff") { | ||
#[cfg(feature = "git")] | ||
true => VisibleLines::DiffContext( |
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.
I see why you chose to use a match
statement here, but this is a bit difficult to read. I don't know a better solution of the top of my head, though.
I guess if cfg!(…)
does not work because DiffContext
is not available if git
is not set?
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.
I guess if cfg!(…) does not work because DiffContext is not available if git is not set?
Pretty much. I agree that it's a bit difficult to read, but it was also the smallest change to make it work properly without duplicating code to handle both git
support and no git
support.
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.
Ok
Sort of. It removes the related entries, but it doesn't remove any references to them from the descriptions of other arguments (e.g. the description for
For future reference, does this include testing or developer-only (internal, not |
I agree.
Good question. I would exclude everything that is not of interest to (1) users of |
Caveats: The help descriptions aren't changed with you remove the "git" feature.
Rebased and added a changelog update. I didn't mention building |
Released in bat v0.15.2. |
This pull request changes two things:
(bat-as-a-library; breaking change)
When the
git
feature is not enabled, it removesPrettyPrinter::vcs_modification_markers
. This function was previously being exposed when the feature was disabled, despite not having any effect when used.(bat)
Adds
cfg
flags to allow thebat
application to build without requiring thegit
feature. This would allow people to buildbat
without git support if they don't feel they would need or use it.Caveats: Unfortunately, disabling the feature doesn't change the help text or generated manpage.