Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hangs forever with older git version (1.8.5) #65

Closed
benningm opened this issue Nov 23, 2018 · 6 comments
Closed

Hangs forever with older git version (1.8.5) #65

benningm opened this issue Nov 23, 2018 · 6 comments

Comments

@benningm
Copy link

benningm commented Nov 23, 2018

git-archive-all uses the git check-attr command with -z options which did behave different before this commit:

git/git@f7cd8c5

git-archive-all expects the new behaviour and waits forever in the read on line 373.

Both RHEL/Centos 6 and 7 still use version <= 1.8.3.

@Kentzo
Copy link
Owner

Kentzo commented Nov 26, 2018

Thanks for reporting. Would you be able to help with testing?

@Kentzo
Copy link
Owner

Kentzo commented Nov 26, 2018

Please check version from the issue-65 branch.

Kentzo added a commit that referenced this issue Nov 27, 2018
Kentzo added a commit that referenced this issue Nov 27, 2018
@benningm
Copy link
Author

Works on CentOS 6:

[root@ae62b49a33e1 git-archive-all]# cat /etc/redhat-release 
CentOS release 6.10 (Final)
[root@ae62b49a33e1 git-archive-all]# git --version
git version 1.7.1

On master branch:

[root@ae62b49a33e1 git-archive-all]# git show --oneline
c558c3c Add shield for Homebrew.
[root@ae62b49a33e1 git-archive-all]# ./git_archive_all.py bla.tar.gz
# aborting with ^C after some minutes...
^CTraceback (most recent call last):
  File "./git_archive_all.py", line 499, in <module>
    main()
  File "./git_archive_all.py", line 491, in main
    archiver.create(output_file_path, options.dry_run, compresslevel=options.compresslevel)
  File "./git_archive_all.py", line 195, in create
    self.archive_all_files(archiver)
  File "./git_archive_all.py", line 228, in archive_all_files
    for file_path in self.walk_git_files():
  File "./git_archive_all.py", line 264, in walk_git_files
    if self.is_file_excluded(repo_abspath, repo_file_path):
  File "./git_archive_all.py", line 214, in is_file_excluded
    attrs = self._check_attr_gens[repo_abspath].send(repo_file_path)
  File "./git_archive_all.py", line 400, in check_attr
    for path, attr, value in read_attrs(process, repo_file_path):
  File "./git_archive_all.py", line 373, in read_attrs
    b = process.stdout.read(1)
KeyboardInterrupt

With issue-65 branch:

[root@ae62b49a33e1 git-archive-all]# git checkout issue-65
Branch issue-65 set up to track remote branch issue-65 from origin.
Switched to a new branch 'issue-65'
[root@ae62b49a33e1 git-archive-all]# git log -1 --oneline
40de44f Fix reading attributes on Git < 1.8.5
[root@ae62b49a33e1 git-archive-all]# ./git_archive_all.py bla.tar.gz
[root@ae62b49a33e1 git-archive-all]# tar tzvf bla.tar.gz        
-rw-rw-r-- root/root       860 2018-11-27 09:57 bla/.appveyor.yml
-rw-rw-r-- root/root       122 2018-11-27 09:57 bla/.gitignore
-rw-rw-r-- root/root      4297 2018-11-27 09:57 bla/.travis.yml
-rw-r--r-- root/root      1612 2018-11-27 10:33 bla/CHANGES.rst
-rw-rw-r-- root/root      1063 2018-11-27 09:57 bla/LICENSE.txt
-rw-rw-r-- root/root        13 2018-11-27 09:57 bla/MANIFEST.in
-rw-rw-r-- root/root       385 2018-11-27 09:57 bla/Makefile
-rw-rw-r-- root/root      2419 2018-11-27 09:57 bla/README.rst
-rwxr-xr-x root/root     21328 2018-11-27 10:33 bla/git_archive_all.py
-rw-rw-r-- root/root       126 2018-11-27 09:57 bla/requirements.txt
-rw-rw-r-- root/root      1216 2018-11-27 09:57 bla/setup.cfg
-rw-rw-r-- root/root      1058 2018-11-27 09:57 bla/setup.py
-rw-rw-r-- root/root     12977 2018-11-27 09:57 bla/test_git_archive_all.py

@benningm
Copy link
Author

With CentOS 7:

[root@dd68d8757a9d /]# cat /etc/redhat-release 
CentOS Linux release 7.5.1804 (Core) 
[root@dd68d8757a9d /]# git --version
git version 1.8.3.1

On master:

[root@dd68d8757a9d git-archive-all]# git show --oneline
c558c3c Add shield for Homebrew.
[root@dd68d8757a9d git-archive-all]# ./git_archive_all.py bla.tar.gz
^CTraceback (most recent call last):
  File "./git_archive_all.py", line 499, in <module>
    main()
  File "./git_archive_all.py", line 491, in main
    archiver.create(output_file_path, options.dry_run, compresslevel=options.compresslevel)
  File "./git_archive_all.py", line 195, in create
    self.archive_all_files(archiver)
  File "./git_archive_all.py", line 228, in archive_all_files
    for file_path in self.walk_git_files():
  File "./git_archive_all.py", line 264, in walk_git_files
    if self.is_file_excluded(repo_abspath, repo_file_path):
  File "./git_archive_all.py", line 214, in is_file_excluded
    attrs = self._check_attr_gens[repo_abspath].send(repo_file_path)
  File "./git_archive_all.py", line 400, in check_attr
    for path, attr, value in read_attrs(process, repo_file_path):
  File "./git_archive_all.py", line 373, in read_attrs
    b = process.stdout.read(1)
KeyboardInterrupt

On issue-65 branch:

[root@dd68d8757a9d git-archive-all]# git checkout issue-65
Switched to branch 'issue-65'
[root@dd68d8757a9d git-archive-all]# ./git_archive_all.py bla.tar.gz
[root@dd68d8757a9d git-archive-all]# tar tzvf bla.tar.gz 
-rw-rw-r-- 1000/1000       860 2018-11-27 09:57 bla/.appveyor.yml
-rw-rw-r-- 1000/1000       122 2018-11-27 09:57 bla/.gitignore
-rw-rw-r-- 1000/1000      4297 2018-11-27 09:57 bla/.travis.yml
-rw-r--r-- root/root      1612 2018-11-27 10:42 bla/CHANGES.rst
-rw-rw-r-- 1000/1000      1063 2018-11-27 09:57 bla/LICENSE.txt
-rw-rw-r-- 1000/1000        13 2018-11-27 09:57 bla/MANIFEST.in
-rw-rw-r-- 1000/1000       385 2018-11-27 09:57 bla/Makefile
-rw-rw-r-- 1000/1000      2419 2018-11-27 09:57 bla/README.rst
-rwxr-xr-x root/root     21328 2018-11-27 10:42 bla/git_archive_all.py
-rw-rw-r-- 1000/1000       126 2018-11-27 09:57 bla/requirements.txt
-rw-rw-r-- 1000/1000      1216 2018-11-27 09:57 bla/setup.cfg
-rw-rw-r-- 1000/1000      1058 2018-11-27 09:57 bla/setup.py
-rw-rw-r-- 1000/1000     12977 2018-11-27 09:57 bla/test_git_archive_all.py

@benningm
Copy link
Author

On Debian with a v2 git client:

root@b62a05ae77c8:/git-archive-all# cat /etc/debian_version 
9.6
root@b62a05ae77c8:/git-archive-all# git --version
git version 2.11.0

On master:

root@b62a05ae77c8:/git-archive-all# git log --oneline -1
c558c3c Add shield for Homebrew.
root@b62a05ae77c8:/git-archive-all# ./git_archive_all.py bla.tar.gz
root@b62a05ae77c8:/git-archive-all# tar tzvf bla.tar.gz 
-rw-rw-r-- 1000/1000       860 2018-11-27 09:57 bla/.appveyor.yml
-rw-rw-r-- 1000/1000       122 2018-11-27 09:57 bla/.gitignore
-rw-rw-r-- 1000/1000      4297 2018-11-27 09:57 bla/.travis.yml
-rw-r--r-- root/root      1306 2018-11-27 10:47 bla/CHANGES.rst
-rw-rw-r-- 1000/1000      1063 2018-11-27 09:57 bla/LICENSE.txt
-rw-rw-r-- 1000/1000        13 2018-11-27 09:57 bla/MANIFEST.in
-rw-rw-r-- 1000/1000       385 2018-11-27 09:57 bla/Makefile
-rw-rw-r-- 1000/1000      2419 2018-11-27 09:57 bla/README.rst
-rwxr-xr-x root/root     18601 2018-11-27 10:47 bla/git_archive_all.py
-rw-rw-r-- 1000/1000       126 2018-11-27 09:57 bla/requirements.txt
-rw-rw-r-- 1000/1000      1216 2018-11-27 09:57 bla/setup.cfg
-rw-rw-r-- 1000/1000      1058 2018-11-27 09:57 bla/setup.py
-rw-rw-r-- 1000/1000     12977 2018-11-27 09:57 bla/test_git_archive_all.py

On issue-65 branch:

root@b62a05ae77c8:/git-archive-all# git log --oneline -1
40de44f Fix reading attributes on Git < 1.8.5
root@b62a05ae77c8:/git-archive-all# ./git_archive_all.py bla.tar.gz
root@b62a05ae77c8:/git-archive-all# tar tzvf bla.tar.gz 
-rw-rw-r-- 1000/1000       860 2018-11-27 09:57 bla/.appveyor.yml
-rw-rw-r-- 1000/1000       122 2018-11-27 09:57 bla/.gitignore
-rw-rw-r-- 1000/1000      4297 2018-11-27 09:57 bla/.travis.yml
-rw-r--r-- root/root      1612 2018-11-27 10:48 bla/CHANGES.rst
-rw-rw-r-- 1000/1000      1063 2018-11-27 09:57 bla/LICENSE.txt
-rw-rw-r-- 1000/1000        13 2018-11-27 09:57 bla/MANIFEST.in
-rw-rw-r-- 1000/1000       385 2018-11-27 09:57 bla/Makefile
-rw-rw-r-- 1000/1000      2419 2018-11-27 09:57 bla/README.rst
-rwxr-xr-x root/root     21328 2018-11-27 10:48 bla/git_archive_all.py
-rw-rw-r-- 1000/1000       126 2018-11-27 09:57 bla/requirements.txt
-rw-rw-r-- 1000/1000      1216 2018-11-27 09:57 bla/setup.cfg
-rw-rw-r-- 1000/1000      1058 2018-11-27 09:57 bla/setup.py
-rw-rw-r-- 1000/1000     12977 2018-11-27 09:57 bla/test_git_archive_all.py

@benningm
Copy link
Author

Looks good. Many thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants