From: Eric Sunshine Date: Fri, 04 May 2018 07:23:24 GMT Subject: Re: [PATCH] checkout & worktree: introduce a core.DWIMRemote setting Message-ID: In-Reply-To: On Fri, May 4, 2018 at 3:14 AM, Eric Sunshine wrote: > The setting up of a remote-tracking branch is DWIM'd as of 4e85333197 > ("worktree: make add dwim", 2017-11-26); it doesn't > require an explicit option to enable it (though tracking can be > disabled via --no-track). The "guess-remote" feature does something > entirely different; it was added to avoid backward compatibility > problems. > > In long-form: > > git worktree add > > adds a new worktree at and checks out . As originally > implemented, shortened: > > git worktree add > > does one type of DWIM, as a convenience, and pretends that the user > actually typed: > > branch=$(basename ) > git branch $branch HEAD > git workree add $branch This explanation isn't wrong, but it conflates two separate features, thus is confusing. The $(basename ) DWIM'ing from the short form of the command, "git worktree add ", doesn't actually have anything to do with the DWIM'ing added by 4e85333197 ("worktree: make add dwim", 2017-11-26), which merely tries to DWIM a remote-tracking branch of similar name to $branch (whether $branch came from long or short form of the command), so I confused the issue unnecessarily by talking about the short form.