git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git commit --amend safety check?
@ 2015-03-11  4:31 Shawn Pearce
  2015-03-11  5:11 ` Junio C Hamano
  0 siblings, 1 reply; 8+ messages in thread
From: Shawn Pearce @ 2015-03-11  4:31 UTC (permalink / raw)
  To: git

We keep seeing reports of Gerrit Code Review users who incorrectly do
something like:

  git clone URL foo
  cd foo
  git commit --amend -m "My first change!" -a
  git push URL HEAD:refs/for/master

Step #3 is where they get into trouble. They just amended the
published tip commit and pushed it back to the server. That is... lets
just say not good.

Hg is known to be more user friendly. One way its user friendly is it
by default refuses to let you amend a change set that the client has
reasonable assertion to believe was already published through a remote
repository.

For Git that would mean `commit --amend` refusing to amend (by
default) if the commit is reachable from a refs/remotes/... tracking
branch.

Thoughts?

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-03-11 17:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).