Package: pristine-tar
Version: 1.26
Severity: normal
Tags: patch

Steps to reproduce:
1) Create a git repo with some content.
2) Create another git repo. Add the previous repo as submodule.
3) Enter the directory of the submodule.
4) Attempt to commit a tarball into the submodule and receive the
error message.

Example (reproduced on wheezy with pristine-tar 1.25+deb7u1 and git 
1:1.7.10.4-1+wheezy1):

$ pristine-tar -v commit ../test.tar.gz master
pristine-tar: git archive --format=tar e6318808714baa59b519dee3d581f5936c1d753e 
| (cd '/tmp/pristine-tar.stw_HXnGxj' && tar x)
pristine-tar: mkdir /tmp/pristine-tar.T9LX8g9PZH/workdir
pristine-tar: mv /tmp/pristine-tar.stw_HXnGxj 
/tmp/pristine-tar.T9LX8g9PZH/workdir/testfile
pristine-tar: tar cf /tmp/pristine-tar.T9LX8g9PZH/recreatetarball --owner 0 
--group 0 --numeric-owner -C /tmp/pristine-tar.T9LX8g9PZH/workdir 
--no-recursion --mode 0644 --files-from /tmp/pristine-tar.T9LX8g9PZH/manifest
pristine-tar: pristine-gz -v --no-debug --no-keep gendelta ../test.tar.gz 
/tmp/pristine-tar.Wm8_tWADMQ/wrapper
pristine-gz: gzip -dc < ../test.tar.gz > /tmp/pristine-tar.d6ObZZzgZ5/test
pristine-gz: zgz --gnu -n -F  -T 0 -c < /tmp/pristine-tar.d6ObZZzgZ5/test > 
/tmp/pristine-tar.d6ObZZzgZ5/test.gz
pristine-gz: tar czf /tmp/pristine-tar.Wm8_tWADMQ/wrapper -C 
/tmp/pristine-tar.w18V_Piydg params timestamp filename version type
pristine-tar: tar czf /tmp/pristine-tar.stRVuWe0Cf/tmpout -C 
/tmp/pristine-tar.ed9wGY43vU manifest delta version wrapper type
pristine-tar: cat /tmp/pristine-tar.stRVuWe0Cf/tmpout
pristine-tar: git update-index --add test.tar.gz.delta test.tar.gz.id
error: test.tar.gz.delta: does not exist and --remove not passed
fatal: Unable to process path test.tar.gz.delta
pristine-tar: command failed: git update-index --add test.tar.gz.delta
test.tar.gz.id

Techical explanation of why this fails and how to fix it is in the patch
attached.

-- System Information:
Debian Release: wheezy/sid
  APT prefers raring-updates
  APT policy: (500, 'raring-updates'), (500, 'raring-security'), (500, 
'raring'), (100, 'raring-backports')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.8.0-19-generic (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages pristine-tar depends on:
ii  libbz2-1.0    1.0.6-4
ii  libc6         2.17-0ubuntu5
ii  perl-modules  5.14.2-21
ii  xdelta        1.1.3-9build1
ii  zlib1g        1:1.2.7.dfsg-13ubuntu2

Versions of packages pristine-tar recommends:
ii  bzip2     1.0.6-4
ii  pbzip2    1.1.8-1
ii  xz-utils  5.1.1alpha+20120614-2ubuntu1

pristine-tar suggests no packages.

-- no debconf information
>From be27e4e0fe872741a27800b65961582b66ea6443 Mon Sep 17 00:00:00 2001
From: Victor Vasiliev <vasi...@mit.edu>
Date: Thu, 10 Oct 2013 22:23:15 -0400
Subject: [PATCH] Handle Git submodules correctly

Due to the way submodules are organized in the latest versions of Git,
the working directory in the submodule repository configuration is set
to the relative path of submodule with respect to its physical GIT_DIR
location, instead of default ".". This confuses git-update-index, and
causes `pristine-tar commit' to fail.
---
 pristine-tar | 1 +
 1 file changed, 1 insertion(+)

diff --git a/pristine-tar b/pristine-tar
index 184c657..9005ddb 100755
--- a/pristine-tar
+++ b/pristine-tar
@@ -727,6 +727,7 @@ sub commitdelta {
 		# index, and without touching the working tree. Aka deep 
 		# git magick.
 		$ENV{GIT_INDEX_FILE}="$tempdir/index";
+		$ENV{GIT_WORK_TREE}="$tempdir";
 		if (! exists $ENV{GIT_DIR} || ! length $ENV{GIT_DIR}) {		
 			$ENV{GIT_DIR}=getcwd."/.git";
 		}
-- 
1.8.4

Reply via email to