git/list[1] front-page[2] threads[3] people[4] search[5] about
 

git diff-index and both deleted conflict

From
DPDmitry Pavlenko <dmit10@mail.ru>
Date
Mar 11, 2011, 16:47 UTC
Message-ID
<201103111947.55412.dmit10@mail.ru>
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

Next: Junio C Hamano
Message 1 of 2 in “git diff-index and both deleted conflict”
  1. Dmitry PavlenkoMar 11, 2011
  2. Junio C HamanoMar 11, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.