git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Angelo Borsotti <angelo.borsotti@gmail.com>
To: git <git@vger.kernel.org>
Subject: merge --squash strange error
Date: Mon, 29 Oct 2012 14:37:00 +0100	[thread overview]
Message-ID: <CAB9Jk9DSrvsOp8++q87y6oMVrTSNcKyoM_vKJyWih96y4tG+fg@mail.gmail.com> (raw)

Hello,

I have got a case in which merge --squash issues an error that does
not exist. I hope I am wrong, though.
Consider the following example:

rm -rf public.git
rm -rf private
git init --bare public.git
git clone public.git private
cd private
touch f1; git add f1; git commit -m A
git checkout -b b1
touch f2; git add f2; git commit -m B
git checkout master
git checkout -b b2
touch f3; git add f3; git commit -m C
git checkout master
git checkout -b b3
touch f4; git add f4; git commit -m D

--- at this point we have

     A (f1)             master
      |--B (f1,f2)     b1
      |--C (f1,f3)     b2
      `--D (f1,f4)     *b3

git merge --squash b1
git merge --squash b2

The first merge adds f2 to the workspace, which then contains f1, f2 and f4.
The second merge should add f3, and instead it complains:

error: Your local changes to the following files would be overwritten by merge:
        f2
Please, commit your changes or stash them before you can merge.
Aborting

Why should it overwrite f2, and with what?

-Angelo

                 reply	other threads:[~2012-10-29 13:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=CAB9Jk9DSrvsOp8++q87y6oMVrTSNcKyoM_vKJyWih96y4tG+fg@mail.gmail.com \
    --to=angelo.borsotti@gmail.com \
    --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).