tito icon indicating copy to clipboard operation
tito copied to clipboard

Add option to include whole repository

Open LecrisUT opened this issue 2 years ago • 6 comments

  • Added a section archiver with two options:
    • method ('git'/'tar'): How to create the tar ball
    • include_git (boolean): Whether to include .git folder

Still needs to be exposed to CLI as well. Please help me on that part.

Closes: #441

LecrisUT avatar Feb 17 '23 14:02 LecrisUT

This one seems to error when running method=tar because of tarfixer. But at least include_git seems to work locally :)

LecrisUT avatar Feb 17 '23 14:02 LecrisUT

Epel 7/8 seem to be using old python version. would really prefer the match: case instead of this. @FrostyX can you advise on what tarfixer does?

LecrisUT avatar Feb 24 '23 16:02 LecrisUT

Oh no, we have to make the code compatible all the way to python 2.7 😢

LecrisUT avatar Feb 24 '23 19:02 LecrisUT

Oh no, we have to make the code compatible all the way to python 2.7 cry

Yeah, that's always fun :smile: It's because we are releasing tito also for EPEL7.

But in your case it looks like an easyfix

Compiling /builddir/build/BUILDROOT/tito-tito.0.6.22.1-1.20230224162713711612.pr443.8.g7bce5fd.el7.x86_64/usr/lib/python2.7/site-packages/tito/common.py ...
  File "/usr/lib/python2.7/site-packages/tito/common.py", line 876
    tar_append_cmd = f"tar --append -f {initial_tar}  --transform 's|^{relative_git_dir}|{prefix}/|' {relative_git_dir}/.git"
                                                                                                                            ^
SyntaxError: invalid syntax

IIRC Python 2.7 doesn't have f-strings yet.

FrostyX avatar Feb 28 '23 14:02 FrostyX

can you advise on what tarfixer does?

Please take a look here https://github.com/rpm-software-management/tito/blob/master/src/tito/tar.py#L28-L60

FrostyX avatar Feb 28 '23 14:02 FrostyX

can you advise on what tarfixer does?

Please take a look here https://github.com/rpm-software-management/tito/blob/master/src/tito/tar.py#L28-L60

Yeah, I've understood the basics that it is to fix the timestamps so that the tars are identical. But I don't quite understand why it would depend if the tar ball was created via git archive or tar -cf. Maybe we need to specify additional flags to indicate it's a gunzip?

Although, wouldn't this be irrelevant if we include the whole .git folder that is not properly versioned? Should we completely bypass it for these two methods?

LecrisUT avatar Feb 28 '23 14:02 LecrisUT