From: Joey Hess <id@joeyh.name>
To: git@vger.kernel.org
Subject: merge committing staged deletions?
Date: Mon, 13 Jun 2016 14:13:08 -0400 [thread overview]
Message-ID: <20160613181308.GA31546@kitenet.net> (raw)
[-- Attachment #1: Type: text/plain, Size: 1156 bytes --]
I have a case where git merge seems to include staged deletions into the
merge commit. This seems pretty surprising, dunno if it's a bug.
joey@darkstar:~/tmp/x/1>git rm 1 foo
joey@darkstar:~/tmp/x/1>git status
On branch master
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
deleted: 1
deleted: foo
joey@darkstar:~/tmp/x/1>git merge refs/heads/synced/master --no-ff
Already up-to-date!
Merge made by the 'recursive' strategy.
1 | 1 -
foo | 1 -
2 files changed, 2 deletions(-)
delete mode 100644 1
delete mode 100644 foo
I thought that a merge would leave staged changes alone, unless
they conflict in some way with the changes merged in.
So why is merge looking at the staged deletions in this case?
I'm using --no-ff because the commit being merged is itself a merge
of HEAD and another commit. HEAD and the commit being merged in fact
have the same tree, so the right merge solution, AFAICS, would be to
keep that tree.
I've attached a 1 kb git bundle that you can clone to reproduce this:
git clone bundle b
cd b
git rm 1
git merge remotes/origin/synced/master --no-ff
git version 2.8.1
--
see shy jo
[-- Attachment #2: bundle --]
[-- Type: application/octet-stream, Size: 1113 bytes --]
reply other threads:[~2016-06-13 18:13 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160613181308.GA31546@kitenet.net \
--to=id@joeyh.name \
--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.
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).