git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Sandro Santilli <strk@keybit.net>
To: git@vger.kernel.org
Subject: preventing evil merges
Date: Thu, 30 May 2013 18:34:59 +0200	[thread overview]
Message-ID: <20130530163459.GI31679@gnash> (raw)

Hey all,
I've be burnt by what someone on IRC referred to as "evil merges",
that is loss of history after amending a merge commit:

 git merge anotherbranch
 git add something
 git commit --amend

After the steps above the addition of "something" can't be found in
the history anymore, but the file is there. Moreover (I think but
didn't try to reproruce) a further rebase to a common ancestore of
my working branch and "anotherbranch" resulted in further loss of
the changes. The only way for me to get them back has been by 
checking out from reflog.

I've no idea about what was going on but this experience reminded me
of another one I had in the past in which we could not figure out when
some changes were added into a repository (!).

If amending a merge is so dangerous, would it make sense to require
and hard-to-type switch in order for it to really do anything ?

--strk; 

             reply	other threads:[~2013-05-30 16:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-30 16:34 Sandro Santilli [this message]
2013-06-03 17:20 ` preventing evil merges Junio C Hamano
2013-06-03 17:37   ` Antoine Pelisse

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130530163459.GI31679@gnash \
    --to=strk@keybit.net \
    --cc=git@vger.kernel.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).