From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-3.7 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by dcvr.yhbt.net (Postfix) with ESMTP id EF24D1F47C for ; Mon, 9 Jan 2023 21:50:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237554AbjAIVro convert rfc822-to-8bit (ORCPT ); Mon, 9 Jan 2023 16:47:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237575AbjAIVrY (ORCPT ); Mon, 9 Jan 2023 16:47:24 -0500 Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C51FF1CFF6 for ; Mon, 9 Jan 2023 13:47:23 -0800 (PST) Received: by mail-pj1-f41.google.com with SMTP id b9-20020a17090a7ac900b00226ef160dcaso9486682pjl.2 for ; Mon, 09 Jan 2023 13:47:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=A61ZEWy5lgGHF2Il/RYO2XqnniwbXSDEXJopkUH6cIA=; b=FaIcj3N+yDAfd4SQvSrgAtI8QiW2qhtOsBUbXKACAluYVz8ttXw1loEhN7odHnoExm m83yO9RPrvoMQJSToqfs1cGIgNERKhq6aC4Zc6DIZXECoau3v96xkDC35NB33r5W6BQ9 yDtPHbsB6+T5t6x3YOFZ30I1namvQkCSsjRkD/oViSHwvfsF5uPJaKPufBYQhWwb2T9C Nrk7+cTw8umrqhC7dCH1EuFEi1wZo7PvK1aec2o5vFtI3yG8q4AaK7NbAm/EHviyDqgC DTHPivQJiZ88vHipKXsd2iRq15DZsXd0N2TwwjsQSUW2b/jyG3/X+L9184wraAF0xWUT 1wCw== X-Gm-Message-State: AFqh2krFuo9kW0QPex1Z9OesEjdY53t8L3g+bqPyT+60eTtMH1VbXhRM NJsshKboARvg3dlpZdox2ndh5Z8TBv8K8q4n+f2w6CAE X-Google-Smtp-Source: AMrXdXsbkgvA4vp/ndn6jA2i3NobHjkwdklGVxNe4wSl7LrU6e6NBKWnc9iEzykkwu75c6BOAzHvTqvoPL+aQ+ZjPC4= X-Received: by 2002:a17:90b:48cf:b0:226:164f:522e with SMTP id li15-20020a17090b48cf00b00226164f522emr3165217pjb.22.1673300843151; Mon, 09 Jan 2023 13:47:23 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Eric Sunshine Date: Mon, 9 Jan 2023 16:47:12 -0500 Message-ID: Subject: Re: [PATCH] githooks: discuss Git operations in foreign repositories To: Preston Tunnell Wilson Cc: Eric Sunshine via GitGitGadget , git@vger.kernel.org, Jeff King Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Sun, Jan 8, 2023 at 9:54 PM Preston Tunnell Wilson wrote: > > So, no, I don't think this qualifies for the BUGS section of > > git-wortkree, and mentioning this potential gotcha only in > > git-worktree but not in any other hook-running command doesn't seem > > ideal either. At present, the best place to discuss it seems to be > > Documentation/githooks.txt, as this patch does. > > I agree the best place to put it is in Documentation/githooks.txt. I > also agree the BUGS section doesn't make sense, but I'm still > wondering if we should call it out in git-worktree.txt in addition to > githooks.txt. When I ran into this issue, I tried to compare my setup > to that of my coworkers. The difference was that I was using > git-worktree, they were not. git-worktree's documentation lists: > > Within a linked worktree, $GIT_DIR is set to point to this private > directory (e.g. /path/main/.git/worktrees/test-next in the example) > and $GIT_COMMON_DIR is set to point back to the main worktree’s > $GIT_DIR (e.g. /path/main/.git). These settings are made in a .git > file located at the top directory of the linked worktree. > > To me, this is the "other side of the coin" of your patch. (Or maybe > one of the many other sides of the coin for commands that can run > git-hooks.) Mentioning a potential collision between git-hooks and > these variables being set could maybe go in the above snippet, maybe > in parentheses. It took a lot of working backwards to narrow the issue > to the interaction between git-worktree and git-hooks rather than the > package manager I was using or the tool the hook was calling. Putting > a note in the git-worktree documentation (in addition to the note in > git-hooks) might help out someone in the future, but I defer to your > judgement. If it doesn't make sense, doesn't fit, or adding it here > would detract and make the documentation more confusing, I am happy to > leave it out. I understand your concern, and can relate to the amount of effort it took to narrow down the problem. Nevertheless, even though you encountered this problem in relation to git-worktree, it's a more general issue which can manifest in other situations. As such, I can't think of a good way to discuss the issue in the git-worktree documentation that wouldn't feel out of place and make the documentation more confusing. I'm not necessarily opposed to someone else giving it a shot if it can be done in a way which doesn't feel out of place and doesn't confuse git-worktree documentation further (especially for those new to the documentation). I just don't know how to do so myself.