From: Phillip Wood Date: Tue, 15 Feb 2022 16:24:26 GMT Subject: js/use-builtin-add-i (was Re: What's cooking in git.git (Feb 2022, #03; Sat, 12)) Message-ID: <005d5f82-ae13-992a-3df9-2738f348e01e@gmail.com> In-Reply-To: > * js/use-builtin-add-i (2021-12-01) 2 commits > - add -i: default to the built-in implementation > - t2016: require the PERL prereq only when necessary > > "git add -i" was rewritten in C some time ago and has been in > testing; the reimplementation is now exposed to general public by > default. > > On hold. > > What's the status of the "known breakage"? > Are we ready to switch if we wanted to? > There are known breakages on macOS. > cf. > source: [disclaimer: I don't have access to a mac so this is based on web searches] As I understand it the breakage is that we don't handle escape sequences properly on macos and a key that emits an escape sequence may be interpreted as a different key and confuse the user. However there is no way to remap the keys used by "add -p" and we don't use any keys that emit escape sequences. On my linux laptop the builtin "add -p" recognizes "F2" as "Q" so there is another bug with the escape sequence handling that is not macos specific (the perl version reads the escape sequence correctly). The macos problem is caused by poll() not working with stdin as it is a device (see bugs in [1]). It is possible to use select() instead and this is what libuv does[2]. Looking at the result of "git grep 'poll('" we never poll more than three file descriptors so we could add a git_poll() function in compat/ which uses select() and add #ifdef __APPLE__ #define poll(fds, nfds, timeout) git_poll(fds, nfds, timeout) #endif to git-compat-util.h I haven't looked at what's causing the problem with "F2" being recognized as "Q" yet. That and the macos problem feel like fairly minor regressions as they only affect keys that we do not use. Best Wishes Phillip [1] https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/poll.2.html [2] https://github.com/libuv/libuv/commit/731adacad2426d349d4c51ca608184f7e01c93c6