Page MenuHomePhabricator

Write patterns to "git grep" on stdin instead of passing them with "-e"
ClosedPublic

Authored by epriestley on Jun 8 2017, 12:56 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 17, 8:20 PM
Unknown Object (File)
Sat, Mar 30, 4:45 AM
Unknown Object (File)
Fri, Mar 29, 1:30 AM
Unknown Object (File)
Thu, Mar 28, 11:10 AM
Unknown Object (File)
Mar 10 2024, 8:04 AM
Unknown Object (File)
Feb 27 2024, 12:27 PM
Unknown Object (File)
Feb 3 2024, 4:10 PM
Unknown Object (File)
Dec 27 2023, 11:26 AM
Subscribers
None

Details

Summary

Fixes T12807. Some shells may apparently mangle/strip UTF8 characters? Just dodge this whole problem by sending the pattern over stdin rather than actually figuring out the particulars.

Related tasks, like T7339 and T5554, discuss finding broader fixes for this class of issue, and this definitely isn't exactly a fully legitimate fix, but in many cases (as here) we can reasonably just avoid the problem rather than actually fixing it, at least for a long time.

Test Plan

Searched for emoji and non-emoji locally, but this worked fine (on OSX) for me before the patch too.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Jun 8 2017, 10:00 PM
This revision was automatically updated to reflect the committed changes.

For completeness, T13060 eventually got to the bottom of this: if the parent process has LANG=POSIX or similar, it can not encode UTF8 characters into subprocess command lines without changing the locale setting first.