Re: [PATCH v2] var: add GIT_DEFAULT_BRANCH variable
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Nov 3, 2021, 16:48 UTC
- Message-ID
- <CAPig+cQ1fdU=YNc5jtT8oYaBMd8MP-j23hSsZ7GD-T99vDDeoA@mail.gmail.com>
- In-Reply-To
- <YYJ0aQ11uHA/XUt3@coredump.intra.peff.net>
On Wed, Nov 3, 2021 at 7:37 AM Jeff King <peff@peff.net> wrote:
> I.e., I don't think introducing a new variable into "git var" is that > big a deal. They don't have to be related to an environment variable; > the documentation calls them "logical variables". This is exactly the > kind of thing it's designed for.
I almost don't want to mention it since it's not very discoverable (and is never the first place I think to look), but git-rev-parse already contains a grab-bag of options unrelated to revision parsing. Many of the options relate to querying paths (--show-toplevel, --show-cdup, etc.) or other information related to a repository (--local-env-vars, --show-object-format, etc.). So, adding --show-default-branch may be one possibility.