forwarded git bug

This commit is contained in:
Joey Hess 2023-05-02 13:27:04 -04:00
parent 72fb1262a3
commit b90c2156a6
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
3 changed files with 100 additions and 0 deletions

View file

@ -165,3 +165,7 @@ eac97cf master synced/master repo2/synced/master git-annex in repo1
### Have you had any luck using git-annex before? (Sometimes we get tired of reading bug reports all day and a lil' positive end note does wonders)
I have been incorporating git-annex into my backup system for the past year now, and it has been absolutely wonderful to work with.
> Since this is a git bug, and since I don't think there's a reasonable
> workaround in git-annex, I'm closing this as forwarded to git. [[done]]
> --[[Joey]]

View file

@ -0,0 +1,35 @@
[[!comment format=mdwn
username="joey"
subject="""comment 3"""
date="2023-05-02T16:44:03Z"
content="""
Here's a simplified test case that does not use `git-annex sync` but still
uses git-annex.
#!/bin/sh
git init repo1
cd repo1
git-annex init
git commit --allow-empty -m foo
git remote add repo2 ../repo2
cd ..
git clone repo1 repo2
cd repo2
git remote add repo1 ../repo1
cd ..
cd repo1
touch emptyfile
git-annex add
git-annex unlock
git commit -m add
cd ../repo2
git pull
echo repo2 line > testfile
git-annex add
git commit -m add
cd ../repo1
echo repo1 line > testfile
git-annex add
git commit -m foo
git pull repo2 master
"""]]

View file

@ -0,0 +1,61 @@
[[!comment format=mdwn
username="joey"
subject="""comment 4"""
date="2023-05-02T16:56:12Z"
content="""
This is a git bug. The test case below does not use git-annex, but causes the
same merge problem.
I've reported the bug to the git developers
<https://lore.kernel.org/git/ZFFGi9i7JGL9xNx5@kitenet.net/T/#u>
#!/bin/bash
setup_smudge_clean() {
cat <<'EOF' > .git/test-clean
#!/bin/sh
mkdir -p ../content
cat > ../content/new.content
v=$(sha1sum ../content/new.content | cut -d ' ' -f 1)
mv ../content/new.content ../content/$v.content
echo "$v"
EOF
cat <<'EOF' > .git/test-smudge
#!/bin/sh
v=$(cat)
cat ../content/$v.content
EOF
chmod +x .git/test-clean
chmod +x .git/test-smudge
git config filter.foo.smudge .git/test-smudge
git config filter.foo.clean .git/test-clean
echo "* filter=foo" > .git/info/attributes
}
git init repo1
cd repo1
setup_smudge_clean
git commit --allow-empty -m foo
git remote add repo2 ../repo2
cd ..
git clone repo1 repo2
cd repo2
git remote add repo1 ../repo1
setup_smudge_clean
cd ..
cd repo1
touch emptyfile
git add emptyfile
git commit -m add
cd ../repo2
git pull
echo foo > testfile
git add testfile
git commit -m foo
cd ../repo1
echo bar > testfile
git add testfile
git commit -m bar
git pull repo2 master
"""]]