Re: [PATCH 1/1] add: use advise function to display hints
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 6, 2020, 23:13 UTC
- Message-ID
- <xmqq36cs89gz.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <20200106230712.GA181522@google.com>
Emily Shaffer <emilyshaffer@google.com> writes:
Show 18 quoted lines
> On Thu, Jan 02, 2020 at 03:04:01AM +0000, Heba Waly via GitGitGadget wrote:
>> From: Heba Waly <heba.waly@gmail.com>
>>
>> @@ -390,7 +390,7 @@ static int add_files(struct dir_struct *dir, int flags)
>> fprintf(stderr, _(ignore_error));
>> for (i = 0; i < dir->ignored_nr; i++)
>> fprintf(stderr, "%s\n", dir->ignored[i]->name);
>> - fprintf(stderr, _("Use -f if you really want to add them.\n"));
>> + advise(_("Use -f if you really want to add them.\n"));
>
> In the vein of the rest of your project, for me I'd rather see a
> copy-pasteable response here:
>
> "Use 'git add -f " + name + "' if you really want to add them."
>
> That is, if you know the name of the file that was being added here, you
> could provide it so the user can simply copy and go, rather than
> retyping.Just being a devil's advocate, but you are opening a can of worms by suggesting so---the path needs to be quoted proporly (and the way to do so may be different depending on the shell in use), for example.