From: Junio C Hamano <gitster@pobox.com>
To: Peter Krefting <peter@softwolves.pp.se>
Cc: Shawn Pearce <spearce@spearce.org>, git <git@vger.kernel.org>
Subject: Re: git commit --amend safety check?
Date: Wed, 11 Mar 2015 10:56:20 -0700 [thread overview]
Message-ID: <xmqq1tkv770b.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1503110931100.26355@ds9.cixit.se> (Peter Krefting's message of "Wed, 11 Mar 2015 09:37:09 +0100 (CET)")
Peter Krefting <peter@softwolves.pp.se> 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...?
prev parent reply other threads:[~2015-03-11 17:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-11 4:31 git commit --amend safety check? Shawn Pearce
2015-03-11 5:11 ` Junio C Hamano
2015-03-11 6:00 ` Shawn Pearce
2015-03-11 6:18 ` Junio C Hamano
2015-03-11 6:33 ` Mike Hommey
2015-03-11 8:13 ` Jeff King
2015-03-11 8:37 ` Peter Krefting
2015-03-11 17:56 ` Junio C Hamano [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqq1tkv770b.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=peter@softwolves.pp.se \
--cc=spearce@spearce.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).