Re: [PATCHv5 1/3] wt-status.*: better advices for git status added

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



konglu@xxxxxxxxxxxxxxx writes:

>>> +	} else {
>>> +		status_printf_ln(s, color, _("You are currently editing a commit  
>>> during a rebase."));
>>> +		if (advice_status_hints) {
>>> +			status_printf_ln(s, color, _("  You can amend the commit with"));
>>> +			status_printf_ln(s, color, _("	git commit --amend"));
>>> +			status_printf_ln(s, color, _("  Once you are satisfied with  
>>> your changes, run"));
>>> +			status_printf_ln(s, color, _("	git rebase --continue"));
>>
>> For an advice in "git status" output, the above may be appropriate,
>> but would the user see this in "git commit" template, and if so,
>> isn't it because the user typed "git commit --amend"?  Does it make
>> sense to suggest to run "git commit --amend" in that context?
>
> True, the user will see the messages in the "git commit" template. We
> didn't take this case into account because we thought that not many people
> read the status in the "git commit" template. Anyway, just adding a condition
>
> if (advice_status_hints && !s->amend)
>
> does the job.

Hrm, what would happen if the user ran "git commit" without --amend?

It could be done by mistake, which will be greatly helped by the
information you already gathered during the inspection phase.  

This also can be done deliberately to split a commit in "rebase -i",
so "You are in 'rebase -i', do not commit without --amend!" is a
wrong message, but it may be sensible to give "are you sure you
meant to commit without --amend?"
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]