Subject: Git-SVN on Cygwin 1.7: git svn rebase b0rks index if not run from top-level directory

From: Matthias Andree <[email-masked]>
Date: Wed, 21 Apr 2010 18:56:07 +0200

Greetings,

Looking for help - I have some issues with git-svn as of git version
1.7.1.rc1.12.ga601 on Cygwin 1.7.5 w/ Windows 7 32-bit professional German, but
this has been going on for a while now, but I hadn't figured how to reproduce.

=== Symptoms ===

When I run "git svn rebase" (trace below) *from a working directory somewhere
deep in the checkout,* the index gets dirty.

git diff-index HEAD then shows a massive amount of files that were to be updated:

$ git diff-index HEAD
:100644 100644 faba562f37df8f4a308594b9b867470507229292
0000000000000000000000000000000000000000 M      .project
:100644 100644 0184158eda0e3787d5d29e1f23a6809ed3e4b54c
0000000000000000000000000000000000000000 M      README.txt
:100644 100644 d00be041aecaf00e2c3e7358911a6e5d493e9e7f
0000000000000000000000000000000000000000 M      docs/.gitignore
:100644 100644 bed116f07ba5742e6ed344553008c262656020c7
0000000000000000000000000000000000000000 M      docs/d3.3/.gitignore
[...]

This is always 100644 100644 SHA1 000...000 M filename.

=== Impact ===

- Several parts of git then show bogus local changes, for instance, gitk.

- git svn dcommit aborts because it believes the index were dirty

=== Workarounds ===

Either is sufficient:

1. cd to top-level directory before running git-svn

2. git update-index --refresh

=== Reproduce ===

1. Use a git-svn checkout that has at least one subdirectory

2. cd to that subdirectory

3. run git svn rebase. It concludes successfully, then:

4. git diff-index HEAD -> output like the one shown above.

=== Trace ===

trace: exec: 'git-svn' 'rebase'
trace: run_command: 'git-svn' 'rebase'
trace: built-in: git 'rev-parse' '--show-cdup'
trace: built-in: git 'config' '--bool' '--get' 'svn.fetchall'
trace: built-in: git 'config' '--bool' '--get' 'svn.noauthcache'
trace: built-in: git 'config' '--bool' '--get' 'svn.nocheckout'
trace: built-in: git 'config' '--get' 'svn.authorsprog'
trace: built-in: git 'config' '--bool' '--get' 'svn.dryrun'
trace: built-in: git 'config' '--bool' '--get' 'svn.followparent'
trace: built-in: git 'config' '--bool' '--get' 'svn.useSvmProps'
trace: built-in: git 'config' '--get' 'svn.authorsfile'
trace: built-in: git 'config' '--get' 'svn.repackflags'
trace: built-in: git 'config' '--bool' '--get' 'svn.localtime'
trace: built-in: git 'config' '--get' 'svn.username'
trace: built-in: git 'config' '--int' '--get' 'svn.repack'
trace: built-in: git 'config' '--get' 'svn.ignorepaths'
trace: built-in: git 'config' '--bool' '--get' 'svn.quiet'
trace: built-in: git 'config' '--bool' '--get' 'svn.verbose'
trace: built-in: git 'config' '--int' '--get' 'svn.logwindowsize'
trace: built-in: git 'config' '--get' 'svn.configdir'
trace: built-in: git 'config' '--bool' '--get' 'svn.merge'
trace: built-in: git 'config' '--bool' '--get' 'svn.addauthorfrom'
trace: built-in: git 'config' '--bool' '--get' 'svn.useSvnsyncProps'
trace: built-in: git 'config' '--bool' '--get' 'svn.noMetadata'
trace: built-in: git 'config' '--bool' '--get' 'svn.local'
trace: built-in: git 'config' '--get' 'svn.strategy'
trace: built-in: git 'config' '--bool' '--get' 'svn.uselogauthor'
trace: built-in: git 'rev-parse' '--symbolic' '--all'
trace: built-in: git 'config' '-l'
trace: built-in: git 'config' '-l'
trace: built-in: git 'update-index' '--refresh'
trace: built-in: git 'log' '--no-color' '--first-parent' '--pretty=medium' 'HEAD'
trace: built-in: git 'config' '--bool' 'svn.useSvmProps'
trace: built-in: git 'config' '-l'
trace: built-in: git 'for-each-ref' '--format=%(refname)' 'refs/'
trace: built-in: git 'for-each-ref' '--format=%(refname)' 'refs/'
trace: built-in: git 'config' '--get' 'svn-remote.svn.rewriteRoot'
trace: built-in: git 'config' '--get' 'svn-remote.svn.url'
trace: built-in: git 'config' '--get' 'svn-remote.svn.uuid'
trace: built-in: git 'rev-list' '--pretty=raw' '--no-color' '--reverse'
'thesamehashthatwasreplacedforprivacy..refs/remotes/trunk' '--'
trace: built-in: git 'config' '--get' 'svn-remote.svn.rewriteRoot'
trace: built-in: git 'config' '--get' 'svn-remote.svn.rewriteUUID'
trace: built-in: git 'diff-index' 'HEAD' '--'
trace: built-in: git 'config' '--get' 'svn-remote.svn.usesvmprops'
trace: built-in: git 'config' '--get' 'svn-remote.svn.nometadata'
trace: built-in: git 'cat-file' 'commit' 'thesamehashthatwasreplacedforprivacy'
trace: built-in: git 'config' 'svn-remote.svn.reposRoot'
'svn+ssh://scm.gforge.inria.fr/svn/PROJECT'
trace: built-in: git 'rev-list' '--pretty=raw' '--no-color' '--reverse'
'thesamehashthatwasreplacedforprivacy..refs/remotes/trunk' '--'
trace: built-in: git 'config' 'svn-remote.svn.reposRoot'
'svn+ssh://scm.gforge.inria.fr/svn/PROJECT'
trace: exec: 'git-rebase' 'refs/remotes/trunk'
trace: run_command: 'git-rebase' 'refs/remotes/trunk'
trace: built-in: git 'rev-parse' '--git-dir'
trace: built-in: git 'rev-parse' '--show-toplevel'
trace: built-in: git 'config' '--bool' 'rebase.stat'
trace: built-in: git 'update-index' '--ignore-submodules' '--refresh'
trace: built-in: git 'diff-index' '--cached' '--name-status' '-r'
'--ignore-submodules' 'HEAD' '--'
trace: built-in: git 'rev-parse' '--verify' 'refs/remotes/trunk^0'
trace: built-in: git 'rev-parse' '--verify' 'refs/remotes/trunk^0'
trace: built-in: git 'symbolic-ref' 'HEAD'
trace: built-in: git 'symbolic-ref' '-q' 'HEAD'
trace: built-in: git 'rev-parse' '--verify' 'master^0'
trace: built-in: git 'merge-base' 'thesamehashthatwasreplacedforprivacy'
'thesamehashthatwasreplacedforprivacy'
trace: built-in: git 'rev-list' '--parents'
'thesamehashthatwasreplacedforprivacy..thesamehashthatwasreplacedforprivacy'
Current branch master is up to date.

-- 
Matthias Andree