git: unusual_modes drops when a file having unusual mode stays continuing revisions.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| Bazaar Git Plugin |
Low
|
Unassigned | ||
| Breezy |
Low
|
Unassigned |
Bug Description
bzr-git stores unusual_mode into bzr's revision when inventory delta contains unusual modes.
But when rev1 have a file with unusual mode and rev2 have same file, the file is not in inventory delta.
So recreated git tree of rev2 missing unusual mode.
Related branches
- Bazaar Developers: Pending requested 2010-02-09
-
Diff: 92 lines (+34/-8)2 files modifiedfetch.py (+15/-8)
tests/test_fetch.py (+19/-0)
INADA Naoki (songofacandy) wrote : | #1 |
Jelmer Vernooij (jelmer) wrote : Re: [Bug 514573] [NEW] unusual_modes drops when a file having unusual mode stays continuing revisions. | #2 |
I'm not convinced this is actually an issue. Can you please provide a
test case for this?
INADA Naoki (songofacandy) wrote : Re: [Bug 514573] [NEW] unusual_modes drops when a file having unusual mode stays continuing revisions. | #3 |
I've dpush with bzr-git in some months ago and such a strange revision created.
In http://
lrwxrwxrwx mode:
git fsck --all doesn't report an error.
bzr-git reports sha1 mismatch when dpushing to the repository.
My patch fixes sha1.
INADA Naoki (songofacandy) wrote : Re: unusual_modes drops when a file having unusual mode stays continuing revisions. | #4 |
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-
$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://
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.
browse url: http://
I've introduced 120777 symlink to messagepack repository on "16a208243b8ef6
I've used old bzr-git to make the commit, IIRC.
5) bzr-git fails to dpush to messagepack repo.
$ git clone git://git.
$ git daemon --export-all --enable=
$ bzr branch git://localhost
$ cd mp
$ rm .bzr/repository
$ bzr commit --unchanged -m "foo"
$ bzr dpush git://localhost
bzr: ERROR: exceptions.
"c8765c4a8ee44a
bzr-git creates wrong sha1 because the revision in bzr doesn't contain "file-mode" property.
unusualmode-
INADA Naoki (songofacandy) wrote : | #5 |
I've created a minimum testcase.
To reproduce the bug is:
1) create test git repository (attached gzip contains this)
inada-n@
inada-n@
/home/inada-
inada-n@
Initialized empty Git repository in /home/inada-
inada-n@
inada-n@
inada-n@
[master (root-commit) ca3de8b] add foo
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 120000 foo
inada-n@
ca3de8bc2a701da
inada-n@
120000 blob 945c9b46d684f08
inada-n@
inada-n@
inada-n@
c7b0af5a3a158d8
inada-n@
120777 blob 945c9b46d684f08
inada-n@
912fbbb93aa5121
inada-n@
7b413dc8152fd1a
inada-n@
inada-n@
commit 7b413dc8152fd1a
Author: Naoki INADA <email address hidden>
Date: Tue Feb 2 09:28:42 2010 +0900
change mode take2
commit 912fbbb93aa5121
Author: Naoki INADA <email address hidden>
Date: Tue Feb 2 09:28:15 2010 +0900
change mode
commit ca3de8bc2a701da
Author: Naoki INADA <email address hidden>
Date: Tue Feb 2 09:26:05 2010 +0900
add foo
2)Make empty git repository and run git daemon.
$ cd ..
$ mkdir baz
$ cd baz
$ git init
$ cd ..
$ $ git daemon --export-all --enable=
3) branch with bzr-git
inada-n@
/ Counting objects: 6, done.
Branched 3 revision(s).
inada-n@
/home/inada-
inada-n@
inada-n@
bzr: ERROR: exceptions.
Jelmer Vernooij (jelmer) wrote : Re: [Bug 514573] Re: unusual_modes drops when a file having unusual mode stays continuing revisions. | #6 |
Can you format this as a test that can go into tests/ ?
If not, that's fine too - it will mean some more delay before your
change can land though, as I need the time to do it.
INADA Naoki (songofacandy) wrote : Re: unusual_modes drops when a file having unusual mode stays continuing revisions. | #7 |
I failed to make an unusual mode with GitBranchBuilder, because git fast-import rejects unusual mode...
Could you make it with dulwich? Or can I use external git repository for the test?
BTW, I'm less sure than before about bzr-git should support unusual modes.
I can fix msgpack repository with git fast-export & fast-import.
Jelmer Vernooij (jelmer) wrote : Re: [Bug 514573] Re: unusual_modes drops when a file having unusual mode stays continuing revisions. | #8 |
On Fri, 2010-02-05 at 05:47 +0000, INADA Naoki wrote:
> I failed to make an unusual mode with GitBranchBuilder, because git fast-import rejects unusual mode...
> Could you make it with dulwich? Or can I use external git repository for the test?
You're welcome to use an existing git repository for the test. Please
keep it as small as possible so that we don't grow the Dulwich source
unnecessarily and so that we can easily debug issues.
> BTW, I'm less sure than before about bzr-git should support unusual modes.
> I can fix msgpack repository with git fast-export & fast-import.
As long as there are git repositories out there that contain unusual
modes we have to support them.
Cheers,
Jelmer
INADA Naoki (songofacandy) wrote : Re: unusual_modes drops when a file having unusual mode stays continuing revisions. | #9 |
I've pushed test repo to github and confirmed test_unusualmode works.
I've made a merge request.
Changed in bzr-git: | |
status: | New → Triaged |
importance: | Undecided → Low |
Changed in brz-git: | |
status: | New → Triaged |
importance: | Undecided → Low |
summary: |
- unusual_modes drops when a file having unusual mode stays continuing - revisions. + git: unusual_modes drops when a file having unusual mode stays + continuing revisions. |
affects: | brz-git → brz |
tags: | added: git |
I don't know well about how bzr stores revisions.
So I tried to fix by store unusual mode even if rev2 doesn't have delta.