Re: git commit --amend safety check?

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

 



Peter Krefting <peter@xxxxxxxxxxxxxxxx> writes:

> For commit --amend, I would say it would refuse to amend if the commit
> you are trying to amend
>
>  1. was not authored by yourself (and --reset-author was not given), or
>  2. is reachable (or is the tip?) from an upstream branch.

I agree that 2. is a safe check without too much risk to trigger a
false positive (and the tip of origin/master is reachable from
origin/master, so we do not have to single out "is the tip").

On the other hand, 1. may be good in training wheel mode, but once
you start allowing amends and rebases, I do not see why it should be
considered possibly bad as long as check 2. says it is OK to rewrite.

> At least (1) would have saved myself from mistakes that take time and
> effort to clean up (I have used Git for eight years or so already, and
> I *still* do that kind of mistake every now and then).

Isn't your friend reflog helping you to clean things up?  The
difference between the state before you started amending and the
current state is what you did since then, so...?
--
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]