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
F13195212: D18105.diff
Sun, May 12, 10:13 PM
F13192607: D18105.id.diff
Sun, May 12, 8:58 AM
F13178026: D18105.diff
Wed, May 8, 8:07 PM
Unknown Object (File)
Sun, May 5, 12:13 AM
Unknown Object (File)
Thu, May 2, 7:59 AM
Unknown Object (File)
Wed, May 1, 10:20 PM
Unknown Object (File)
Sat, Apr 27, 6:17 AM
Unknown Object (File)
Thu, Apr 25, 1:18 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.