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

Shallow clone - preprocess specfile correctly or fail #210

Open
praiskup opened this issue Nov 21, 2024 · 0 comments
Open

Shallow clone - preprocess specfile correctly or fail #210

praiskup opened this issue Nov 21, 2024 · 0 comments

Comments

@praiskup
Copy link

Similar to: https://pagure.io/fedora-infra/rpmautospec/issue/227

In the original issue, rpmautospec failed to generate any src.rpm.
Nowadays it "succeeds" , which is good (sometimes), but it produces
misleading output:

git clone https://src.fedoraproject.org/rpms/git-cola.git --depth 1
cd git-cola
$ fedpkg srpm
...
Wrote: /tmp/git-cola/git-cola-4.8.1-1.fc42.src.rpm
bsdtar xf /tmp/git-cola/git-cola-4.8.1-1.fc42.src.rpm git-cola.spec
grep %changelog -A 10 git-cola.spec 
%changelog
## START: Generated by rpmautospec
* Fri Jun 04 2021 Python Maint <[email protected]> - 3.9-2
- Rebuilt for Python 3.10

* Fri Feb 19 2021 David Schwörer <[email protected]> - 3.9-1
- Update to 3.9

* Tue Jan 26 2021 Fedora Release Engineering <[email protected]> - 3.8-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

The history is lost ^^^, the period 2021-2024. There's also
a wrong release_number = 1. With a full-clone, the generated
src.rpm looks different:

- /tmp/git-cola/git-cola-4.8.1-1.fc42.src.rpm
+ /tmp/git-cola/git-cola-4.8.1-2.fc42.src.rpm

Please provide a tool for "preparing" Git repositories for shallow clones,
for example something like rpmautospec shallowize. Such a tool would update the
./changelog file (adding new entries) and Release: tag accordingly.

Then, add a detection mechanism for missing commits in shallow clones.
Such commits that-if the repo was --unshallow'ed- would affect the overall
shape of the spec file or %changelog.

And finally, if the missing commit is detected - ideally start failing again
(by default, with some --ignore-missing-commits-like option).

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

1 participant