From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 77A3A1F8C6 for ; Fri, 9 Jul 2021 22:37:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229563AbhGIWka (ORCPT ); Fri, 9 Jul 2021 18:40:30 -0400 Received: from elephants.elehost.com ([216.66.27.132]:52678 "EHLO elephants.elehost.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229542AbhGIWka (ORCPT ); Fri, 9 Jul 2021 18:40:30 -0400 X-Virus-Scanned: amavisd-new at elehost.com Received: from gnash (cpe00fc8d49d843-cm00fc8d49d840.cpe.net.cable.rogers.com [173.33.197.34]) (authenticated bits=0) by elephants.elehost.com (8.15.2/8.15.2) with ESMTPSA id 169Mbgtj016390 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 9 Jul 2021 18:37:42 -0400 (EDT) (envelope-from rsbecker@nexbridge.com) From: "Randall S. Becker" To: "'Junio C Hamano'" Cc: References: <003701d7741e$550b6510$ff222f30$@nexbridge.com> In-Reply-To: Subject: RE: [Question] worktree vs. gitdir in [includeIf] Date: Fri, 9 Jul 2021 18:37:36 -0400 Message-ID: <009d01d77513$07b638d0$1722aa70$@nexbridge.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Content-Language: en-ca Thread-Index: AQK3SQbvmkVoL9DL4YlGVMllr3mw1QEu7AHWqXIbUMA= Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On July 8, 2021 2:12 PM, Junio C Hamano wrote: >To: Randall S. Becker >Cc: git@vger.kernel.org >Subject: Re: [Question] worktree vs. gitdir in [includeIf] > >"Randall S. Becker" writes: > >> I am wondering whether there is, or are plans for, something analogous >> to [includeIf "worktree:path"] with a similar semantic to [includeIf >> "gitdir:path"]. > >I do not think there currently is an implementation, nor a plan, but I offhand do not see downsides in a feature to let you conditionally >enable some configuration based on the location of the worktree. I'm scratching my head on this a bit. The [includeIf "onbranch:foo"] form is a bit confusing when dealing with a worktree. It looks like the code either does not work if in a worktree or will get the branch of the main repo instead of the worktree ref. It looks like include_by_branch() always returns 0 if in a worktree. Is there something being done in skip_prefix() or resolve_ref_unsafe() that would deal with this? Thanks, Randall