Git clone doesn't download the full content of a root file


I have a git repository that stores root files containing a bunch of histograms. The root files were originally generated from a debian server. But when I download the repository using git clone to my laptop, root files seems not to be dowloaded completely:

-rw-r--r--  1 edwin  staff   834B Jun  5 16:54
-rw-r--r--  1 edwin  staff   131B Jun  5 16:54 histograms_1n_00087.root
-rw-r--r--  1 edwin  staff   131B Jun  5 16:54 histograms_1n_000923.root
-rw-r--r--  1 edwin  staff   131B Jun  5 16:54 histograms_1n_00175.root
-rw-r--r--  1 edwin  staff   129B Jun  5 16:54 test.root

For example, the histograms_1n_00087.root in the github is shown to have 576 KB data but here it just has 131B. As the result, those root files cannot be opened showing the message:

Attaching file test.root as _file0...
Error in <TFile::ReadBuffer>: error reading all requested bytes from file test.root, got 129 of 300
Error in <TFile::Init>: test.root failed to read the file type data.

However, if I use wget to download the root, it works again.

How to reproduce

git clone

Go to expdata folder and open any file with root.

system info where root files are created

ROOT Version: 6.26.10
Platform: Debian GNU/Linux 10 (buster)
Compiler: gcc 12
Git: 2.45.1

system info where root files are downloaded

ROOT Version: 6.30.06
Platform: MacOS 14.5 Sonoma
Compiler: apple clang 15.0.0
Git: 2.39.1


I am sorry to read you are suffering from this issue. Could you elaborate about the relation of this issue with ROOT? Can you download the files by another strategy and check whether they work?



works fine for me:

$ git clone
Cloning into 'NeuLANDData'...
remote: Enumerating objects: 25, done.
remote: Counting objects: 100% (25/25), done.
remote: Compressing objects: 100% (21/21), done.
remote: Total 25 (delta 6), reused 22 (delta 3), pack-reused 0
Receiving objects: 100% (25/25), 71.22 KiB | 35.61 MiB/s, done.
Resolving deltas: 100% (6/6), done.
Updating files: 100% (8/8), done.
Encountered 2 files that should have been pointers, but weren't:

$ ls -lh NeuLANDData/exp_data
total 1.9M
-rw-r--r--. 1 XXXXXX zp 577K Jun  5 17:57 histograms_1n_00087.root
-rw-r--r--. 1 XXXXXX zp 577K Jun  5 17:57 histograms_1n_000923.root
-rw-r--r--. 1 XXXXXX zp 755K Jun  5 17:57 histograms_1n_00175.root
-rw-r--r--. 1 XXXXXX zp  834 Jun  5 17:57
-rw-r--r--. 1 XXXXXX zp 4.1K Jun  5 17:57 test.root

$ root NeuLANDData/exp_data/histograms_1n_00087.root
  | Welcome to ROOT 6.30/02               |
  | (c) 1995-2023, The ROOT Team; conception: R. Brun, F. Rademakers |
  | Built for linuxx8664gcc on Dec 20 2023, 18:59:44                 |
  | From heads/master@tags/v6-30-02                                  |
  | With g++ (GCC) 13.1.0                                            |
  | Try '.help'/'.?', '.demo', '.license', '.credits', '.quit'/'.q'  |

root [0]
Attaching file NeuLANDData/exp_data/histograms_1n_00087.root as _file0...
(TFile *) 0x1f6cc40
root [1] 

However, if I use wget to download the root, it works again.

Sorry for the mistyping here. I actually meant those .root files instead of root program. So yes, if I download through wget or from website, it all works out. But if I use git clone, root files seem to not be completely downloaded.

Could you elaborate about the relation of this issue with ROOT?

Yes, when doing the git cloning, only .root files are not downloaded completely. Other files, like Markdown files can be correctly downloaded. I suspect there is something fishy happening between .root files and git. After pushing a .root file in one system, its full content seems not to be pulled in another system.

Thanks for trying out. Which OS are you using? I have this issue from MacOS 14 and RHEL 8. But it works on Debian buster, where the root files are original created.

It’s AlmaLinux OS 9.