Comment 4 for bug 514573

Revision history for this message
methane (songofacandy) wrote : Re: unusual_modes drops when a file having unusual mode stays continuing revisions.

I've researched about git, symlink and bzr-git those days.
Something that I found is:

1) git doesn't create executable symlink normally.
"git update-index --chmod=+x" to symlink reports error.
To create executable symlink, I have to do like:
$git ls-tree treeid-without-executable-symlink > tree
$vim tree # change mode from 120000 to 120777
$git mktree <tree
new-tree-id
$git commit-tree new-tree-id -p parent-commit-id

2) bzr-git trunk makes executable symlink.
Maybe after http://bazaar.launchpad.net/~bzr/bzr-git/trunk/revision/703.
I hate my patch creates dirty symlink on many projects.

$ git init
$ mkdir foo
$ cd foo
$ ln -s . foo
$ cd ..
$ bzr add foo
$ bzr commit
$ git ls-tree last-tree-id
shows 120111 mode for symlink.

3) git perfectly works with symlink that have 120777 or 120111 mode.

4) git repository of messagepack project contains 120777 symlink.
git url: git://git.sourceforge.jp/gitroot/msgpack/msgpack.git
browse url: http://git.sourceforge.jp/view?p=msgpack/msgpack.git;a=summary

I've introduced 120777 symlink to messagepack repository on "16a208243b8ef6eadd626876d5224c81e0bda74e" commit.
I've used old bzr-git to make the commit, IIRC.

5) bzr-git fails to dpush to messagepack repo.

$ git clone git://git.sourceforge.jp/gitroot/msgpack/msgpack.git
$ git daemon --export-all --enable=upload-pack --enable=receive-pack --baes-path=.
$ bzr branch git://localhost/msgpack/ mp
$ cd mp
$ rm .bzr/repository/git.db
$ bzr commit --unchanged -m "foo"
$ bzr dpush git://localhost/msgpack/
bzr: ERROR: exceptions.AssertionError: recreated git commit had different sha1: expected c8765c4a8ee44afd0fe8bf05f2a9cbb0638d9ecc, got 15be17f58c0ad2c1f55ea2b357476609d81705e0

"c8765c4a8ee44afd0fe8bf05f2a9cbb0638d9ecc" is the commit with 120777 symlink.
bzr-git creates wrong sha1 because the revision in bzr doesn't contain "file-mode" property.
unusualmode-for-sameinv.patch fixes the problem.