Re: [PATCH 5/5] submodule: submodule_move_head omits old argument in forced case
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Dec 20, 2017, 00:01 UTC
- Message-ID
- <20171220000148.GJ240141@aiede.mtv.corp.google.com>
- In-Reply-To
- <CAGZ79kake8k2dM=NPwNoqB5Vkxy+k67PACz01-aXx6-njcisgQ@mail.gmail.com>
Stefan Beller wrote:
> On Tue, Dec 19, 2017 at 2:44 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:
>> checkout -f >> I think I would expect this not to touch a submodule that >> hasn't changed, since that would be consistent with its >> behavior on files that haven't changed.
[...]
> I may have a different understanding of git commands than you do, > but a plain "checkout -f" with no further arguments is the same as > a hard reset IMHO, and could be used interchangeably?
A kind person pointed out privately that you were talking about "git checkout -f" with no further arguments, not "git checkout -f <commit>". In that context, the competing meanings I mentioned in https://crbug.com/git/5 don't exist: either a given entry in the worktree matches the index or it doesn't.
So plain "git checkout -f" is similar to plain "git reset --hard" in that it means "make the worktree (and index, in the reset case) look just like this". checkout -f makes the worktree look like the index; reset --hard makes the worktree and index look like HEAD.
In that context, more aggressively making the submodule in the worktree get into the defined state sounds to me like a good change.
Hopefully my confusion helps illustrate what a commit message focusing on the end user experience might want to mention.
Thanks again, Jonathan