Re: [PATCH] help: allow redirecting to help for aliased command
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 28, 2018, 17:00 UTC
- Message-ID
- <xmqqwor5d0af.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <fb221514-4749-affa-c657-0e36dd28fb13@rasmusvillemoes.dk>
Rasmus Villemoes <rv@rasmusvillemoes.dk> writes:
Show 18 quoted lines
>>> + if (follow_alias > 0) {
>>> + fprintf_ln(stderr,
>>> + _("Continuing to help for %s in %0.1f seconds."),
>>> + alias, follow_alias/10.0);
>>> + sleep_millisec(follow_alias * 100);
>>> + }
>>> + return alias;
>>
>> If you have "[alias] cp = cherry-pick -n", split_cmdline discards
>> "-n" and the follow-alias prompt does not even tell you that it did
>> so,
>
> That's not really true, as I deliberately did the split_cmdline after
> printing the "is an alias for", but before "continuing to help for", so
> this would precisely tell you
>
> cp is an alias for 'cherry-pick -n'
> continuing to help for 'cherry-pick' in 1.5 secondsYes, but notice that cherry-pick appears twice---I do not know about you, but I know at least my eyes will be drawn to the last mention that does not have '-n' stronger than the one before/above that line.
In any case, I think Peff's "Let's teach 'git cp -h' to prefix what 'cp' is aliased to before invoking 'git cherry-pick -n -h' (and let it fail)" approach is much more robust, so let's do that without emulating that command-typo-correction codepath.