Skip to content
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

Use --null to disambiguate numeric filenames #28

Merged
merged 2 commits into from
Nov 12, 2016

Conversation

CyberShadow
Copy link
Contributor

@CyberShadow CyberShadow commented Nov 12, 2016

Fixes opening files from results with filenames such as "1-2-3".

Unfortunately the output of git grep --null doesn't distinguish between matching and context lines, so that information is lost.

An alternative would be to use --color and specify color.grep.* explicitly on the command-line, though that is potentially more fragile and doesn't provide perfect escaping (a file name may contain an ANSI color sequence on POSIX).

I would like to add a test for this, however there doesn't appear to be any tests which actually invoke git grep, so the only option would be to test parsing of simulated git output.

@coveralls
Copy link

coveralls commented Nov 12, 2016

Coverage Status

Coverage increased (+1.5%) to 46.479% when pulling deb9bba on CyberShadow:pull-20161112-051920 into b0bb524 on yasuyk:master.

@yasuyk yasuyk merged commit deb9bba into yasuyk:master Nov 12, 2016
yasuyk added a commit that referenced this pull request Nov 12, 2016
@yasuyk
Copy link
Owner

yasuyk commented Nov 12, 2016

@CyberShadow Thank you for your contribution! 😄

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

Successfully merging this pull request may close these issues.

3 participants