git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: "Joshua J. Kugler" <joshua@azariah.com>
Cc: git@vger.kernel.org
Subject: Re: includeIf appears to not be working
Date: Mon, 12 Dec 2022 15:55:42 -0500	[thread overview]
Message-ID: <Y5eVTrK2CO0h5BPl@coredump.intra.peff.net> (raw)
In-Reply-To: <8316344.DvuYhMxLoT@hosanna>

On Mon, Dec 12, 2022 at 11:19:41AM -0900, Joshua J. Kugler wrote:

> Contents of ~/.gitconfig (truncated):
> 
> [user]
>         name = Joshua Kugler
>         email = joshua@personal.com
> [includIf "gitdir:~/repos/work/"]
>         path = ~/repos/work/gitconfig

Maybe a dumb question, but is this cut-and-paste verbatim? If so, then
perhaps s/includ/include/ would help?

With that change, your example works for me.

> Like I said, I've set this up before, and had it working. I don't know what 
> I'm doing differently/wrong...but would be happy to be told so.

If it's not the typo, then possibly there are symlinks involved? We'll
run realpath() on the repository directory before matching, so your
pattern needs to take that into account.

> Is there a debug command which can show if the gitdir is/isn't
> matching like I thought it should?  What other command output could
> help debug this?

No, there's no debug/tracing code for this feature. You'd have to run it
under gdb (break on the include_by_gitdir function).

-Peff

  parent reply	other threads:[~2022-12-12 20:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-12 20:19 includeIf appears to not be working Joshua J. Kugler
2022-12-12 20:54 ` Eric Sunshine
2022-12-12 21:05   ` Joshua J. Kugler
2022-12-12 20:55 ` Jeff King [this message]
2022-12-12 20:57   ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y5eVTrK2CO0h5BPl@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=joshua@azariah.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).