Subject: Re: [PATCH v2] branch: add "inherit" option for branch.autoSetupMerge

From: Junio C Hamano <[email-masked]>
Date: Sat, 16 Oct 2021 22:50:44 -0700

Josh Steadmon <[email-masked]> writes:

> Thanks for the feedback. I've added "--track=direct" and
> "--track=inherit" flags in V3, which I'll send out shortly. I am a bit
> skeptical of the value of having "--track=direct" when just "--track"
> still works, but I'll leave it up to the list to decide.

Ah, I assumed that with the configuration variable set to inherit,
you'd make a command line --track to use the upstream of the fork
point branch as the upstream of the new branch, but if your
intention is that (1) without --track or --no-track on the command
line, if configuration is set to inherit, the new branch will track
the upstream of the original, and (2) with --track on the command
line, the new branch will track the original without any "inherit"
magic, then I agree that there is no need for a way to explicitly
choose between --track={direct,inherit} from the command line.  The
choice would be, for those with remote.autosetupmerge=inherit, to
use --no-track (to not track anything), --track (to track directly
the original branch), or say nothing (to inherit tracking), and for
those without that, --no-track (to not track) and --track (to track
directly) are the same but there is no way (other than "git -c
var=val") to do "inherited tracking".

One advantage of allowing to be explicit is that you do not have to
remember (or know --- if you are visiting somebody else's repository
to help them out) how remote.autosetupmerge is configured (or
unconfigured).  From the command line, without having to worry about
configured values to interfere, you can control which tracking mode
is used.