git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* merge committing staged deletions?
@ 2016-06-13 18:13 Joey Hess
  0 siblings, 0 replies; only message in thread
From: Joey Hess @ 2016-06-13 18:13 UTC (permalink / raw)
  To: git

[-- 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 --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-06-13 18:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-13 18:13 merge committing staged deletions? Joey Hess

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).