Re: [PATCH v14 2/2] checkout: extend --track with a "fetch" mode to refresh start-point
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 24, 2026, 23:20 UTC
- Message-ID
- <xmqq5x37h6fj.fsf@gitster.g>
- In-Reply-To
- <CAHwyqnWwyPHiaOW+rz-Z9ZvRf=OjXWw2T+rB3cSsxXWXkeRm=Q@mail.gmail.com>
Harald Nordgren <haraldnordgren@gmail.com> writes:
Show 6 quoted lines
> Ok, let's focus on the need for the feature before talking code: > > In an active project, forking from "origin/master" without refreshing > first often has consequences: you start work that has already been > done, or you build on an old version of the code which causes big > conflicts only later when you pull. The fix is simple ...
The above only argues that contributors should not start work on top of a stale codebase without looking at reasonably recent codebase.
I am not sure if automated fetch immediately before forking to start work will be a good fix for that, especially if the fork of a new branch is done blindly _without_ looking at what the updated upstream contains.
> ... ("git fetch
> origin master && git checkout -b topic origin/master"), but it is
> still a mouthful. Other tools exist because this is annoying enough
> that people automate it.And to actually look at the recent codebase, one would probably need
git fetch git log [-p] ..origin -- your-area-of-interest/ ... other inspection of the recent changes to refresh your ... understanding of the base code comes here git checkout -b topic origin
or something like that. Wouldn't folding the first and the third step into one operation encourage omitting the second step? In a sense, having a tool to let people blindly fetch and fork without looking at what changed recently (i.e., they had a reason to think that what they had was stale, so has a fetch actually resolved that staleness? what new things did the fetch bring in?) may encourage a bad workflow.
An obvious complaint against "update and always inspect and understand" would be "it would slow us down!", but that is why projects encourage forking your topic at a well known release tags, not from a random "tip of the tree of the day".
I think most of the above has already been communicated earlier in discussions before we got to v14, but I may be wrong. Are there any new arguments in support of the feature?