{"thread":{"id":"26712","subject":"git diff-index and both deleted conflict","startedAt":"2011-03-11T16:47:55Z","lastAt":"2011-03-11T17:28:20Z","messageCount":2,"participants":["Dmitry Pavlenko","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"163237","messageId":"201103111947.55412.dmit10@mail.ru","threadId":"26712","inReplyTo":null,"subject":"git diff-index and both deleted conflict","fromName":"Dmitry Pavlenko","fromEmail":"dmit10@mail.ru","sentAt":"2011-03-11T16:47:55Z","receivedAt":"2011-03-11T16:47:55Z","isPatch":false,"sender":{"key":"dmit10@mail.ru","avatar":null},"body":"Hello all,\n\nCould you advise me the fastest way to check in my script \nthat there's \"no local changes in the repository (in the working tree and \nindex)\" so that I could perform \"git rebase\" there?\n\ngit svn dcommit\" should check for the same because it performs rebase.\n\"git svn dcommit\" calls \"git diff-index HEAD\".\n\nAccording to the documentation \"git diff-index HEAD\" performs the check I need. \nBut I've discovered that in the case of \"both deleted\" conflict \"git diff-index \nHEAD\" outputs nothing but rebase still doesn't want to run. \n\nSo, at least either \"git diff-index HEAD\" or its documentation and \"git-svn\" \nshould be fixed, I think.\n\nAnd I'm still asking for the fastest method that could predict that working \ntree and index are clean, no conflict, and I can run \"git rebase\".\n\n\nA simple script to generate \"both deleted\":\n\n#!/bin/sh\n\ngit init\ntouch foo\ngit add foo\ngit commit -m 'initial commit'\ngit checkout -b tmp\ngit mv foo X\ngit commit -m 'rename to X'\ngit checkout -\ngit mv foo Y\ngit commit -m 'rename to Y'\ngit merge tmp\ngit add Y\ngit rm X\n"},{"id":"163238","messageId":"7vlj0lzhvv.fsf@alter.siamese.dyndns.org","threadId":"26712","inReplyTo":"201103111947.55412.dmit10@mail.ru","subject":"Re: git diff-index and both deleted conflict","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-03-11T17:28:20Z","receivedAt":"2011-03-11T17:28:20Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Dmitry Pavlenko <dmit10@mail.ru> writes:\n\n> that there's \"no local changes in the repository (in the working tree and \n> index)\" so that I could perform \"git rebase\" there?\n\nThere is a code that lets \"git rebase\" decide if it can run in the\nsource.  Look for require_clean_work_tree in git-sh-setup.sh\n"}]}