git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git diff-index and both deleted conflict
@ 2011-03-11 16:47 Dmitry Pavlenko
  2011-03-11 17:28 ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Pavlenko @ 2011-03-11 16:47 UTC (permalink / raw)
  To: git

Hello all,

Could you advise me the fastest way to check in my script 
that there's "no local changes in the repository (in the working tree and 
index)" so that I could perform "git rebase" there?

git svn dcommit" should check for the same because it performs rebase.
"git svn dcommit" calls "git diff-index HEAD".

According to the documentation "git diff-index HEAD" performs the check I need. 
But I've discovered that in the case of "both deleted" conflict "git diff-index 
HEAD" outputs nothing but rebase still doesn't want to run. 

So, at least either "git diff-index HEAD" or its documentation and "git-svn" 
should be fixed, I think.

And I'm still asking for the fastest method that could predict that working 
tree and index are clean, no conflict, and I can run "git rebase".


A simple script to generate "both deleted":

#!/bin/sh

git init
touch foo
git add foo
git commit -m 'initial commit'
git checkout -b tmp
git mv foo X
git commit -m 'rename to X'
git checkout -
git mv foo Y
git commit -m 'rename to Y'
git merge tmp
git add Y
git rm X

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: git diff-index and both deleted conflict
  2011-03-11 16:47 git diff-index and both deleted conflict Dmitry Pavlenko
@ 2011-03-11 17:28 ` Junio C Hamano
  0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2011-03-11 17:28 UTC (permalink / raw)
  To: Dmitry Pavlenko; +Cc: git

Dmitry Pavlenko <dmit10@mail.ru> writes:

> that there's "no local changes in the repository (in the working tree and 
> index)" so that I could perform "git rebase" there?

There is a code that lets "git rebase" decide if it can run in the
source.  Look for require_clean_work_tree in git-sh-setup.sh

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-03-11 17:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-11 16:47 git diff-index and both deleted conflict Dmitry Pavlenko
2011-03-11 17:28 ` Junio C Hamano

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