From: Junio C Hamano Date: Mon, 02 Apr 2018 20:29:56 GMT Subject: Re: [PATCH v6 2/6] reset: introduce show-new-head-line option Message-ID: In-Reply-To: <20180331151804.30380-3-t.gummerer@gmail.com> Thomas Gummerer writes: > Introduce a new --show-new-head-line command line option, that > determines whether the "HEAD is now at ..." message is printed or not. > It is enabled by default to preserve the current behaviour. > > It will be used in a subsequent commit to disable printing the "HEAD is > now at ..." line in 'git worktree add', so it can be replaced with a > custom one, that explains the behaviour better. > > We cannot just pass the --quite flag from 'git worktree add', as that > would also hide progress output when checking out large working trees, > which is undesirable. > > As this option is only for internal use, which we probably don't want > to advertise to our users, at least until there's a need for it, make > it a hidden flag. As a temporary hack, adding something like this may be OK, but in the longer run, I think we should (at least) consider refactoring "reset --hard" codepath to a freestanding and silent helper function so that both cmd_reset() and add_worktree() can call it and report the outcome in their own phrasing. And I support the decision not to advertise this as a new feature or an option by implementing it as hidden-bool. This is completely offtopic tangent, but I wonder how hidden-bool or hidden options[] element in general interacts with the recent addition of helping command line completion. Are we already doing the right thing?