Re: [PATCH v2 1/2] status: show comparison with upstream default branch
- From
brian m. carlson <sandals@crustytoothpaste.net>
- Date
- Dec 24, 2025, 01:30 UTC
- Message-ID
- <aUtCP5YvE_v9hmgM@fruit.crustytoothpaste.net>
- In-Reply-To
- <a3800aed18e576e42de273c9dae0e25bbe26ac6a.1766530448.git.gitgitgadget@gmail.com>
On 2025-12-23 at 22:54:07, Harald Nordgren via GitGitGadget wrote:
Show 5 quoted lines
> +static char *get_default_remote_ref(char **full_ref_out)
> +{
> + int flag;
> + const char *resolved;
> + static const char *remotes[] = { "upstream", "origin", NULL };This should definitely be configurable, not hard-coded. For instance, I have this in my gitconfig:
[clone]
defaultRemoteName = defso my default remote name is `def` (short for "default", as in the default place to push) and this code will never work.
Another reason to have this be configurable is that some projects (like a company I used to work at) have tooling that demands a specific remote naming convention for tooling to work properly. In this particular case, `upstream` would have been the right choice, but I also worked at a company where English was the common language. Many people may prefer to use names suitable to their local language.
-- brian m. carlson (they/them) Toronto, Ontario, CA