Package: pristine-tar
Version: 1.25
In the current version of git, the "git submodule" commands create
submodule repos which do not have .git subdirectories, but instead
have .git files which contain text with a redirection pointer.
This causes "pristine-tar commit" to fail rather mysteriously when it
tries to access files in .git/* directly. The pristine-tar program
really should be using the appropriate git commands instead.
The "right" way to find the true git subdirectory, following textual
redirects etc, is:
git rev-parse --git-dir
If not inside a git repo this will give an error status, so it is also
a good way to check if you're inside a git repo.
I should say that "pristine-tar checkout" works even when
"pristine-tar commit" does not, so this is a pretty easy problem to
work around: just make a non-submodule clone of the repo in question,
"pristine-tar commit" there, and push the pristine-tar branch back
into the submodule.
Below:
- example of non-directory .git in submodule
- example pristine-tar commit failure in said repo
- example of how a user can work around problem
(The last of these three is provided for other users who come across
this problem and find this bug report.)
Cheers,
--Barak.
--
Barak A. Pearlmutter
Hamilton Institute & Dept Comp Sci, NUI Maynooth, Co. Kildare, Ireland
http://www.bcl.hamilton.ie/~barak/
----------------------------------------------------------------
~/tmp $ echo SHOW THAT GIT SUBMODULES HAVE PLAIN .git FILE
SHOW THAT GIT SUBMODULES HAVE PLAIN .git FILE
~/tmp $ git init foo
Initialized empty Git repository in /var/tmp/barak/tmp/foo/.git/
~/tmp $ cd foo
~/tmp/foo $ echo FOO > fu
~/tmp/foo $ git add fu
~/tmp/foo $ git commit -m 'kung fu'
[master (root-commit) c07cc51] kung fu
1 file changed, 1 insertion(+)
create mode 100644 fu
~/tmp/foo $ git submodule add git://github.com/barak/auto6to4.git
Cloning into 'auto6to4'...
remote: Counting objects: 126, done.
remote: Compressing objects: 100% (107/107), done.
remote: Total 126 (delta 50), reused 53 (delta 10)
Receiving objects: 100% (126/126), 24.11 KiB, done.
Resolving deltas: 100% (50/50), done.
~/tmp/foo $ cd auto6to4/
~/tmp/foo/auto6to4 $ ls -lA
total 32
-rwxrwxr-x 1 barak barak 8986 Jul 12 09:54 auto6to4
drwxrwxr-x 3 barak barak 4096 Jul 12 09:54 debian
-rw-rw-r-- 1 barak barak 33 Jul 12 09:54 .git
-rw-rw-r-- 1 barak barak 12 Jul 12 09:54 .gitignore
-rw-rw-r-- 1 barak barak 998 Jul 12 09:54 Makefile
-rw-rw-r-- 1 barak barak 2511 Jul 12 09:54 README
~/tmp/foo/auto6to4 $ cat .git
gitdir: ../.git/modules/auto6to4
~/tmp/foo/auto6to4 $ ls -l ../.git/modules/auto6to4/
total 44
drwxrwxr-x 2 barak barak 4096 Jul 12 09:54 branches
-rw-rw-r-- 1 barak barak 290 Jul 12 09:54 config
-rw-rw-r-- 1 barak barak 73 Jul 12 09:54 description
-rw-rw-r-- 1 barak barak 23 Jul 12 09:54 HEAD
drwxrwxr-x 2 barak barak 4096 Jul 12 09:54 hooks
-rw-rw-r-- 1 barak barak 1336 Jul 12 09:54 index
drwxrwxr-x 2 barak barak 4096 Jul 12 09:54 info
drwxrwxr-x 3 barak barak 4096 Jul 12 09:54 logs
drwxrwxr-x 4 barak barak 4096 Jul 12 09:54 objects
-rw-rw-r-- 1 barak barak 710 Jul 12 09:54 packed-refs
drwxrwxr-x 5 barak barak 4096 Jul 12 09:54 refs
~/tmp/foo/auto6to4 $ cat ../.git/modules/auto6to4/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
worktree = ../../../auto6to4
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = git://github.com/barak/auto6to4.git
[branch "master"]
remote = origin
merge = refs/heads/master
~/tmp/foo/auto6to4 $ echo SHOW pristine-tar commit COMMAND FAILING
SHOW pristine-tar commit COMMAND FAILING
~/tmp/foo/auto6to4 $ git tag upstream/1.20.1 origin/upstream
~/tmp/foo/auto6to4 $ git archive --format=tgz --prefix=auto6to4-1.20.1/
--output ../auto6to4_1.20.1.orig.tar.gz upstream/1.20.1
~/tmp/foo/auto6to4 $ pristine-tar commit ../auto6to4_1.20.1.orig.tar.gz
upstream/1.20.1
Branch pristine-tar set up to track remote branch pristine-tar from origin.
error: auto6to4_1.20.1.orig.tar.gz.delta: does not exist and --remove not passed
fatal: Unable to process path auto6to4_1.20.1.orig.tar.gz.delta
pristine-tar: command failed: git update-index --add
auto6to4_1.20.1.orig.tar.gz.delta auto6to4_1.20.1.orig.tar.gz.id
~/tmp/foo/auto6to4 $ echo SHOW HOW TO WORK AROUND THIS PROBLEM
SHOW HOW TO WORK AROUND THIS PROBLEM
~/tmp/foo/auto6to4 $ cd ../..
~/tmp $ git clone foo/auto6to4
Cloning into 'auto6to4'...
done.
~/tmp $ cd auto6to4/
~/tmp/auto6to4 $ ls -lA
total 32
-rwxrwxr-x 1 barak barak 8986 Jul 12 09:59 auto6to4
drwxrwxr-x 3 barak barak 4096 Jul 12 09:59 debian
drwxrwxr-x 8 barak barak 4096 Jul 12 09:59 .git
-rw-rw-r-- 1 barak barak 12 Jul 12 09:59 .gitignore
-rw-rw-r-- 1 barak barak 998 Jul 12 09:59 Makefile
-rw-rw-r-- 1 barak barak 2511 Jul 12 09:59 README
~/tmp/auto6to4 $ ls -l .git
total 44
drwxrwxr-x 2 barak barak 4096 Jul 12 09:59 branches
-rw-rw-r-- 1 barak barak 253 Jul 12 09:59 config
-rw-rw-r-- 1 barak barak 73 Jul 12 09:59 description
-rw-rw-r-- 1 barak barak 23 Jul 12 09:59 HEAD
drwxrwxr-x 2 barak barak 4096 Jul 12 09:59 hooks
-rw-rw-r-- 1 barak barak 1336 Jul 12 09:59 index
drwxrwxr-x 2 barak barak 4096 Jul 12 09:59 info
drwxrwxr-x 3 barak barak 4096 Jul 12 09:59 logs
drwxrwxr-x 4 barak barak 4096 Jul 12 09:59 objects
-rw-rw-r-- 1 barak barak 566 Jul 12 09:59 packed-refs
drwxrwxr-x 5 barak barak 4096 Jul 12 09:59 refs
~/tmp/auto6to4 $ cat .git/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = /home/barak/tmp/foo/auto6to4
[branch "master"]
remote = origin
merge = refs/heads/master
~/tmp/auto6to4 $ pristine-tar commit ../foo/auto6to4_1.20.1.orig.tar.gz
upstream/1.20.1
~/tmp/auto6to4 $ git push origin pristine-tar
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]