From patchwork Fri Mar 11 21:14:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Hostetler X-Patchwork-Id: 12778597 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A3216C433EF for ; Fri, 11 Mar 2022 22:28:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229525AbiCKW32 (ORCPT ); Fri, 11 Mar 2022 17:29:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229474AbiCKW3T (ORCPT ); Fri, 11 Mar 2022 17:29:19 -0500 Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B4F627AE87 for ; Fri, 11 Mar 2022 14:18:53 -0800 (PST) Received: by mail-ej1-f43.google.com with SMTP id qt6so21877005ejb.11 for ; Fri, 11 Mar 2022 14:18:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=EsZjPISOsxY8eLD0WyooDenwtD/HwaAWi5+s5m7e8aY=; b=MGZ/vYZyIAP0Xgiq4fPaKn1g75kQAmBpe1YVVDrw75Epw+wpA+xs+CmN9+9tnNP4yW p2BnmdD+3ynFlGh2TkAcfTWmzvnRcBNa8ZcyFRpv2ajAM/XmjuPTY9/gSbpSxArjSSLG dOrPgKKbHtkk6+4BR4G5D27o7gZ/vyNeulIcIvIKFD6dFCudjgxlO3BBMJUEHtL9qksm roCLXNnqOIWCSdahgnjN6i9aEXdI+/4QKLX+CAkt/Qt8O9pT8IXoKI5YwuCMP944hJgm PT6DqN85qYK8QTVW1XcCOfJUKaJDaGNCuMkD9jmrE2bXkrxBJolbOPaqWkHwWSuVgOF3 pqdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=EsZjPISOsxY8eLD0WyooDenwtD/HwaAWi5+s5m7e8aY=; b=5ql1AbYWDg/Gnlqn+jbRd1O0WCv6BNCdi32gAS24CcNem60K1VaBkaJTP5GUMJaaPb fMC7lcebrrpFEFkzgHz2JVQn9PHfoLkR9GtX3kkewoNNeSPDGQKWX29G8FBKjiHbhhL5 KaplpcQdGow3JVw457pGEUawoM7V8YLbDdFUngkmMKqN16gmr79GUBtiLY+crXGMzbDg 8IlkycaXCJ5JA8n+USlHXGpcjlm0XdlHbPbLbDM/Fa7pSXjQzSvg+4hmp4tmp9PDIglK iudj8h1uQnwzor9UUe2Ddygd3Xz8uCZ/HM/veqrlBcGKc+fulU680U5dhajJf1nAHCB6 8ouA== X-Gm-Message-State: AOAM533M15C9VbpThGgv+rgOmvNhWbauLcVkDnFABDjfdZVLbZmxtnlB 3mXeODwb6wjb1GBjy5+JIG5TDbWdTKA= X-Google-Smtp-Source: ABdhPJxXQ6/Gf+8ACLh9NlbC+/UitqRr/CX5LeD80lO6ETJndfTfCqHpzYSttlLKa5cdFNwM0PHT6Q== X-Received: by 2002:a5d:4609:0:b0:1f1:de8a:af07 with SMTP id t9-20020a5d4609000000b001f1de8aaf07mr8628634wrq.549.1647033305091; Fri, 11 Mar 2022 13:15:05 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id m1-20020a5d56c1000000b001f0626c9360sm7382556wrw.44.2022.03.11.13.15.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 13:15:04 -0800 (PST) Message-Id: <6750cc17bc439c14e752606fbb7271086a802eaf.1647033303.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Fri, 11 Mar 2022 21:14:48 +0000 Subject: [PATCH 01/16] t/test-lib: avoid using git on LHS of pipe Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Jeff Hostetler , Jeff Hostetler Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Jeff Hostetler From: Jeff Hostetler fixup! help: include fsmonitor--daemon feature flag in version info Signed-off-by: Jeff Hostetler --- t/test-lib.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/t/test-lib.sh b/t/test-lib.sh index 46cd596e7f5..5d819c1bc11 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -1803,5 +1803,6 @@ GIT_TEST_MAINT_SCHEDULER="none:exit 1" # Does this platform support `git fsmonitor--daemon` # test_lazy_prereq FSMONITOR_DAEMON ' - git version --build-options | grep "feature:" | grep "fsmonitor--daemon" + git version --build-options >output && + grep "feature: fsmonitor--daemon" output ' From patchwork Fri Mar 11 21:14:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Hostetler X-Patchwork-Id: 12778613 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 258FDC433EF for ; Fri, 11 Mar 2022 22:44:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229667AbiCKWpP (ORCPT ); Fri, 11 Mar 2022 17:45:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229565AbiCKWpE (ORCPT ); Fri, 11 Mar 2022 17:45:04 -0500 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E24CF2A2B8F for ; Fri, 11 Mar 2022 14:20:39 -0800 (PST) Received: by mail-wr1-x42a.google.com with SMTP id e24so14919154wrc.10 for ; Fri, 11 Mar 2022 14:20:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=3c7ydlmQ53sqRJH1OosOcQSL0/HsDNFwmPeVLl3iFxs=; b=ZTkeitpcxMaWjLxNYCKTdd3ExzvKzmI0PkmYnbIq1O7NDUkYBGHv6SArUrxBd+7z0B DOisZGu1I1e3jFAvYwf/tVOTyx8ClFvs6j5gddIKkNVW53c5CNkEwXlOT17PijK1bzbN nnQaPw5riYj/2PvcnpHpl7li3NOXctb30vMUTLz3uCSH5ftgMQCuoMqgeDhG6t8YdqhS UhynQJAlM1cfRms7kANA5cRcLCdQKP3EpJZYHYVpUa5026Zwb7SdAZkaJMJ07EN/b1jv MvXLrNZZexOpyPxVtzC2//Nb5sZRreY/ASHpevjLZG8vzCh2KYILYhAoW6fNnP2WhU3C MQlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=3c7ydlmQ53sqRJH1OosOcQSL0/HsDNFwmPeVLl3iFxs=; b=iOXbqjH4xCjI4zZzc2hcfRIg0FxPwRdZCBDgyUkaVzlmtCCgRqxCZrKAcr2ba9v1ph bkJ00B6yY/Y4gJhEIFsA08NLOVvT7QufAC1PeTJPxgDcW2eLDeNMOuzz452pEZlwT7Do aYAe52o7cXQnSMkmJfDOyCxoPro8SXv7PgC8NW5wXZZf5BhnTAJCU4ewsr+q/jWhESSZ 7ppTKWHEDoqk/w+Toh9+WgZq7XuRCJtZa2qirMudv2alOA/msN5CdjLEPxU2UuLxvHm8 C9lgPyfiL0NrJLMVfBRqtcV++PgwGyltffPT5FOMyJacTJVc4PpISJEIwIMi37ba3Fhw IJOQ== X-Gm-Message-State: AOAM532TmUbcAxCdl3MlBUs+7Bqu+ou7moc6FJScqkFbT1DGUbMfKKNN b+pHw/MNFJl9pOzxphzxT6aG2W+ihso= X-Google-Smtp-Source: ABdhPJxT/JV3XSxYqkpoDqa8BVoSCy4C2OR5knltDARJDRcyilQZae3c3hwxtaON1AfGTgx0ayB7kQ== X-Received: by 2002:a5d:69d0:0:b0:1f1:fd05:e863 with SMTP id s16-20020a5d69d0000000b001f1fd05e863mr8769989wrw.223.1647033305871; Fri, 11 Mar 2022 13:15:05 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id p26-20020a7bcc9a000000b00389f80668cesm962222wma.28.2022.03.11.13.15.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 13:15:05 -0800 (PST) Message-Id: In-Reply-To: References: Date: Fri, 11 Mar 2022 21:14:49 +0000 Subject: [PATCH 02/16] update-index: convert advise() messages back to warning() Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Jeff Hostetler , Jeff Hostetler Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Jeff Hostetler From: Jeff Hostetler fixup! update-index: convert fsmonitor warnings to advise Signed-off-by: Jeff Hostetler --- builtin/update-index.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/builtin/update-index.c b/builtin/update-index.c index d335f1ac72a..75d646377cc 100644 --- a/builtin/update-index.c +++ b/builtin/update-index.c @@ -1238,18 +1238,18 @@ int cmd_update_index(int argc, const char **argv, const char *prefix) if (fsmonitor > 0) { enum fsmonitor_mode fsm_mode = fsm_settings__get_mode(r); if (fsm_mode == FSMONITOR_MODE_DISABLED) { - advise(_("core.fsmonitor is unset; " - "set it if you really want to " - "enable fsmonitor")); + warning(_("core.fsmonitor is unset; " + "set it if you really want to " + "enable fsmonitor")); } add_fsmonitor(&the_index); report(_("fsmonitor enabled")); } else if (!fsmonitor) { enum fsmonitor_mode fsm_mode = fsm_settings__get_mode(r); if (fsm_mode > FSMONITOR_MODE_DISABLED) - advise(_("core.fsmonitor is set; " - "remove it if you really want to " - "disable fsmonitor")); + warning(_("core.fsmonitor is set; " + "remove it if you really want to " + "disable fsmonitor")); remove_fsmonitor(&the_index); report(_("fsmonitor disabled")); } From patchwork Fri Mar 11 21:14:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Hostetler X-Patchwork-Id: 12778631 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3224C433EF for ; Fri, 11 Mar 2022 22:50:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229817AbiCKWv0 (ORCPT ); Fri, 11 Mar 2022 17:51:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229920AbiCKWvQ (ORCPT ); Fri, 11 Mar 2022 17:51:16 -0500 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D2A51160DF for ; Fri, 11 Mar 2022 14:25:16 -0800 (PST) Received: by mail-ej1-x62c.google.com with SMTP id qx21so21888529ejb.13 for ; Fri, 11 Mar 2022 14:25:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=iW4pWJY0rbH40UwJ9FX+/j5CNTCDjj8eyDl/7ZDB4ME=; b=SSPEQFy8AUr3oHl2xk+r+QyIjTQRRnrBa+QLDoXLcIcnk8WNbDbrnxGyYqrNmmmF4p rDuhzanJB0NK1QK1U4kd8wNYcPkuPBdVIWRnvd+Ev4O+hcY7EZ/ymsoXIfkH6XkuLji8 C2CB7EEiPFeVkHErmBzT+27osU9cttvVyNeQsebJcMZRLgW144H5WIBMk6FQPNi578QX jJRJtC9WyStXWpIJHACvhzYbqePVj6N79IJUvjqDaaD+ilmI6tEeK8RHFuG0Lu/1sDzZ p7ILiVVGyXVy07NrwTOG2N9i2xzWFqzsJdw0J1VrzK5jM3wON89pRkk7j0noCiF1NRGF fSVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=iW4pWJY0rbH40UwJ9FX+/j5CNTCDjj8eyDl/7ZDB4ME=; b=g4V8NkfXW+hykzPSVJGikUT4+rFAauSygPI/CdDer2d2BBzYLtbBcjHGk6ITs3aWK6 uObzCoYvWb4/4ZnHansvICW2Pwu/7BAHJTqNsEy7fqH8HmaRg9HQIi4tmWWwnmzuETCC ZKhIhUZVyhBcfGEypT6x/PK5tS4XHKpzIN8av6iHggP7J0IgUZ/3miW/KIGjr+cOpQeG 3HJNZpcsVv+H6pfHd/H0Egg7rzQXUwwOcT4v1ezU+n2mQeZXn8JC44n00ieKnPt2iSIy fb1xuAIBT0UKmmesub/eZjUIKzKqvr9gohXuSwfnTTOOFf79R0MF1bxdugiTPyAdoLEr N8Fg== X-Gm-Message-State: AOAM530TwxZVUp3SmAkLOdAfN1VQzMKkgEQw2rDqeK9q5uGQ+91sobuT Em8vgayaD5ySBokp5ISyCEyBgQ7dDkc= X-Google-Smtp-Source: ABdhPJzaT1LCCEuK2ZWnGXuZQB+H/jwExWktQFX4SBViu5y3C20WFEH1W1Cu9WGZ/ylj+EKknIe3pg== X-Received: by 2002:adf:a1d5:0:b0:1f0:24f8:4c50 with SMTP id v21-20020adfa1d5000000b001f024f84c50mr8769884wrv.477.1647033306675; Fri, 11 Mar 2022 13:15:06 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id r1-20020a5d4941000000b001ed89dcacbbsm7463717wrs.23.2022.03.11.13.15.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 13:15:06 -0800 (PST) Message-Id: <2ddb702b330b1bdf7d81e006c5bbe3aee819c8be.1647033303.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Fri, 11 Mar 2022 21:14:50 +0000 Subject: [PATCH 03/16] compat/fsmonitor/fsm-listen-darwin: split out GCC-specific declarations Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Jeff Hostetler , Jeff Hostetler Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Jeff Hostetler From: Jeff Hostetler fixup! compat/fsmonitor/fsm-listen-darwin: add MacOS header files \ for FSEvent Split out GCC-specific MacOS declarations into separate file from the clang-specific header file includes to reduce visual noise. Eliminate unnecessary includes when using clang. Signed-off-by: Jeff Hostetler --- compat/fsmonitor/fsm-darwin-gcc.h | 92 ++++++++++++++++++++++++++++ compat/fsmonitor/fsm-listen-darwin.c | 91 +-------------------------- 2 files changed, 93 insertions(+), 90 deletions(-) create mode 100644 compat/fsmonitor/fsm-darwin-gcc.h diff --git a/compat/fsmonitor/fsm-darwin-gcc.h b/compat/fsmonitor/fsm-darwin-gcc.h new file mode 100644 index 00000000000..1c75c3d48e7 --- /dev/null +++ b/compat/fsmonitor/fsm-darwin-gcc.h @@ -0,0 +1,92 @@ +#ifndef FSM_DARWIN_GCC_H +#define FSM_DARWIN_GCC_H + +#ifndef __clang__ +/* + * It is possible to #include CoreFoundation/CoreFoundation.h when compiling + * with clang, but not with GCC as of time of writing. + * + * See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93082 for details. + */ +typedef unsigned int FSEventStreamCreateFlags; +#define kFSEventStreamEventFlagNone 0x00000000 +#define kFSEventStreamEventFlagMustScanSubDirs 0x00000001 +#define kFSEventStreamEventFlagUserDropped 0x00000002 +#define kFSEventStreamEventFlagKernelDropped 0x00000004 +#define kFSEventStreamEventFlagEventIdsWrapped 0x00000008 +#define kFSEventStreamEventFlagHistoryDone 0x00000010 +#define kFSEventStreamEventFlagRootChanged 0x00000020 +#define kFSEventStreamEventFlagMount 0x00000040 +#define kFSEventStreamEventFlagUnmount 0x00000080 +#define kFSEventStreamEventFlagItemCreated 0x00000100 +#define kFSEventStreamEventFlagItemRemoved 0x00000200 +#define kFSEventStreamEventFlagItemInodeMetaMod 0x00000400 +#define kFSEventStreamEventFlagItemRenamed 0x00000800 +#define kFSEventStreamEventFlagItemModified 0x00001000 +#define kFSEventStreamEventFlagItemFinderInfoMod 0x00002000 +#define kFSEventStreamEventFlagItemChangeOwner 0x00004000 +#define kFSEventStreamEventFlagItemXattrMod 0x00008000 +#define kFSEventStreamEventFlagItemIsFile 0x00010000 +#define kFSEventStreamEventFlagItemIsDir 0x00020000 +#define kFSEventStreamEventFlagItemIsSymlink 0x00040000 +#define kFSEventStreamEventFlagOwnEvent 0x00080000 +#define kFSEventStreamEventFlagItemIsHardlink 0x00100000 +#define kFSEventStreamEventFlagItemIsLastHardlink 0x00200000 +#define kFSEventStreamEventFlagItemCloned 0x00400000 + +typedef struct __FSEventStream *FSEventStreamRef; +typedef const FSEventStreamRef ConstFSEventStreamRef; + +typedef unsigned int CFStringEncoding; +#define kCFStringEncodingUTF8 0x08000100 + +typedef const struct __CFString *CFStringRef; +typedef const struct __CFArray *CFArrayRef; +typedef const struct __CFRunLoop *CFRunLoopRef; + +struct FSEventStreamContext { + long long version; + void *cb_data, *retain, *release, *copy_description; +}; + +typedef struct FSEventStreamContext FSEventStreamContext; +typedef unsigned int FSEventStreamEventFlags; +#define kFSEventStreamCreateFlagNoDefer 0x02 +#define kFSEventStreamCreateFlagWatchRoot 0x04 +#define kFSEventStreamCreateFlagFileEvents 0x10 + +typedef unsigned long long FSEventStreamEventId; +#define kFSEventStreamEventIdSinceNow 0xFFFFFFFFFFFFFFFFULL + +typedef void (*FSEventStreamCallback)(ConstFSEventStreamRef streamRef, + void *context, + __SIZE_TYPE__ num_of_events, + void *event_paths, + const FSEventStreamEventFlags event_flags[], + const FSEventStreamEventId event_ids[]); +typedef double CFTimeInterval; +FSEventStreamRef FSEventStreamCreate(void *allocator, + FSEventStreamCallback callback, + FSEventStreamContext *context, + CFArrayRef paths_to_watch, + FSEventStreamEventId since_when, + CFTimeInterval latency, + FSEventStreamCreateFlags flags); +CFStringRef CFStringCreateWithCString(void *allocator, const char *string, + CFStringEncoding encoding); +CFArrayRef CFArrayCreate(void *allocator, const void **items, long long count, + void *callbacks); +void CFRunLoopRun(void); +void CFRunLoopStop(CFRunLoopRef run_loop); +CFRunLoopRef CFRunLoopGetCurrent(void); +extern CFStringRef kCFRunLoopDefaultMode; +void FSEventStreamScheduleWithRunLoop(FSEventStreamRef stream, + CFRunLoopRef run_loop, + CFStringRef run_loop_mode); +unsigned char FSEventStreamStart(FSEventStreamRef stream); +void FSEventStreamStop(FSEventStreamRef stream); +void FSEventStreamInvalidate(FSEventStreamRef stream); +void FSEventStreamRelease(FSEventStreamRef stream); + +#endif /* !clang */ +#endif /* FSM_DARWIN_GCC_H */ diff --git a/compat/fsmonitor/fsm-listen-darwin.c b/compat/fsmonitor/fsm-listen-darwin.c index 5c5de1ae702..9a73fb607d5 100644 --- a/compat/fsmonitor/fsm-listen-darwin.c +++ b/compat/fsmonitor/fsm-listen-darwin.c @@ -1,95 +1,6 @@ #ifndef __clang__ -/* - * It is possible to #include CoreFoundation/CoreFoundation.h when compiling - * with clang, but not with GCC as of time of writing. - * - * See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93082 for details. - */ -typedef unsigned int FSEventStreamCreateFlags; -#define kFSEventStreamEventFlagNone 0x00000000 -#define kFSEventStreamEventFlagMustScanSubDirs 0x00000001 -#define kFSEventStreamEventFlagUserDropped 0x00000002 -#define kFSEventStreamEventFlagKernelDropped 0x00000004 -#define kFSEventStreamEventFlagEventIdsWrapped 0x00000008 -#define kFSEventStreamEventFlagHistoryDone 0x00000010 -#define kFSEventStreamEventFlagRootChanged 0x00000020 -#define kFSEventStreamEventFlagMount 0x00000040 -#define kFSEventStreamEventFlagUnmount 0x00000080 -#define kFSEventStreamEventFlagItemCreated 0x00000100 -#define kFSEventStreamEventFlagItemRemoved 0x00000200 -#define kFSEventStreamEventFlagItemInodeMetaMod 0x00000400 -#define kFSEventStreamEventFlagItemRenamed 0x00000800 -#define kFSEventStreamEventFlagItemModified 0x00001000 -#define kFSEventStreamEventFlagItemFinderInfoMod 0x00002000 -#define kFSEventStreamEventFlagItemChangeOwner 0x00004000 -#define kFSEventStreamEventFlagItemXattrMod 0x00008000 -#define kFSEventStreamEventFlagItemIsFile 0x00010000 -#define kFSEventStreamEventFlagItemIsDir 0x00020000 -#define kFSEventStreamEventFlagItemIsSymlink 0x00040000 -#define kFSEventStreamEventFlagOwnEvent 0x00080000 -#define kFSEventStreamEventFlagItemIsHardlink 0x00100000 -#define kFSEventStreamEventFlagItemIsLastHardlink 0x00200000 -#define kFSEventStreamEventFlagItemCloned 0x00400000 - -typedef struct __FSEventStream *FSEventStreamRef; -typedef const FSEventStreamRef ConstFSEventStreamRef; - -typedef unsigned int CFStringEncoding; -#define kCFStringEncodingUTF8 0x08000100 - -typedef const struct __CFString *CFStringRef; -typedef const struct __CFArray *CFArrayRef; -typedef const struct __CFRunLoop *CFRunLoopRef; - -struct FSEventStreamContext { - long long version; - void *cb_data, *retain, *release, *copy_description; -}; - -typedef struct FSEventStreamContext FSEventStreamContext; -typedef unsigned int FSEventStreamEventFlags; -#define kFSEventStreamCreateFlagNoDefer 0x02 -#define kFSEventStreamCreateFlagWatchRoot 0x04 -#define kFSEventStreamCreateFlagFileEvents 0x10 - -typedef unsigned long long FSEventStreamEventId; -#define kFSEventStreamEventIdSinceNow 0xFFFFFFFFFFFFFFFFULL - -typedef void (*FSEventStreamCallback)(ConstFSEventStreamRef streamRef, - void *context, - __SIZE_TYPE__ num_of_events, - void *event_paths, - const FSEventStreamEventFlags event_flags[], - const FSEventStreamEventId event_ids[]); -typedef double CFTimeInterval; -FSEventStreamRef FSEventStreamCreate(void *allocator, - FSEventStreamCallback callback, - FSEventStreamContext *context, - CFArrayRef paths_to_watch, - FSEventStreamEventId since_when, - CFTimeInterval latency, - FSEventStreamCreateFlags flags); -CFStringRef CFStringCreateWithCString(void *allocator, const char *string, - CFStringEncoding encoding); -CFArrayRef CFArrayCreate(void *allocator, const void **items, long long count, - void *callbacks); -void CFRunLoopRun(void); -void CFRunLoopStop(CFRunLoopRef run_loop); -CFRunLoopRef CFRunLoopGetCurrent(void); -extern CFStringRef kCFRunLoopDefaultMode; -void FSEventStreamScheduleWithRunLoop(FSEventStreamRef stream, - CFRunLoopRef run_loop, - CFStringRef run_loop_mode); -unsigned char FSEventStreamStart(FSEventStreamRef stream); -void FSEventStreamStop(FSEventStreamRef stream); -void FSEventStreamInvalidate(FSEventStreamRef stream); -void FSEventStreamRelease(FSEventStreamRef stream); +#include "fsm-darwin-gcc.h" #else -/* - * Let Apple's headers declare `isalnum()` first, before - * Git's headers override it via a constant - */ -#include #include #include #endif From patchwork Fri Mar 11 21:14:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Hostetler X-Patchwork-Id: 12778648 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5BE38C433EF for ; Fri, 11 Mar 2022 22:59:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230013AbiCKXAf (ORCPT ); Fri, 11 Mar 2022 18:00:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230029AbiCKXAY (ORCPT ); Fri, 11 Mar 2022 18:00:24 -0500 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E18A19457A for ; Fri, 11 Mar 2022 14:52:31 -0800 (PST) Received: by mail-ed1-x530.google.com with SMTP id g3so12675961edu.1 for ; Fri, 11 Mar 2022 14:52:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=Mix3EjUTYijfgFVhy/WdeKOxp1XxhU64A5fCjvbrgag=; b=ZXU6ou5u6CVLhumYICwZLXxKoFsFGJK3K+XqOxut9ZA0sfod37UTOGTkhGBYQaRaH4 6H/5AXV7UvFGTb1x6ZWw/vTyeLyEfwC6iVfjRnZKToFRwVCoXS/T6u9SbkqqrD73XEbE 4PiR9pToqBLtlPaPRLkncHZ0IPWEQudzowgPQdnHa7v0dpcNTeoDsfaRoN5+kByXGotx 9VnHK8kOigIV3rwiXDwr3ICF0HSYEnnHnEZqFrrJVBBG1qi6YDc+daLtZNwVFBi2aOYh YLjVIfjDMulThjAv4NaDFFUEJs4CHeIItUkFZSeqVfN44aDNI35wBRYzWpeNhmUN2RM6 NG/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=Mix3EjUTYijfgFVhy/WdeKOxp1XxhU64A5fCjvbrgag=; b=J2MAJ69PcsIiIOVMp1RZbgEkdvITbxjWKrFvt8A+lW1mIU4o/FD4O0nCA85FMPl6GP BsEz4x9naXoX9VZE27xQeM3vMq7rMb4Pq/aDdFlqPNCSpERXe0Exjr0LJW0oQEn5UA6Q E8djnNcJ3O2KBnzIA/rAHqGGOiJM35uijnqQsou+pYXavZb11a3JK7kftVxLOXaBBdMV PmfqDqEmE4M3HUlWtkjIBO90El4Hyf3NnfzgCZSnxm5qV4iueFd80LGxBPvt5FZ2qnaA sKUMR8lyqW2u9AD+18cGsS8XoBQWkBlstLovDm+YUNqFrSQSq7N3NQ9zaur8qX3wIJae 7F2w== X-Gm-Message-State: AOAM532DNqC98syqU799ZLzblrSoETOa5UQc3+gbiFEJVSEBe8FDAAxQ iUJhFAelI/6woLhCanDeivUOdgSEWj4= X-Google-Smtp-Source: ABdhPJx4N4HBSX8lAUjAFkPEauNCAtOzyJ23pcNugvVXr2+DOXBtlWtJ7btNajMBa0OI/zI23emOoQ== X-Received: by 2002:adf:b1da:0:b0:1f0:1205:89c1 with SMTP id r26-20020adfb1da000000b001f0120589c1mr8435042wra.27.1647033307576; Fri, 11 Mar 2022 13:15:07 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id v8-20020a1cf708000000b0034d7b5f2da0sm8057872wmh.33.2022.03.11.13.15.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 13:15:07 -0800 (PST) Message-Id: <578c3682e2fb35af86087e6a0c277aa8766919d7.1647033303.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Fri, 11 Mar 2022 21:14:51 +0000 Subject: [PATCH 04/16] t/helper/fsmonitor-client: cleanup call to parse_options() Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Jeff Hostetler , Jeff Hostetler Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Jeff Hostetler From: Jeff Hostetler fixup! t/helper/fsmonitor-client: create IPC client to talk to \ FSMonitor Daemon Elminate unnecessary code in cmd__fsmonitor_client() WRT parsing of options. Fix name of test-tool in usage. Don't localize die() message. Signed-off-by: Jeff Hostetler --- t/helper/test-fsmonitor-client.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/t/helper/test-fsmonitor-client.c b/t/helper/test-fsmonitor-client.c index f7a5b3a32fa..d59a640f1f9 100644 --- a/t/helper/test-fsmonitor-client.c +++ b/t/helper/test-fsmonitor-client.c @@ -49,7 +49,7 @@ static int do_send_query(const char *token) ret = fsmonitor_ipc__send_query(token, &answer); if (ret < 0) - die(_("could not query fsmonitor--daemon")); + die("could not query fsmonitor--daemon"); write_in_full(1, answer.buf, answer.len); strbuf_release(&answer); @@ -85,8 +85,8 @@ int cmd__fsmonitor_client(int argc, const char **argv) const char *token = NULL; const char * const fsmonitor_client_usage[] = { - N_("test-helper fsmonitor-client query []"), - N_("test-helper fsmonitor-client flush"), + N_("test-tool fsmonitor-client query []"), + N_("test-tool fsmonitor-client flush"), NULL, }; @@ -96,17 +96,12 @@ int cmd__fsmonitor_client(int argc, const char **argv) OPT_END() }; - if (argc < 2) - usage_with_options(fsmonitor_client_usage, options); + argc = parse_options(argc, argv, NULL, options, fsmonitor_client_usage, 0); - if (argc == 2 && !strcmp(argv[1], "-h")) + if (argc != 1) usage_with_options(fsmonitor_client_usage, options); - subcmd = argv[1]; - argv--; - argc++; - - argc = parse_options(argc, argv, NULL, options, fsmonitor_client_usage, 0); + subcmd = argv[0]; setup_git_directory(); From patchwork Fri Mar 11 21:14:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Hostetler X-Patchwork-Id: 12778598 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 97A4CC433EF for ; Fri, 11 Mar 2022 22:43:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229631AbiCKWoG (ORCPT ); Fri, 11 Mar 2022 17:44:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49376 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229519AbiCKWn6 (ORCPT ); Fri, 11 Mar 2022 17:43:58 -0500 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F5512405A5 for ; Fri, 11 Mar 2022 14:19:28 -0800 (PST) Received: by mail-wm1-x32d.google.com with SMTP id 19so5894994wmy.3 for ; Fri, 11 Mar 2022 14:19:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=+euCH8Zxv4U7O04h65hJ5UKgd0xdIRUROQj9frPMn/U=; b=AkNkGjB8insPp1VtyYFFOIrv2g7Mo0ZNsTsfoFUeJraRk4nYBqm+K5fEUyNjiPdZrk hrKdWwfbSRyyEJYddQYLgLendwBNwez8hC3C7ZNgbt3AyKhpgR9WrnFQ9SnHr21s8bT+ v+IYhh/lfL6q7iUENFeVJwoOPP0fjoPYQ3ZavoMEQLNerS2KajWEpsggVNOIx4irfwwn qgY7uw54gAfgNUxTmIFlvh26umA0+IW61AtgNIBdT/fvdWCiaQrcz5kDzvlTDUyMH/eD HGIpKlSfAni7OsUVWAZe5OcftdNKpwCoQhbIMke7dAe7YJlblRQcwJf6QNZmwc3xmlN4 RcEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=+euCH8Zxv4U7O04h65hJ5UKgd0xdIRUROQj9frPMn/U=; b=zgeTozB/01pgup6rhoX2EPuTM0zJHW7v28pn3s5fBHyALQdApB5xR0agTtydnHl8VB 23n/Mp6of4QMtQ92l4Qqq1IW3Zv3Mljm97b+Yjjl2KNhRGENn+OnCA9IhyWRlteklhqk T82Vxoxcf72SrvgU2oQcbgGOFS30km/eYFAJcVX4gF61hosG1XM3deJ9l7c7XIU3pvJB KNzae8c+bj10gAQJrogrD1OvE2F6f4rsdGEU70wMCYfkgqGtp3RJvnGEg82h5HebA9mh UzRyfLskQNuglHnZk/nnM7uybg5MVLGZ3+1Ze7jdSuyeY0J/90z3ilO6M23Spe5uwTFo tMZw== X-Gm-Message-State: AOAM533YGIrVc1nTxzb5u4hi0eY+K8mGpCo8eWpzOwpqozbCTQUIgTIt hS2e0Ab6FSNjqrwlJb6Xt52/XgNHVw4= X-Google-Smtp-Source: ABdhPJz7aqU/eydwGhaeZnc+pX0Jl+Eow+dQkqnzi3Gq+K1vssuLM8krk5iv/Pxh3kByU9Ay2CKWfQ== X-Received: by 2002:a1c:f718:0:b0:380:ed20:6557 with SMTP id v24-20020a1cf718000000b00380ed206557mr17599701wmh.53.1647033308329; Fri, 11 Mar 2022 13:15:08 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id m189-20020a1c26c6000000b00389f8158b76sm923666wmm.48.2022.03.11.13.15.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 13:15:08 -0800 (PST) Message-Id: <84df95be620c76afed73d1679722459e2ff32018.1647033303.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Fri, 11 Mar 2022 21:14:52 +0000 Subject: [PATCH 05/16] fsmonitor--daemon: refactor cookie handling for readability Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Jeff Hostetler , Jeff Hostetler Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Jeff Hostetler From: Jeff Hostetler fixup! fsmonitor--daemon: use a cookie file to sync with file system Use implicit definitions for FCIR_ enum values. Remove const from cookie->name. Reverse if then and else branches around open() to ease readability. Document that we don't care about errors from close() and unlink(). Signed-off-by: Jeff Hostetler --- builtin/fsmonitor--daemon.c | 53 +++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 23 deletions(-) diff --git a/builtin/fsmonitor--daemon.c b/builtin/fsmonitor--daemon.c index 97ca2a356e5..02a99ce98a2 100644 --- a/builtin/fsmonitor--daemon.c +++ b/builtin/fsmonitor--daemon.c @@ -109,14 +109,14 @@ static int do_as_client__status(void) enum fsmonitor_cookie_item_result { FCIR_ERROR = -1, /* could not create cookie file ? */ - FCIR_INIT = 0, + FCIR_INIT, FCIR_SEEN, FCIR_ABORT, }; struct fsmonitor_cookie_item { struct hashmap_entry entry; - const char *name; + char *name; enum fsmonitor_cookie_item_result result; }; @@ -166,37 +166,44 @@ static enum fsmonitor_cookie_item_result with_lock__wait_for_cookie( * that the listener thread has seen it. */ fd = open(cookie_pathname.buf, O_WRONLY | O_CREAT | O_EXCL, 0600); - if (fd >= 0) { - close(fd); - unlink(cookie_pathname.buf); - - /* - * Technically, this is an infinite wait (well, unless another - * thread sends us an abort). I'd like to change this to - * use `pthread_cond_timedwait()` and return an error/timeout - * and let the caller do the trivial response thing, but we - * don't have that routine in our thread-utils. - * - * After extensive beta testing I'm not really worried about - * this. Also note that the above open() and unlink() calls - * will cause at least two FS events on that path, so the odds - * of getting stuck are pretty slim. - */ - while (cookie->result == FCIR_INIT) - pthread_cond_wait(&state->cookies_cond, - &state->main_lock); - } else { + if (fd < 0) { error_errno(_("could not create fsmonitor cookie '%s'"), cookie->name); cookie->result = FCIR_ERROR; + goto done; } + /* + * Technically, close() and unlink() can fail, but we don't + * care here. We only created the file to trigger a watch + * event from the FS to know that when we're up to date. + */ + close(fd); + unlink(cookie_pathname.buf); + + /* + * Technically, this is an infinite wait (well, unless another + * thread sends us an abort). I'd like to change this to + * use `pthread_cond_timedwait()` and return an error/timeout + * and let the caller do the trivial response thing, but we + * don't have that routine in our thread-utils. + * + * After extensive beta testing I'm not really worried about + * this. Also note that the above open() and unlink() calls + * will cause at least two FS events on that path, so the odds + * of getting stuck are pretty slim. + */ + while (cookie->result == FCIR_INIT) + pthread_cond_wait(&state->cookies_cond, + &state->main_lock); + +done: hashmap_remove(&state->cookies, &cookie->entry, NULL); result = cookie->result; - free((char*)cookie->name); + free(cookie->name); free(cookie); strbuf_release(&cookie_pathname); From patchwork Fri Mar 11 21:14:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Hostetler X-Patchwork-Id: 12778632 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 945CAC433EF for ; Fri, 11 Mar 2022 22:51:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229902AbiCKWwr (ORCPT ); Fri, 11 Mar 2022 17:52:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229990AbiCKWwe (ORCPT ); Fri, 11 Mar 2022 17:52:34 -0500 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D63221FA1C9 for ; Fri, 11 Mar 2022 14:30:26 -0800 (PST) Received: by mail-lf1-x12c.google.com with SMTP id b28so5795220lfc.4 for ; Fri, 11 Mar 2022 14:30:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=N02KhVTYvRVKrWbf2GT8sT3dLTGR6Av8r8Cts0hfabY=; b=ZHCGSvlSLC1FBqgl5FNIxpEPJvnlG5x3PXRtevgxJoQzvXG6VUlC4GyFJz8uesw9F9 uKmrIRNuDoXQVB0JJPKpVt81k2e1EFSpLfXm8yphhJ6Kr67g8QZ/+XwHlahrV2S7yKaN paTFpiiJ/rygujaYtwZSSbOG3YxAyCNPlxvTb2hfW8yUkOesG5b/I4cFd9bxU8iPJ5n/ ITFopP4OOeXTvBkxidC+mGd4K2C+BWmNawvg4P4CwN9BeGiJtHiB1MyJzRI4UHLxL4Gz ijRz1A0fNzbkGj5ZPBG/EcHaG/PHxj7aIqcgX8AgJP7EEkqfi6lywQOf95FJdC3BRMJF 7G8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=N02KhVTYvRVKrWbf2GT8sT3dLTGR6Av8r8Cts0hfabY=; b=hOaYzsf0Tpq6OF2WEH85Ktp0SvFQ0sODTqMKWCqn4UuPwn2V9wf6tSPDCAjROSFgUr b83D9UaO9B+D74T+SAvYzqchyzUC00OUlSPEO0/KIFiEqNSMvwWidGbLdhnuvfKJysKp ou+Z9ir2tYD6n+zohvVEmKsr6F1kM3PWeXzoRfaHqwEtDgS+4oeg7k62GSoR9Ywboqdy Xn1ebmhhCs/X4YKFcH1caywjx2xjSPaIPN/PyNFVPPluXwllzi/wEpOfyUShEQYa28Rv P2MePObsmhfcqlgupz4GthuzutMwoluEgcx6BEumgD4pKd2iWtPNUbDJOSb4l6Q43o71 0rog== X-Gm-Message-State: AOAM530FYmMfc1h+gECBGGsw84OsmpimsUx5xX+bzjKv6FkFj5YO6jLY IsfRAgIPOD8g8QpUdNpU+FRbERRXGjQ= X-Google-Smtp-Source: ABdhPJyEv8DNQZDWobDvOuR7OZGUBy0CNFCzyBpQPWQ2NzVJD5bi1Jq2RvJPgisMKZIfvh/r04bVgQ== X-Received: by 2002:adf:d1a8:0:b0:1f0:59c5:5e18 with SMTP id w8-20020adfd1a8000000b001f059c55e18mr8698658wrc.585.1647033309114; Fri, 11 Mar 2022 13:15:09 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id n20-20020a05600c501400b0038995ede299sm7568279wmr.17.2022.03.11.13.15.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 13:15:08 -0800 (PST) Message-Id: In-Reply-To: References: Date: Fri, 11 Mar 2022 21:14:53 +0000 Subject: [PATCH 06/16] t/perf/p7519: use grep rather than egrep in test Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Jeff Hostetler , Jeff Hostetler Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Jeff Hostetler From: Jeff Hostetler fixup! t/perf/p7519: speed up test on Windows Use grep rather than egrep Signed-off-by: Jeff Hostetler --- t/perf/p7519-fsmonitor.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/perf/p7519-fsmonitor.sh b/t/perf/p7519-fsmonitor.sh index a1c552129cc..5f97edf6a11 100755 --- a/t/perf/p7519-fsmonitor.sh +++ b/t/perf/p7519-fsmonitor.sh @@ -218,7 +218,7 @@ test_fsmonitor_suite () { git ls-files | \ head -100000 | \ grep -v \" | \ - egrep -v " ." | \ + grep -v " ." | \ xargs test-tool chmtime -300 && git status ' From patchwork Fri Mar 11 21:14:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Hostetler X-Patchwork-Id: 12778633 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A88FFC433EF for ; Fri, 11 Mar 2022 22:52:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230071AbiCKWxl (ORCPT ); Fri, 11 Mar 2022 17:53:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231178AbiCKWx3 (ORCPT ); Fri, 11 Mar 2022 17:53:29 -0500 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD7272E3F2F for ; Fri, 11 Mar 2022 14:29:24 -0800 (PST) Received: by mail-ej1-x636.google.com with SMTP id d10so21943779eje.10 for ; Fri, 11 Mar 2022 14:29:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=dkGBAIS2EimFjxXEvG/szjFqlEyS6PQw6zXKMdIxz1c=; b=lWYQuu/6phhjDi0VosrhjDc4juAXJoQytMa9Jyg3r+VWqSCHk4mCna5m8oztkXH4+F q8vAlL0NZAHCbBa5yyF2XDHr1reG6u0yEqX8Sh42F8zDURVtKv2IAOy3lG4Qw8zp3GWd xnJyXXDHBUZCvCgyqgLHEryC1uUxyh844y7xMVm1Sh+AuDOACp1TKTifc1koshTyCSfO iu9/yQ6a0QK0sTw3nsb+O8+fbyHK3I8UXa1D6U9ZdJsBa5Sd+oSxgzuSErB7uRcqIh/Y ndpkjnj0wcxIBxQSWZieeDZysbdq4PuH0VODYuy3/1NBp9IiAzbEL2oONPiMEZCwtTkK FUZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=dkGBAIS2EimFjxXEvG/szjFqlEyS6PQw6zXKMdIxz1c=; b=6s1DLl/HS1jgOZ0GBsNQiSoC8Q4pavIS9UluSMtjryOzNe7UqjFQnMlRtA+DVV2smI M0UhJ9fZ3D5PmJWjGNRAj4mDxdOric8LL49KkBWN14sVicu8byt5ccPLjH4e+dAz/n0b 1HKdZkSFeb/Jzh28ZP77bKhiIH4lflg6TnbUTWV/X6PuPtqK4dt3BghT9XNnYIg6M0qe pSbY3s2o1eZs5lJSVp+iNjG9UrykJQHQtM2aqKmCN5423hO2oVCkYO19g6IhJX63AtSm I67Tl8Mn/jcbaM3IILoU0lxgxeo8KQXU0Qv7OQXVfv24hqWzUg72Menh8m/UrOKAjgxW qruA== X-Gm-Message-State: AOAM530b2/Oi/xcGZIp/90ue8gqd/Vs86v5AMXKKpSWN+K2OcqS/NJSD 6veL+BxgzeyQBYFd8Nva/mWFmfJr77U= X-Google-Smtp-Source: ABdhPJwmNwcYBJd7MVO1q185eG2rZWk02pcAmZdyNzkbY4jzcl+1oVkH4pOzNnhcOOZ9BEHyV91oMg== X-Received: by 2002:a05:6000:12cf:b0:1f0:6875:9577 with SMTP id l15-20020a05600012cf00b001f068759577mr8400562wrx.304.1647033309908; Fri, 11 Mar 2022 13:15:09 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id f22-20020a1cc916000000b00380d3e49e89sm7851476wmb.22.2022.03.11.13.15.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 13:15:09 -0800 (PST) Message-Id: <3482fb79a517d4703b5aa888a8c3d4890d034cf7.1647033303.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Fri, 11 Mar 2022 21:14:54 +0000 Subject: [PATCH 07/16] t/perf/p7519: cleanup coding style Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Jeff Hostetler , Jeff Hostetler Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Jeff Hostetler From: Jeff Hostetler fixup! t/perf/p7519: add fsmonitor--daemon test cases Add "_hook" to name of shell function to set up for Watchman/hook test runs. Fix code style of added "if then". Add body of builtin test to a test_expect_success. Signed-off-by: Jeff Hostetler --- t/perf/p7519-fsmonitor.sh | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/t/perf/p7519-fsmonitor.sh b/t/perf/p7519-fsmonitor.sh index 5f97edf6a11..7a7981b0e61 100755 --- a/t/perf/p7519-fsmonitor.sh +++ b/t/perf/p7519-fsmonitor.sh @@ -141,7 +141,7 @@ test_expect_success "one time repo setup" ' fi ' -setup_for_fsmonitor () { +setup_for_fsmonitor_hook () { # set INTEGRATION_SCRIPT depending on the environment if test -n "$INTEGRATION_PATH" then @@ -182,8 +182,7 @@ test_perf_w_drop_caches () { } test_fsmonitor_suite () { - if test -n "$USE_FSMONITOR_DAEMON" - then + if test -n "$USE_FSMONITOR_DAEMON"; then DESC="builtin fsmonitor--daemon" elif test -n "$INTEGRATION_SCRIPT"; then DESC="fsmonitor=$(basename $INTEGRATION_SCRIPT)" @@ -264,11 +263,11 @@ test_fsmonitor_suite () { trace_start fsmonitor-watchman if test -n "$GIT_PERF_7519_FSMONITOR"; then for INTEGRATION_PATH in $GIT_PERF_7519_FSMONITOR; do - test_expect_success "setup for fsmonitor $INTEGRATION_PATH" 'setup_for_fsmonitor' + test_expect_success "setup for fsmonitor $INTEGRATION_PATH" 'setup_for_fsmonitor_hook' test_fsmonitor_suite done else - test_expect_success "setup for fsmonitor" 'setup_for_fsmonitor' + test_expect_success "setup for fsmonitor hook" 'setup_for_fsmonitor_hook' test_fsmonitor_suite fi @@ -306,13 +305,15 @@ if test_have_prereq FSMONITOR_DAEMON then USE_FSMONITOR_DAEMON=t - trace_start fsmonitor--daemon--server - git fsmonitor--daemon start + test_expect_success "setup for builtin fsmonitor" ' + trace_start fsmonitor--daemon--server && + git fsmonitor--daemon start && - trace_start fsmonitor--daemon--client + trace_start fsmonitor--daemon--client && - git config core.fsmonitor true - git update-index --fsmonitor + git config core.fsmonitor true && + git update-index --fsmonitor + ' test_fsmonitor_suite From patchwork Fri Mar 11 21:14:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Hostetler X-Patchwork-Id: 12778647 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 36833C433F5 for ; Fri, 11 Mar 2022 22:59:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230129AbiCKXA1 (ORCPT ); Fri, 11 Mar 2022 18:00:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230092AbiCKXAU (ORCPT ); Fri, 11 Mar 2022 18:00:20 -0500 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A90A1FAA08 for ; Fri, 11 Mar 2022 14:52:19 -0800 (PST) Received: by mail-wr1-x432.google.com with SMTP id x15so14976830wru.13 for ; Fri, 11 Mar 2022 14:52:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=Q8Cbr65tyIqZnEn7mI0m5BmWYi3q7zcXoZuLaTUXEt0=; b=UA7xRepdO0rcwEdths9zdQ+Z5Wd3jQ5TgGCiLiZf2zQwhGsgN7eIQegSq+jAve8Pd2 aGPlKM/nuIdUFj5Ku00qhg9RfP+mIMSxifrQs58tbq9PBdSu6UHDk2iIl07gItvZN7N6 oBx9hVQrx4mTZNKtvKeSAgT+UYnYM2xQtaOgRZ/1fNG8XIWu4ii1tEW/fE+HMRU0nf8Q 12Et0K1F3yFJX+hyVUUn91BJgnYExX/yMgEzZRphLovhiT4j9EbQn6quvTcLNq1eQ3KU hlmEKsZIIxhS5OBm3978f/TjpGjqJdGjdi1esN6l7BRbvVsoVkay5AaBs76tSWF7eztn Z26g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=Q8Cbr65tyIqZnEn7mI0m5BmWYi3q7zcXoZuLaTUXEt0=; b=zQktZYsu3Kmh9voYbwS5SpRmFQdqnbaLpgEOSdbcKesPEekGH4X2krX6ZarU3FK5Tn VWfOEGwp/yVGR7k1V2y/FLrday2g9VjyjkQsK3cuFPMPcwiZ42oi3dwKXIFYKb+Fy70S jqUSwMNXv3g0PVsyZZKhqtmySvHdAEu+RzxTWbz6qeATo3mcXHAzCCE2VYgC7UtQNB3I 05uOayKLDWCm9ZUHSthWto9Ax6FEdZaw/j/3zyoHsyCeV6raXqWx3izXXN2Yl4i4+8Yx KIN8cIIqHwFjcJwxfGgeDbVv4YGuOlt2lWh4mV+rMmzrkytSKZNAtQ0w+DbChX0fZ9V+ k7gg== X-Gm-Message-State: AOAM531k+CZeQsUXijhmQX63RBttfBGgoks89rUVa3HxJkGesAs5orcL mLOS5oPg5dFYXHpEWstuihiGFHtkySw= X-Google-Smtp-Source: ABdhPJw+zOFCJA8c2gVS2akn1qqYLrtz1/lYCe4r/tYB0mh6dsNTkQCQaOpuaEGUrD1rw1TGegnjfQ== X-Received: by 2002:a5d:5104:0:b0:203:855d:c41c with SMTP id s4-20020a5d5104000000b00203855dc41cmr7852686wrt.128.1647033310679; Fri, 11 Mar 2022 13:15:10 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id p26-20020a7bcc9a000000b00389f80668cesm962368wma.28.2022.03.11.13.15.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 13:15:10 -0800 (PST) Message-Id: <6693900600f5b27525dfe7de78e73900306e0ab5.1647033303.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Fri, 11 Mar 2022 21:14:55 +0000 Subject: [PATCH 08/16] t7527: add parameters to start_daemon to handle args and subshell Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Jeff Hostetler , Jeff Hostetler Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Jeff Hostetler From: Jeff Hostetler fixup! t7527: create test for fsmonitor--daemon Add parameters to start_daemon() and handle subshell and logging args. Remove /dev/null from commands. Fix &&-chaining of functions. Signed-off-by: Jeff Hostetler --- t/t7527-builtin-fsmonitor.sh | 217 ++++++++++++++++++----------------- 1 file changed, 111 insertions(+), 106 deletions(-) diff --git a/t/t7527-builtin-fsmonitor.sh b/t/t7527-builtin-fsmonitor.sh index 0ccbfb9616f..026382a0d86 100755 --- a/t/t7527-builtin-fsmonitor.sh +++ b/t/t7527-builtin-fsmonitor.sh @@ -11,30 +11,85 @@ then fi stop_daemon_delete_repo () { - r=$1 - git -C $r fsmonitor--daemon stop >/dev/null 2>/dev/null + r=$1 && + test_might_fail git -C $r fsmonitor--daemon stop && rm -rf $1 - return 0 } start_daemon () { - case "$#" in - 1) r="-C $1";; - *) r=""; - esac + r="" && + tf="" && + t2="" && + tk="" && - git $r fsmonitor--daemon start || return $? - git $r fsmonitor--daemon status || return $? + while test "$#" -ne 0 + do + case "$1" in + -C) + shift; + test "$#" -ne 0 || + { echo >&2 "error: -C requires arg"; exit 1; } + r="-C $1" + shift + ;; + -tf) + shift; + test "$#" -ne 0 || + { echo >&2 "error: -tf requires arg"; exit 1; } + tf="$1" + shift + ;; + -t2) + shift; + test "$#" -ne 0 || + { echo >&2 "error: -t2 requires arg"; exit 1; } + t2="$1" + shift + ;; + -tk) + shift; + test "$#" -ne 0 || + { echo >&2 "error: -tk requires arg"; exit 1; } + tk="$1" + shift + ;; + *) + echo >&2 "error: unknown option: '$1'" + exit 1 + ;; + esac + done && + + ( + if test ! -z "$tf" + then + GIT_TRACE_FSMONITOR="$tf" + export GIT_TRACE_FSMONITOR + fi && + + if test ! -z "$t2" + then + GIT_TRACE2_PERF="$t2" + export GIT_TRACE2_PERF + fi && + + if test ! -z "$tk" + then + GIT_TEST_FSMONITOR_TOKEN="$tk" + export GIT_TEST_FSMONITOR_TOKEN + fi && - return 0 + git $r fsmonitor--daemon start && + git $r fsmonitor--daemon status + ) } # Is a Trace2 data event present with the given catetory and key? # We do not care what the value is. # have_t2_data_event () { - c=$1 - k=$2 + c=$1 && + k=$2 && grep -e '"event":"data".*"category":"'"$c"'".*"key":"'"$k"'"' } @@ -43,7 +98,7 @@ test_expect_success 'explicit daemon start and stop' ' test_when_finished "stop_daemon_delete_repo test_explicit" && git init test_explicit && - start_daemon test_explicit && + start_daemon -C test_explicit && git -C test_explicit fsmonitor--daemon stop && test_must_fail git -C test_explicit fsmonitor--daemon status @@ -63,7 +118,7 @@ test_expect_success 'implicit daemon start' ' # but this test case is only concerned with whether the daemon was # implicitly started.) - GIT_TRACE2_EVENT="$(pwd)/.git/trace" \ + GIT_TRACE2_EVENT="$PWD/.git/trace" \ test-tool -C test_implicit fsmonitor-client query --token 0 >actual && nul_to_q actual.filtered && grep "builtin:" actual.filtered && @@ -86,7 +141,7 @@ test_expect_success 'implicit daemon stop (delete .git)' ' git init test_implicit_1 && - start_daemon test_implicit_1 && + start_daemon -C test_implicit_1 && # deleting the .git directory will implicitly stop the daemon. rm -rf test_implicit_1/.git && @@ -110,7 +165,7 @@ test_expect_success 'implicit daemon stop (rename .git)' ' git init test_implicit_2 && - start_daemon test_implicit_2 && + start_daemon -C test_implicit_2 && # renaming the .git directory will implicitly stop the daemon. mv test_implicit_2/.git test_implicit_2/.xxx && @@ -128,7 +183,7 @@ test_expect_success 'cannot start multiple daemons' ' git init test_multiple && - start_daemon test_multiple && + start_daemon -C test_multiple && test_must_fail git -C test_multiple fsmonitor--daemon start 2>actual && grep "fsmonitor--daemon is already running" actual && @@ -177,8 +232,7 @@ test_expect_success 'setup' ' # This is here in case something else fails first. # redundant_stop_daemon () { - git fsmonitor--daemon stop - return 0 + test_might_fail git fsmonitor--daemon stop } test_expect_success 'update-index implicitly starts daemon' ' @@ -186,7 +240,7 @@ test_expect_success 'update-index implicitly starts daemon' ' test_must_fail git fsmonitor--daemon status && - GIT_TRACE2_EVENT="$(pwd)/.git/trace_implicit_1" \ + GIT_TRACE2_EVENT="$PWD/.git/trace_implicit_1" \ git update-index --fsmonitor && git fsmonitor--daemon status && @@ -202,7 +256,7 @@ test_expect_success 'status implicitly starts daemon' ' test_must_fail git fsmonitor--daemon status && - GIT_TRACE2_EVENT="$(pwd)/.git/trace_implicit_2" \ + GIT_TRACE2_EVENT="$PWD/.git/trace_implicit_2" \ git status >actual && git fsmonitor--daemon status && @@ -214,38 +268,38 @@ test_expect_success 'status implicitly starts daemon' ' ' edit_files () { - echo 1 >modified - echo 2 >dir1/modified - echo 3 >dir2/modified + echo 1 >modified && + echo 2 >dir1/modified && + echo 3 >dir2/modified && >dir1/untracked } delete_files () { - rm -f delete - rm -f dir1/delete + rm -f delete && + rm -f dir1/delete && rm -f dir2/delete } create_files () { - echo 1 >new - echo 2 >dir1/new + echo 1 >new && + echo 2 >dir1/new && echo 3 >dir2/new } rename_files () { - mv rename renamed - mv dir1/rename dir1/renamed + mv rename renamed && + mv dir1/rename dir1/renamed && mv dir2/rename dir2/renamed } file_to_directory () { - rm -f delete - mkdir delete + rm -f delete && + mkdir delete && echo 1 >delete/new } directory_to_file () { - rm -rf dir1 + rm -rf dir1 && echo 1 >dir1 } @@ -272,25 +326,20 @@ verify_status () { # daemon) because these commands might implicitly restart the daemon. clean_up_repo_and_stop_daemon () { - git reset --hard HEAD - git clean -fd - git fsmonitor--daemon stop + git reset --hard HEAD && + git clean -fd && + test_might_fail git fsmonitor--daemon stop && rm -f .git/trace } test_expect_success 'edit some files' ' test_when_finished clean_up_repo_and_stop_daemon && - ( - GIT_TRACE_FSMONITOR="$(pwd)/.git/trace" && - export GIT_TRACE_FSMONITOR && - - start_daemon - ) && + start_daemon -tf "$PWD/.git/trace" && edit_files && - test-tool fsmonitor-client query --token 0 >/dev/null 2>&1 && + test-tool fsmonitor-client query --token 0 && grep "^event: dir1/modified$" .git/trace && grep "^event: dir2/modified$" .git/trace && @@ -301,16 +350,11 @@ test_expect_success 'edit some files' ' test_expect_success 'create some files' ' test_when_finished clean_up_repo_and_stop_daemon && - ( - GIT_TRACE_FSMONITOR="$(pwd)/.git/trace" && - export GIT_TRACE_FSMONITOR && - - start_daemon - ) && + start_daemon -tf "$PWD/.git/trace" && create_files && - test-tool fsmonitor-client query --token 0 >/dev/null 2>&1 && + test-tool fsmonitor-client query --token 0 && grep "^event: dir1/new$" .git/trace && grep "^event: dir2/new$" .git/trace && @@ -320,16 +364,11 @@ test_expect_success 'create some files' ' test_expect_success 'delete some files' ' test_when_finished clean_up_repo_and_stop_daemon && - ( - GIT_TRACE_FSMONITOR="$(pwd)/.git/trace" && - export GIT_TRACE_FSMONITOR && - - start_daemon - ) && + start_daemon -tf "$PWD/.git/trace" && delete_files && - test-tool fsmonitor-client query --token 0 >/dev/null 2>&1 && + test-tool fsmonitor-client query --token 0 && grep "^event: dir1/delete$" .git/trace && grep "^event: dir2/delete$" .git/trace && @@ -339,16 +378,11 @@ test_expect_success 'delete some files' ' test_expect_success 'rename some files' ' test_when_finished clean_up_repo_and_stop_daemon && - ( - GIT_TRACE_FSMONITOR="$(pwd)/.git/trace" && - export GIT_TRACE_FSMONITOR && - - start_daemon - ) && + start_daemon -tf "$PWD/.git/trace" && rename_files && - test-tool fsmonitor-client query --token 0 >/dev/null 2>&1 && + test-tool fsmonitor-client query --token 0 && grep "^event: dir1/rename$" .git/trace && grep "^event: dir2/rename$" .git/trace && @@ -361,16 +395,11 @@ test_expect_success 'rename some files' ' test_expect_success 'rename directory' ' test_when_finished clean_up_repo_and_stop_daemon && - ( - GIT_TRACE_FSMONITOR="$(pwd)/.git/trace" && - export GIT_TRACE_FSMONITOR && - - start_daemon - ) && + start_daemon -tf "$PWD/.git/trace" && mv dirtorename dirrenamed && - test-tool fsmonitor-client query --token 0 >/dev/null 2>&1 && + test-tool fsmonitor-client query --token 0 && grep "^event: dirtorename/*$" .git/trace && grep "^event: dirrenamed/*$" .git/trace @@ -379,16 +408,11 @@ test_expect_success 'rename directory' ' test_expect_success 'file changes to directory' ' test_when_finished clean_up_repo_and_stop_daemon && - ( - GIT_TRACE_FSMONITOR="$(pwd)/.git/trace" && - export GIT_TRACE_FSMONITOR && - - start_daemon - ) && + start_daemon -tf "$PWD/.git/trace" && file_to_directory && - test-tool fsmonitor-client query --token 0 >/dev/null 2>&1 && + test-tool fsmonitor-client query --token 0 && grep "^event: delete$" .git/trace && grep "^event: delete/new$" .git/trace @@ -397,16 +421,11 @@ test_expect_success 'file changes to directory' ' test_expect_success 'directory changes to a file' ' test_when_finished clean_up_repo_and_stop_daemon && - ( - GIT_TRACE_FSMONITOR="$(pwd)/.git/trace" && - export GIT_TRACE_FSMONITOR && - - start_daemon - ) && + start_daemon -tf "$PWD/.git/trace" && directory_to_file && - test-tool fsmonitor-client query --token 0 >/dev/null 2>&1 && + test-tool fsmonitor-client query --token 0 && grep "^event: dir1$" .git/trace ' @@ -424,15 +443,7 @@ test_expect_success 'flush cached data' ' git init test_flush && - ( - GIT_TEST_FSMONITOR_TOKEN=true && - export GIT_TEST_FSMONITOR_TOKEN && - - GIT_TRACE_FSMONITOR="$(pwd)/.git/trace_daemon" && - export GIT_TRACE_FSMONITOR && - - start_daemon test_flush - ) && + start_daemon -C test_flush -tf "$PWD/.git/trace_daemon" -tk true && # The daemon should have an initial token with no events in _0 and # then a few (probably platform-specific number of) events in _1. @@ -441,8 +452,8 @@ test_expect_success 'flush cached data' ' test-tool -C test_flush fsmonitor-client query --token "builtin:test_00000001:0" >actual_0 && nul_to_q actual_q0 && - touch test_flush/file_1 && - touch test_flush/file_2 && + > test_flush/file_1 && + > test_flush/file_2 && test-tool -C test_flush fsmonitor-client query --token "builtin:test_00000001:0" >actual_1 && nul_to_q actual_q1 && @@ -462,7 +473,7 @@ test_expect_success 'flush cached data' ' grep "^builtin:test_00000002:0Q$" actual_q2 && - touch test_flush/file_3 && + > test_flush/file_3 && test-tool -C test_flush fsmonitor-client query --token "builtin:test_00000002:0" >actual_3 && nul_to_q actual_q3 && @@ -485,15 +496,9 @@ test_expect_success 'setup worktree base' ' test_expect_success 'worktree with .git file' ' git -C wt-base worktree add ../wt-secondary && - ( - GIT_TRACE2_PERF="$(pwd)/trace2_wt_secondary" && - export GIT_TRACE2_PERF && - - GIT_TRACE_FSMONITOR="$(pwd)/trace_wt_secondary" && - export GIT_TRACE_FSMONITOR && - - start_daemon wt-secondary - ) && + start_daemon -C wt-secondary \ + -tf "$PWD/trace_wt_secondary" \ + -t2 "$PWD/trace2_wt_secondary" && git -C wt-secondary fsmonitor--daemon stop && test_must_fail git -C wt-secondary fsmonitor--daemon status From patchwork Fri Mar 11 21:14:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Hostetler X-Patchwork-Id: 12778635 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 85BB4C433F5 for ; Fri, 11 Mar 2022 22:53:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229812AbiCKWyp (ORCPT ); Fri, 11 Mar 2022 17:54:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229992AbiCKWyc (ORCPT ); Fri, 11 Mar 2022 17:54:32 -0500 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4391B45A1 for ; Fri, 11 Mar 2022 14:28:07 -0800 (PST) Received: by mail-wm1-x334.google.com with SMTP id k29-20020a05600c1c9d00b003817fdc0f00so6132317wms.4 for ; Fri, 11 Mar 2022 14:28:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=+jHYzLlWfGJj3bXjxRpyUr6X/pm7zr0+zCujXJgOCoY=; b=JYavHcpWGC+Sv78K3CNAgZyqqoCjsYoMAU6Xp4DS9NpDefrn44fIHsjdJt53ZDTRjb rc7VYD7mglQgYe+uu8J3rpYhM7+RhtRodlruBnE9Ok4Wq31zrbI411G4EIuc1iwFqJ8h VTB+Cb7Te2MqlPwpW1MNFyDAytyz0TwuFQfk3NsIL6D+3T3aI3ZF/7f1iOJVH3FrvRph cOEP1DU1u+WmjL3T007wUUFJHpAWEApCtE1GKqvoR0cULKImIMFBVkpGwq5BL384bm8t /qnNj2Gx2v9mGY5MERPQ6CJkHVr6JDELp3SG/jpVo8w3q9RqKLKRA8lNkkzu+XKUjFq8 azvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=+jHYzLlWfGJj3bXjxRpyUr6X/pm7zr0+zCujXJgOCoY=; b=Dx9BFiz2fMcy7d7pJTo9enujL4D+EnsFCJzPfjkjsxsQfLNtMRVm6tREWQKfSGMAUA Wsf4pYBKxcku+jNkrYqLF8rgsydg5qIVeXhd4NwiZR+FH6U3PZiTWbt3SGzVewG54mPF FtmgykuFbClr6mr3yMo8EUDdx92wZEqh6rD72dKExzO/s1oH4xNQJPibAHIsDTKNXJP1 xS8wbmx50eOBdZbwga3lNC/EH/ykGkUWBXOHZqcqX/Z7F9vG+plL5p4WsO2MPRcJeOG/ dNRPXDUZv8K0Nm0iwRH7eWqsMCrbaPCM4cVXUboduIhdYyhQhXDZg0uSIQyRDwXV3fNy qmGQ== X-Gm-Message-State: AOAM533GJKYJvGbRLOX0cZsmIRwWnyA9xeFTHnATE4PSlqRqW9OpxkLG ZMJJDX5tYz7xlv2xKjCQ4loN4n8ihwI= X-Google-Smtp-Source: ABdhPJyMggJuBZbFlTTkkh67IoKfOIZ3OWiU57QKM94qHwx+MOvLL+CAYIpZi8CKE3JHAz412kvyHg== X-Received: by 2002:a7b:c11a:0:b0:389:a2be:2a5a with SMTP id w26-20020a7bc11a000000b00389a2be2a5amr8712208wmi.25.1647033311578; Fri, 11 Mar 2022 13:15:11 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id h13-20020adff18d000000b001f1de9f930esm11043092wro.81.2022.03.11.13.15.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 13:15:11 -0800 (PST) Message-Id: <903643c449821f24d80c999b50031945c79a0a7e.1647033303.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Fri, 11 Mar 2022 21:14:56 +0000 Subject: [PATCH 09/16] t7527: fix && chaining in matrix_try() Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Jeff Hostetler , Jeff Hostetler Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Jeff Hostetler From: Jeff Hostetler fixup! t7527: test status with untracked-cache and fsmonitor--daemon Signed-off-by: Jeff Hostetler --- t/t7527-builtin-fsmonitor.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/t/t7527-builtin-fsmonitor.sh b/t/t7527-builtin-fsmonitor.sh index 026382a0d86..f60e211dbab 100755 --- a/t/t7527-builtin-fsmonitor.sh +++ b/t/t7527-builtin-fsmonitor.sh @@ -536,9 +536,9 @@ matrix_clean_up_repo () { } matrix_try () { - uc=$1 - fsm=$2 - fn=$3 + uc=$1 && + fsm=$2 && + fn=$3 && test_expect_success "Matrix[uc:$uc][fsm:$fsm] $fn" ' matrix_clean_up_repo && From patchwork Fri Mar 11 21:14:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Hostetler X-Patchwork-Id: 12778614 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0E2A1C433FE for ; Fri, 11 Mar 2022 22:44:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229560AbiCKWpo (ORCPT ); Fri, 11 Mar 2022 17:45:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229616AbiCKWpg (ORCPT ); Fri, 11 Mar 2022 17:45:36 -0500 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A077F21132C for ; Fri, 11 Mar 2022 14:21:14 -0800 (PST) Received: by mail-wm1-x331.google.com with SMTP id m42-20020a05600c3b2a00b00382ab337e14so8332843wms.3 for ; Fri, 11 Mar 2022 14:21:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=hcNzkzFLgg+5Vio1hwhcoeX2wzTCyNge6Xc3i7j62zU=; b=WuaCIOzPPBzWdRZJ3S/hs7sPeCvCIIg/q5v7Bk5bn1tlLcI2r272yRyqlsyHTDN6Sf KxsHZ/3w1WRcGCbpubGpfgbIzEUeUsj3Ne5i5mw3iy7t7J9XeaE2OLWlV4uBI5SyUgNC BkNx/Jzk/sZ5ZPQj+nYYF6a8ft0uNCWibFBWdYCvklWkRh8cPI3MBmBIkuQQWi/erwdE FyQzKkJaGSmZZCXRi/Fz6Vt94qvsoCjhWqCXaFpGn8UasAQaI2pvr1jzH11fPvuA9c1e 7roujqtovQyxJlkITJMS3/PYSOmZWJcNP8oKsKtXBhFqmvJNM/3wZXWyY/eXvM+1zhf+ uKBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=hcNzkzFLgg+5Vio1hwhcoeX2wzTCyNge6Xc3i7j62zU=; b=4MQqMwVJ5o10Wh2f+QtBDONJ0+iZRLLqXRKzim8WtEzhzI54BfUR2b+mNLRPfWpJTM AoajFvFIVKTxcoXcyl8ikDmJzBblX+Y+pdpASN/qr7MqydxXctS+c2i/rFPUhLUx8TTl lQx7F5k8QzHuzqjoilNvTYvbayPYGKrtcWtuEL9i3uFDyDUGa9SgygWcBsPvx9EZhXe1 SEy5qn9vRjqK6G/alKJB/gZ5B8pKOHTbfSVi2ifs5eV/vbAMDYAMIIy54NDva+lPn/Gn 9NFioYwKnhF909fO+C5adqu2cQxG2+21D4iPyV77LQi5oSmx8yEsYmPzbwYCSV1sz53F yGjw== X-Gm-Message-State: AOAM533iyp2GcpSPkFvQjC8WpDQPaMAV0DD47ZITeA8aTtHgVVbZzbnZ /q+b15t44cc1lNw0cujrZWIlt9t5TRI= X-Google-Smtp-Source: ABdhPJypJQBTOTZRONj+ozXOHE9U9mnk+pgEHd708wp6Lv6ax4b/CvrAkUEwlnan3U40Say9TqqE4w== X-Received: by 2002:a05:600c:26c8:b0:389:a542:c20b with SMTP id 8-20020a05600c26c800b00389a542c20bmr16922457wmv.46.1647033312350; Fri, 11 Mar 2022 13:15:12 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id y10-20020a1c4b0a000000b00389ce2d65e8sm8816459wma.19.2022.03.11.13.15.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 13:15:12 -0800 (PST) Message-Id: <68bdb635c877be7b1493ba91940b0a78e342e773.1647033303.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Fri, 11 Mar 2022 21:14:57 +0000 Subject: [PATCH 10/16] t7527: delete unused verify_status() function Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Jeff Hostetler , Jeff Hostetler Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Jeff Hostetler From: Jeff Hostetler fixup! t7527: create test for fsmonitor--daemon Remove unused function verify_status(). Signed-off-by: Jeff Hostetler --- t/t7527-builtin-fsmonitor.sh | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/t/t7527-builtin-fsmonitor.sh b/t/t7527-builtin-fsmonitor.sh index f60e211dbab..ef8777e7f6d 100755 --- a/t/t7527-builtin-fsmonitor.sh +++ b/t/t7527-builtin-fsmonitor.sh @@ -303,16 +303,6 @@ directory_to_file () { echo 1 >dir1 } -verify_status () { - git status >actual && - GIT_INDEX_FILE=.git/fresh-index git read-tree master && - GIT_INDEX_FILE=.git/fresh-index git -c core.fsmonitor=false status >expect && - test_cmp expect actual && - echo HELLO AFTER && - cat .git/trace && - echo HELLO AFTER -} - # The next few test cases confirm that our fsmonitor daemon sees each type # of OS filesystem notification that we care about. At this layer we just # ensure we are getting the OS notifications and do not try to confirm what From patchwork Fri Mar 11 21:14:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Hostetler X-Patchwork-Id: 12778615 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF7D9C433F5 for ; Fri, 11 Mar 2022 22:46:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229776AbiCKWrg (ORCPT ); Fri, 11 Mar 2022 17:47:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229665AbiCKWrY (ORCPT ); Fri, 11 Mar 2022 17:47:24 -0500 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1388293F29 for ; Fri, 11 Mar 2022 14:22:18 -0800 (PST) Received: by mail-wm1-x334.google.com with SMTP id 19so5898237wmy.3 for ; Fri, 11 Mar 2022 14:22:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=E24EvvwnkSyOCEJmsHGJhLe1DkHNnlgm4bHeLK+leKE=; b=SY7KGzrTOC510bZZ1bb8PYBgkjN/nj4uYeTo3zxjsiPnjRdmfp6uqM9hfL8pjKx88p LZu+maaaHVRdXfqet5a5g8hlEsHER6D4Y76EsMKBsg3ByO5WdW01FHyXymckjen8g/fg xVnWjguLljgS6gT46xfNI5wXRGbDSAeNNpOKXNSQOazIj606a+piAZfqDK4cmjktozSz DDq56zr5OhUEjDDIBvigBHrnIVgzt2VZAhkYiWIx+Hs+tcDhje58rj94JIatg8tuIF9b IYKjTMjFLaLxV3efGy4hqXxTOT0cM8+0OKPnjXYG7M/Tc22ZryqAaWmkrrONgSE7w+F9 1kxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=E24EvvwnkSyOCEJmsHGJhLe1DkHNnlgm4bHeLK+leKE=; b=uLiWruPtoWY0J4UeZEzeYHdSpjaazNN+lj1qvrGN1C87xMwvLzwtTVtny35aiBXMzV 4u6UmgJ92UvxhzgXdK+HjBOCRrf9LW4Vhiy0ZvGmjAjTVepsNREWpwsFnTxFLgUKc6y6 A8Yn4YC9J94z/h0tZsCPmwSAdOsYwta6dw5J0sOCZ9RUpiqRPEhrIOCQBLFHTj3UVRYS iNC382PTYcQNqDzPAoXwVqp0X6V9rDSc12WCobwrXoUHJ50wPUWOw6g+pyCmbtQ/2sIM zFd4FjxLphjz/lAyLyV14UoUIZCBqUi8xmvz7P/zeOzJa+RGqGTfiUqxQfUxa8HINuht Ofxg== X-Gm-Message-State: AOAM533kAHzBKDl74X9if08Xo4Tibt+yPUIgV3wwFEIn+9kiPVQH4JJA rOtnXo6+LhaTLFElxicPUzGNyewY1V4= X-Google-Smtp-Source: ABdhPJyipR8Zx+v0NMQZ8WMl2Zbg7MhwWqHznF3zjZI61J/QHiQraNyHUryJGnMktoEcESTsO5pUNA== X-Received: by 2002:a7b:cd96:0:b0:381:201e:ba06 with SMTP id y22-20020a7bcd96000000b00381201eba06mr17180005wmj.78.1647033313230; Fri, 11 Mar 2022 13:15:13 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id m9-20020a05600c4f4900b00389e8184edcsm4324707wmq.35.2022.03.11.13.15.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 13:15:12 -0800 (PST) Message-Id: In-Reply-To: References: Date: Fri, 11 Mar 2022 21:14:58 +0000 Subject: [PATCH 11/16] fsmonitor-ipc: add _() to calls to die() Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Jeff Hostetler , Jeff Hostetler Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Jeff Hostetler From: Jeff Hostetler fixup! fsmonitor-ipc: create client routines for git-fsmonitor--daemon Fix translation markings. Signed-off-by: Jeff Hostetler --- fsmonitor-ipc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fsmonitor-ipc.c b/fsmonitor-ipc.c index 91a535f1219..789e7397baa 100644 --- a/fsmonitor-ipc.c +++ b/fsmonitor-ipc.c @@ -152,7 +152,7 @@ int fsmonitor_ipc__send_command(const char *command, state = ipc_client_try_connect(fsmonitor_ipc__get_path(), &options, &connection); if (state != IPC_STATE__LISTENING) { - die("fsmonitor--daemon is not running"); + die(_("fsmonitor--daemon is not running")); return -1; } @@ -161,7 +161,7 @@ int fsmonitor_ipc__send_command(const char *command, ipc_client_close_connection(connection); if (ret == -1) { - die("could not send '%s' command to fsmonitor--daemon", c); + die(_("could not send '%s' command to fsmonitor--daemon"), c); return -1; } From patchwork Fri Mar 11 21:14:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Hostetler X-Patchwork-Id: 12778630 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14E3EC433F5 for ; Fri, 11 Mar 2022 22:49:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229782AbiCKWu7 (ORCPT ); Fri, 11 Mar 2022 17:50:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229875AbiCKWur (ORCPT ); Fri, 11 Mar 2022 17:50:47 -0500 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE69428A1F5 for ; Fri, 11 Mar 2022 14:24:56 -0800 (PST) Received: by mail-wm1-x336.google.com with SMTP id p184-20020a1c29c1000000b0037f76d8b484so6144148wmp.5 for ; Fri, 11 Mar 2022 14:24:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=VTRoXHcmJRiv+R6PaQ+KLr6RWweIZ2q+9od6IDw28Js=; b=UlJ6QgV+98oudrkehN0suKyfrJ0mSMkHJ2bBTZ6bNJg3Z4hRqQdm2R8AT6xX/j91Ty XUAKj/kZqxmoYn1xMOKhTnlInpmj7PjVIysGovmGrgWol9yLhmQELwBy2iVh57cyW+Xm lcvqI8CMbB8slrlGk1CyWHehxgIK37HsjIheQUbrj+1eQVfyXQeVsw9gBJMtCQI81MQY BIS0RBtxV5QvM5tkmBzeEJ9uCCqQv4tM+A6zTayza8n7NBklnRYpLrsL7lvsRy85LBDq 3xZHtb87tQriYQ5uf98GYXaBKtIVxsJex15XOIBwh7AGuZxYfr58uqlY5tK1CB0HvxAn UZyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=VTRoXHcmJRiv+R6PaQ+KLr6RWweIZ2q+9od6IDw28Js=; b=QYQwEvFQLGc0i+NcqPhG70A6Fl1n/YQAJ+6uRtDCZzKmXnXaSnEmH771FqgQXFk5pM YzqxFYdYp8ZSSo6NT7GCdx7J0KjehSglkhXirVJwXLn/OozeyksfjWpvsBN/MORZX3e1 NXcnXUR1Y4xSZ/pY6oe7Bz6HSVnna8wZdocJR9Mg2Z8ExDSId+yQRSpETqkEoIEtKOiG CDdERSvNgVuKQFoebcoq3uJb7TYgIIzk8N9hVhBpfWMmiE2g/B1W9QCbgTbiy73O9I0Z wKfc+4x0Q6iri7aporQw2eM1n3qeDeXTkS+LOqG+ZXBdWHn/6d3OkWMB21/iHlJef+u2 JbOA== X-Gm-Message-State: AOAM531DnIbujkuIwTFRIFVOTjKz3fFNILJJzEpqrdj6zd52AaWH7xus akBYrCQqjiVQC1LigFRVSQwVA52/saU= X-Google-Smtp-Source: ABdhPJx6jT9nMs2P6fpCIwBufSLm40AxjdDBH8qEcbLNAS3+R2Mt0NpfERiMe/TsXqDkEO581lWu8w== X-Received: by 2002:a05:600c:4e8f:b0:389:f440:512f with SMTP id f15-20020a05600c4e8f00b00389f440512fmr2881863wmq.134.1647033314112; Fri, 11 Mar 2022 13:15:14 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id e18-20020adfdbd2000000b001e4bbbe5b92sm8263723wrj.76.2022.03.11.13.15.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 13:15:13 -0800 (PST) Message-Id: <25fc4c993422cfcc1fcf7d4432828a8df1bb25bd.1647033303.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Fri, 11 Mar 2022 21:14:59 +0000 Subject: [PATCH 12/16] compat/fsmonitor/fsm-listen-darwin: add _() to calls to error() Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Jeff Hostetler , Jeff Hostetler Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Jeff Hostetler From: Jeff Hostetler fixup! compat/fsmonitor/fsm-listen-darwin: implement FSEvent listener \ on MacOS Signed-off-by: Jeff Hostetler --- compat/fsmonitor/fsm-listen-darwin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compat/fsmonitor/fsm-listen-darwin.c b/compat/fsmonitor/fsm-listen-darwin.c index 9a73fb607d5..d9d0d0fa0e9 100644 --- a/compat/fsmonitor/fsm-listen-darwin.c +++ b/compat/fsmonitor/fsm-listen-darwin.c @@ -335,7 +335,7 @@ int fsm_listen__ctor(struct fsmonitor_daemon_state *state) return 0; failed: - error("Unable to create FSEventStream."); + error(_("Unable to create FSEventStream.")); FREE_AND_NULL(state->backend_data); return -1; @@ -383,7 +383,7 @@ void fsm_listen__loop(struct fsmonitor_daemon_state *state) data->stream_scheduled = 1; if (!FSEventStreamStart(data->stream)) { - error("Failed to start the FSEventStream"); + error(_("Failed to start the FSEventStream")); goto force_error_stop_without_loop; } data->stream_started = 1; From patchwork Fri Mar 11 21:15:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Hostetler X-Patchwork-Id: 12778651 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C5818C433F5 for ; Fri, 11 Mar 2022 23:13:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229797AbiCKXOG (ORCPT ); Fri, 11 Mar 2022 18:14:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229448AbiCKXOE (ORCPT ); Fri, 11 Mar 2022 18:14:04 -0500 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBC659BBBC for ; Fri, 11 Mar 2022 15:12:58 -0800 (PST) Received: by mail-wm1-x32f.google.com with SMTP id p184-20020a1c29c1000000b0037f76d8b484so6190509wmp.5 for ; Fri, 11 Mar 2022 15:12:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=FUroZ4Mya6xcccBpf61ufnBkXmscI16csl6+zPcmW84=; b=cBaWP515G42NBBNHHtV8rspjRsV7tk1dGhv1BIHE5hxLBWKWvoiAoSaNw+7WV+cBRC u0i8BhDlJ9Rc7/IP/PtYjL9j06YmFfSpyy+o3p3V2xMpLktks3I2sAv704aPo8ZEjA1p 7RmpgXMiE4KKXS1o1CuuIS/SfgwWdrrC9iM4XLdF3vogplE1dlUOuQ+B+dbxwbJkaVkp cvsLENWlPV8cHoAyndDJ61otrbwyX7neagfr6EIx/v2seNBbr+ZjSV1kebqJmv0lTXGW Si4Ii0PQuNczAyZBPx6aTW9nD2ggOnYugjFFPgw7i2lETkUxQOvHHInbwut6eOZvMmL7 Fg1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=FUroZ4Mya6xcccBpf61ufnBkXmscI16csl6+zPcmW84=; b=ccTenvXTmRoY0c6HqV0DXl+OBAXVlRBgmii+6eD5FI8yU38H9Xwo5NIes0yzlHHdT9 uD1F7XrWfdhNYT0+DtL7hQ4XQobfRye8Nw3VXknHdNa548z6sLEwAjP44CIkwKp75nP8 N/6YOOFFKwtdJPFzDrBcP++4Wlg8mpneJswijcgKdENJkT0G1w3+rJTVzFmpgNeRRtyp ByMhj5bvCQBwhgxT5Zp3SG8iMRiSzgqLPwc2SICWixYqjx1ErsqM3t4cXxbIZ3KtZXT1 B6wy/ChwGDYTRxtLpgcUJJukgUUUbAfJskJ2fcwE8npLgY3SHkHbdCNDn+BurAq6K80F /IBA== X-Gm-Message-State: AOAM533xc9c3ELQM+OI57M37Fys2Xky7TySw3DpNJRtcNeVNekW5xW7B 4HJiD7jAZAKT0pANLRMMgUU3sT4llOU= X-Google-Smtp-Source: ABdhPJw9DzdgFc60lQ/GO9LmIaqQrOc4/Yuop22Y2hrILIBbRxnxKTPa/CXBpfM2IzJpFKIG1m3baA== X-Received: by 2002:a05:600c:507:b0:389:9f23:99e7 with SMTP id i7-20020a05600c050700b003899f2399e7mr17263082wmc.175.1647033314838; Fri, 11 Mar 2022 13:15:14 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id n5-20020a05600c3b8500b00389dd6566f3sm5608200wms.19.2022.03.11.13.15.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 13:15:14 -0800 (PST) Message-Id: In-Reply-To: References: Date: Fri, 11 Mar 2022 21:15:00 +0000 Subject: [PATCH 13/16] compat/fsmonitor/fsm-listen-win32: add _() to calls to error() Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Jeff Hostetler , Jeff Hostetler Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Jeff Hostetler From: Jeff Hostetler fixup! compat/fsmonitor/fsm-listen-win32: implement FSMonitor backend \ on Windows Signed-off-by: Jeff Hostetler --- compat/fsmonitor/fsm-listen-win32.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compat/fsmonitor/fsm-listen-win32.c b/compat/fsmonitor/fsm-listen-win32.c index c2d11acbc1e..5b928ab66e5 100644 --- a/compat/fsmonitor/fsm-listen-win32.c +++ b/compat/fsmonitor/fsm-listen-win32.c @@ -82,7 +82,7 @@ static int normalize_path_in_utf8(FILE_NOTIFY_INFORMATION *info, if (len > 0) goto normalize; if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) { - error("[GLE %ld] could not convert path to UTF-8: '%.*ls'", + error(_("[GLE %ld] could not convert path to UTF-8: '%.*ls'"), GetLastError(), (int)(info->FileNameLength / sizeof(WCHAR)), info->FileName); @@ -185,7 +185,7 @@ static int start_rdcw_watch(struct fsmonitor_daemon_backend_data *data, if (watch->is_active) return 0; - error("ReadDirectoryChangedW failed on '%s' [GLE %ld]", + error(_("ReadDirectoryChangedW failed on '%s' [GLE %ld]"), watch->path.buf, GetLastError()); return -1; } @@ -228,7 +228,7 @@ static int recv_rdcw_watch(struct one_watch *watch) * sure it is worth it. */ - error("GetOverlappedResult failed on '%s' [GLE %ld]", + error(_("GetOverlappedResult failed on '%s' [GLE %ld]"), watch->path.buf, gle); return -1; } From patchwork Fri Mar 11 21:15:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Hostetler X-Patchwork-Id: 12778634 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4E5DAC433EF for ; Fri, 11 Mar 2022 22:53:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229814AbiCKWym (ORCPT ); Fri, 11 Mar 2022 17:54:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229812AbiCKWyd (ORCPT ); Fri, 11 Mar 2022 17:54:33 -0500 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 264E9270149 for ; Fri, 11 Mar 2022 14:28:44 -0800 (PST) Received: by mail-wm1-x333.google.com with SMTP id c192so5904053wma.4 for ; Fri, 11 Mar 2022 14:28:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=GfKL4YvejmmejdQwVMUsL9M5M/X2KW1AxArZg67NjVc=; b=nxjp6PiSZaP99Mfj4PQ8gUncemjbPHqzG9LL8MTyazFp5ckc03munL1mkGbh18I2VJ 0islgJ6SPzM544uaiEE6lXE7Gbbgpqpqmt/nBK+lghmcF2vpdO4BftP6Rc6Z08eHoEQh sfp2Nu+eDLLXp1K3MCsWwyRssMOpvhoE3TQMpxugJtXrSlDDS1H1ZYMl+zStBzh07bml vXu8XdYigmbQsyyqjh+zRDjzeS9adi+Xvr7zipxFpliuH7X+LBB1PENwX890NDkn1EFQ IjJDrRXjNx9959/40n+fvXDm5HKI5C2fslsKJU2Qk4RPgQ9Ny5nQlMDOV3mrIGp+FNEC 0DrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=GfKL4YvejmmejdQwVMUsL9M5M/X2KW1AxArZg67NjVc=; b=8DdyNisPxlqZIwEonIhgmaxgBFlrwqqAskRNCWomc8fi99Tj9so1WFzwi+QCASFA26 y8pqWZE/2re51er9/bTlGbN42XDtYyrU0kDMTNDh8q66/cn/SEXCVm+lFBcHUlATzwWw KBSvAd/EbXI56KlfdDISFw6o1gkKWCARVN0O5Wii3e6iLUiuLO4klZoe/Gpdbwna46eS toJN41YCh9sgtzpCv4PcTvNwDYHYOwNV/kkvBcM4odo0HWAuDkvaxg1G83nqpgIhKtre 5YjC1BZslRiBkVvxXfCrSH/InpEyBxWJZICsEL5ArmOmATzhWmODs2gJVRdJzXiK3WiR XSKw== X-Gm-Message-State: AOAM530awbpwnqOs7Fm7E2yJN1L+Bn/dTPgpfByajPK/93YQT09aa7pG LHxIUnZY76md9fwGClkoNK3R6LaFldY= X-Google-Smtp-Source: ABdhPJzrE8QrmtGFyHDEAXcgbt4wGyBRVWgm+rQd3Uemb9ocK3syWzF4M8O4f9obSdMynFvOpVAOew== X-Received: by 2002:a7b:c19a:0:b0:381:8495:9dd with SMTP id y26-20020a7bc19a000000b00381849509ddmr17406400wmi.33.1647033315568; Fri, 11 Mar 2022 13:15:15 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id r17-20020a05600c35d100b00389f368cf1esm2014059wmq.40.2022.03.11.13.15.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 13:15:15 -0800 (PST) Message-Id: <378c5ca510ce4029df6caf83740c582a93008612.1647033303.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Fri, 11 Mar 2022 21:15:01 +0000 Subject: [PATCH 14/16] fsmonitor--daemon: add _() to calls to die() Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Jeff Hostetler , Jeff Hostetler Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Jeff Hostetler From: Jeff Hostetler fixup! fsmonitor--daemon: implement 'run' command Fix translation marking on die(). Signed-off-by: Jeff Hostetler --- builtin/fsmonitor--daemon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/fsmonitor--daemon.c b/builtin/fsmonitor--daemon.c index 02a99ce98a2..b3687a200ef 100644 --- a/builtin/fsmonitor--daemon.c +++ b/builtin/fsmonitor--daemon.c @@ -1326,7 +1326,7 @@ static int try_to_run_foreground_daemon(int detach_console) * common error case. */ if (fsmonitor_ipc__get_state() == IPC_STATE__LISTENING) - die("fsmonitor--daemon is already running '%s'", + die(_("fsmonitor--daemon is already running '%s'"), the_repository->worktree); if (fsmonitor__announce_startup) { From patchwork Fri Mar 11 21:15:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Hostetler X-Patchwork-Id: 12778616 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5B163C433F5 for ; Fri, 11 Mar 2022 22:47:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229842AbiCKWsr (ORCPT ); Fri, 11 Mar 2022 17:48:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229758AbiCKWsL (ORCPT ); Fri, 11 Mar 2022 17:48:11 -0500 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09C6C283B60 for ; Fri, 11 Mar 2022 14:23:02 -0800 (PST) Received: by mail-wm1-x32a.google.com with SMTP id l1-20020a05600c4f0100b00389645443d2so6160971wmq.2 for ; Fri, 11 Mar 2022 14:23:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=9g2wyL2OIZo9JPKszsWzDlTklgXo2s1AMtEwqOGQR8I=; b=nOqUJH51cYaZumrB3/knd9zXUoe14Z05SWhP9yOjNky7uaeNHKtdT2yZEqhFKwgLAr WwH/afZ72FrmSn+Aw9ZvSAIOvcov/SGZyLTdksFf3aVK2J76t4lDpP86Z65IqjXHWLIk wg4xWh3qDK+gBhKjokFod7SAu2uHbtfwDu7ya1QLNE3cqvzXGniuMFEdyUzADHj0QXRq HtYu+MvT/vLznZPG+vA1Pf3dqifEba1EAMq5xsKRBCt1D6D2Fz7coHF0YQFsmysGdbW2 eu3a/gfv2aBtXV/EHlTHYi+3IdgZBL23Ac/o7bSfmh6vHFuZrDkK1jGzwDxXDNxKZ9kz REBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=9g2wyL2OIZo9JPKszsWzDlTklgXo2s1AMtEwqOGQR8I=; b=MyWJEiRyQ398k2BmslppLXiQNMy2RcWMUxKZzT2wxF2aAf0UXu134JpkqI0VtGak03 evMQkIj50UwiaxZHtJ1V+cYW/H7ITHevfJSkOSAkotTilfctegcazamEbUM6f4/WMbg7 UJMe1Afb9CB7RL/bdMOlFT5D8/rtuvFTJyEeMqYsKsbL//nNLAe7SA+wIOsYLkBbALOz VN4z34qwi/Ap45CAkOaQd+vxoOOF9TabsiSlrI1AmPQ9io/XBh0A9jMP247mXnsqsF00 Roqry4ewcIhLuxu5cHkLR643DtkkMxjeAnYPAAQtIegL5BtNywys8B8WfbD3irN31RG5 3mPw== X-Gm-Message-State: AOAM531g/H+EYoeMEGoc5Gud7wlU9KoTyZoP1mec7FJgtQhFKDnAzy1e negSkrouCnB4hT07huHexOJEWaswWws= X-Google-Smtp-Source: ABdhPJx6ExOwdnuYYrDz0fIprCHgirD4ycjahqUCMySRtH9+65vtPJEtodSu8m3cnVHp769L4KFDQw== X-Received: by 2002:a1c:2bc3:0:b0:381:3dd5:5707 with SMTP id r186-20020a1c2bc3000000b003813dd55707mr16872718wmr.31.1647033316422; Fri, 11 Mar 2022 13:15:16 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id g5-20020a5d64e5000000b00203914f5313sm3917129wri.114.2022.03.11.13.15.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 13:15:16 -0800 (PST) Message-Id: <118ba1b5d04283da93b46f24201827c4a226d3fa.1647033303.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Fri, 11 Mar 2022 21:15:02 +0000 Subject: [PATCH 15/16] fsmonitor--daemon: add _() to calls to error() Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Jeff Hostetler , Jeff Hostetler Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Jeff Hostetler From: Jeff Hostetler fixup! fsmonitor--daemon: implement 'start' command Fixup translation on die(). Signed-off-by: Jeff Hostetler --- builtin/fsmonitor--daemon.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/builtin/fsmonitor--daemon.c b/builtin/fsmonitor--daemon.c index b3687a200ef..a30ecf6cfac 100644 --- a/builtin/fsmonitor--daemon.c +++ b/builtin/fsmonitor--daemon.c @@ -1381,7 +1381,7 @@ static int try_to_start_background_daemon(void) * immediately exited). */ if (fsmonitor_ipc__get_state() == IPC_STATE__LISTENING) - die("fsmonitor--daemon is already running '%s'", + die(_("fsmonitor--daemon is already running '%s'"), the_repository->worktree); if (fsmonitor__announce_startup) { @@ -1411,13 +1411,13 @@ static int try_to_start_background_daemon(void) default: case SBGR_ERROR: case SBGR_CB_ERROR: - return error("daemon failed to start"); + return error(_("daemon failed to start")); case SBGR_TIMEOUT: - return error("daemon not online yet"); + return error(_("daemon not online yet")); case SBGR_DIED: - return error("daemon terminated"); + return error(_("daemon terminated")); } } From patchwork Fri Mar 11 21:15:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Hostetler X-Patchwork-Id: 12778686 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30406C433F5 for ; Sat, 12 Mar 2022 00:15:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229648AbiCLAQL (ORCPT ); Fri, 11 Mar 2022 19:16:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229681AbiCLAQJ (ORCPT ); Fri, 11 Mar 2022 19:16:09 -0500 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2FD911EBA9B for ; Fri, 11 Mar 2022 14:23:19 -0800 (PST) Received: by mail-lf1-x129.google.com with SMTP id w7so17457818lfd.6 for ; Fri, 11 Mar 2022 14:23:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=oaK0qAdl2PFgiQVfAFiByJpTMx/6+l7fU2gN08F/xkg=; b=hFkvdSKjNJHBF6/QXY4yDUNvOvyk+ApHlYcIHA6m0gsyAx4XMSFZ+9oHURDgRwpff+ hWue8NNjHBOQCJJHnnt0NubfLPX7XSUxkV5d72eDenz1PsoUbuKFFTBxsAVB/7LPPJmM d5RLHqiR4y5Lawvfdx/m+YQ0v/fTNrAkvHnE1CzITJzTPA0NOtZdLY0t231K6rRJQVTh kFEHVOG8FZu/7iaU4JdyNm5pd2IyUYsnunnCcu5UdHJPYfXhlws1sMC20rMVSKL8LgpY 30AHX6GhokLxeq4HT/HJsrkZX3lX5RXJUCNhysXqn1bJLZtK6aFjbxf6nAlqa4zzEVjd Ms6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=oaK0qAdl2PFgiQVfAFiByJpTMx/6+l7fU2gN08F/xkg=; b=dtu2bXiZhY3hI7SOUSBbQ07n8EFpJC9hYA9Jb90v/7052bhCjiULFNLHFML6GTIsBD 2erImxCkxxbjOtztmfNBJfsPHrm4NrmOvw1JIX5m42RoXgaQmCi1KDZzc+EYsIX3FfCz 1fXDRCe2HsrYuMkO5jLTa2RsVb4r81LQ71Ab+ThShtkFUSJz+NHUAhk1xoi+PTP3sGDf F6bEySBSIA+rzl0gsYFp1bJRQlCD0YHlNNJj3NJGpVt/YxAr2LhmQDtTnV4YAbFfGEX8 g0qfWh0fDO0K5B/fa0K0CpKEIylfeCK8koNyEDIgztyx7USXgPU2xWbE0AVXa9VQ70HD /bhA== X-Gm-Message-State: AOAM530OXEjZh6eI/0vHnZt8mEU05HLnHEvW0cSuMGwesx61ntfrpdvm tHWeqRu8wGkOIf3wQ84CZoxUDsaWwI0= X-Google-Smtp-Source: ABdhPJz9mHP8mByyDTgX3ygg7fTlLu/eKzqBRUQNd3+l9lqg9/wWX/Mb32DxRvltZCpug1Zb6tqbHQ== X-Received: by 2002:a05:6000:23a:b0:1f0:2359:9cd5 with SMTP id l26-20020a056000023a00b001f023599cd5mr8428434wrz.335.1647033317404; Fri, 11 Mar 2022 13:15:17 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id 4-20020a056000154400b00203812ca383sm7026773wry.78.2022.03.11.13.15.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 13:15:16 -0800 (PST) Message-Id: <432f9ff9d92ff55216555864cb3571c94a2c6db9.1647033303.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Fri, 11 Mar 2022 21:15:03 +0000 Subject: [PATCH 16/16] fsmonitor-settings: simplify initialization of settings data Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Jeff Hostetler , Jeff Hostetler Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Jeff Hostetler From: Jeff Hostetler fixup! fsmonitor: config settings are repository-specific Signed-off-by: Jeff Hostetler --- fsmonitor-settings.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fsmonitor-settings.c b/fsmonitor-settings.c index 3b54e7a51f6..757d230d538 100644 --- a/fsmonitor-settings.c +++ b/fsmonitor-settings.c @@ -22,11 +22,10 @@ static void lookup_fsmonitor_settings(struct repository *r) return; CALLOC_ARRAY(s, 1); + s->mode = FSMONITOR_MODE_DISABLED; r->settings.fsmonitor = s; - fsm_settings__set_disabled(r); - /* * Overload the existing "core.fsmonitor" config setting (which * has historically been either unset or a hook pathname) to