git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: James Blackburn <jamesblackburn@gmail.com>
To: git@vger.kernel.org
Subject: Cannot rewrite branch(es) with a dirty working directory
Date: Thu, 1 Sep 2011 16:52:02 +0100	[thread overview]
Message-ID: <CACyv8dfL-G0Px0aFe3VFNHP-1xRUDLsFxgUu3amPGzO7qKp7jQ@mail.gmail.com> (raw)

Hi All,

I get a spurious:
"Cannot rewrite branch(es) with a dirty working directory."
trying to filter-branch in a clean git repo (having done a reset). The
error disappears when I do git status.

Log of the shell commands:
bash:jamesb:xl-cbga-20:33083> mkdir org.eclipse.cdt.core.linux.ia64
bash:jamesb:xl-cbga-20:33084> cp -r
../../../CDT_HEAD_GIT/org.eclipse.cdt/.git
org.eclipse.cdt.core.linux.ia64/
bash:jamesb:xl-cbga-20:33085> cd org.eclipse.cdt.core.linux.ia64/
mbash:jamesb:xl-cbga-20:33086> git reset --hard
Checking out files: 100% (11879/11879), done.
HEAD is now at a03d454 Build against a local mirror of the 3.7 p2 repo
bash:jamesb:xl-cbga-20:33087> git filter-branch --subdirectory-filter
core/org.eclipse.cdt.core.linux.ia64 -- master
Cannot rewrite branch(es) with a dirty working directory.
bash:jamesb:xl-cbga-20:33088> git status
# On branch master
nothing to commit (working directory clean)
bash:jamesb:xl-cbga-20:33089> git filter-branch --subdirectory-filter
core/org.eclipse.cdt.core.linux.ia64 -- master
Rewrite d7092b12c93925f6f7c4725a5abc72e55650621c (16/16)
Ref 'refs/heads/master' was rewritten
bash:jamesb:xl-cbga-20:33090> git --version
git version 1.7.3.2

Is there a particular reason why filter-branch thinks the tree is
dirty, and status magically fixes this?

Cheers,
James

             reply	other threads:[~2011-09-01 15:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-01 15:52 James Blackburn [this message]
2011-09-01 17:14 ` Cannot rewrite branch(es) with a dirty working directory Matthieu Moy
2011-09-01 21:50   ` Jeff King
2011-09-01 21:53     ` Jeff King
2011-09-02  5:52       ` Matthieu Moy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CACyv8dfL-G0Px0aFe3VFNHP-1xRUDLsFxgUu3amPGzO7qKp7jQ@mail.gmail.com \
    --to=jamesblackburn@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).