{"thread":{"id":"42591","subject":"merge committing staged deletions?","startedAt":"2016-06-16T06:55:51Z","lastAt":"2016-06-16T06:55:51Z","messageCount":1,"participants":["Joey Hess"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"289158","messageId":"20160613181308.GA31546@kitenet.net","threadId":"42591","inReplyTo":null,"subject":"merge committing staged deletions?","fromName":"Joey Hess","fromEmail":"id@joeyh.name","sentAt":"2016-06-13T18:13:08Z","receivedAt":"2016-06-16T06:55:51Z","isPatch":false,"sender":{"key":"id@joeyh.name","avatar":"https://avatars.githubusercontent.com/u/16392?v=4"},"body":"I have a case where git merge seems to include staged deletions into the\nmerge commit. This seems pretty surprising, dunno if it's a bug.\n\njoey@darkstar:~/tmp/x/1>git rm 1 foo\njoey@darkstar:~/tmp/x/1>git status\nOn branch master\nChanges to be committed:\n  (use \"git reset HEAD <file>...\" to unstage)\n\n\tdeleted:    1\n\tdeleted:    foo\njoey@darkstar:~/tmp/x/1>git merge refs/heads/synced/master --no-ff\nAlready up-to-date!\nMerge made by the 'recursive' strategy.\n 1   | 1 -\n foo | 1 -\n 2 files changed, 2 deletions(-)\n delete mode 100644 1\n delete mode 100644 foo\n\nI thought that a merge would leave staged changes alone, unless\nthey conflict in some way with the changes merged in. \nSo why is merge looking at the staged deletions in this case?\n\nI'm using --no-ff because the commit being merged is itself a merge\nof HEAD and another commit. HEAD and the commit being merged in fact\nhave the same tree, so the right merge solution, AFAICS, would be to\nkeep that tree.\n\nI've attached a 1 kb git bundle that you can clone to reproduce this:\n\n\tgit clone bundle b\n\tcd b\n\tgit rm 1\n\tgit merge remotes/origin/synced/master --no-ff\n\ngit version 2.8.1\n\n-- \nsee shy jo\n"}]}