Re: amend warnings with no changes staged

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

 



Junio C Hamano <gitster@xxxxxxxxx> writes:

> Jonathan Nieder <jrnieder@xxxxxxxxx> writes:
>
>>>> Some non-judgemental descriptive output like
>>>>
>>>> 	$ git commit --amend --no-edit
>>>> 	No changes.
>>>> 	$
>>>>
>>>> would address this case, without bothering people who are doing it
>>>> intentionally.  So I think there's room for a simple improvement here.
>>>
>>> I do that to refresh the committer timestamp.
>>
>> I do, too.  The proposal is, paraphrasing,
>>
>> 	$ git commit --amend --no-edit
>> 	Ah, I see that you want me to refresh the committer timestamp.
>> 	Done, as requested.
>> 	$
>
> Ah, OK then.  I somehow misread "No changes." as an error message.

Well, on second thought, I think "fatal: no changes" that exits with
non-zero, with "--force" as an escape hatch for those who want to
refresh the committer timestamp, would probably be more in line with
the expectation Lukas had when this thread was started, and I further
suspect that it might be a bit more end-user friendly.

It is a backward incompatible behaviour, but I suspect that if I
were inventing "commit --amend" today, unlike 8588452c ("git-commit
--amend: allow empty commit.", 2006-03-04), I probably would design
it that way.  After all, failing and stopping is always a safer
option than going ahead with or without a report.

I am not sure which one between "go ahead anyway but report" and
"fail by default but allow forcing" I would prefer more.  At least
not yet.  But I won't rule the latter out at this point.

Thanks.



[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]

  Powered by Linux