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
F13133507: D18105.diff
Wed, May 1, 10:20 PM
Unknown Object (File)
Sat, Apr 27, 6:17 AM
Unknown Object (File)
Thu, Apr 25, 1:18 AM
Unknown Object (File)
Thu, Apr 25, 1:18 AM
Unknown Object (File)
Fri, Apr 19, 6:36 PM
Unknown Object (File)
Wed, Apr 17, 8:20 PM
Unknown Object (File)
Mar 30 2024, 4:45 AM
Unknown Object (File)
Mar 29 2024, 1:30 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
Branch
utf81
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 17449
Build 23392: Run Core Tests
Build 23391: arc lint + arc unit

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.