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

Support for non-monorepo use-case with custom tag format? #458

Open
praiskup opened this issue May 19, 2023 · 2 comments
Open

Support for non-monorepo use-case with custom tag format? #458

praiskup opened this issue May 19, 2023 · 2 comments
Labels
bug Something is clearly a bug effort/medium Can be done in 1-2 days gain/medium Affects multiple users

Comments

@praiskup
Copy link
Member

I tried to configure tito for a project with tag_format = v{version} instead
of the default "{name}-{version}-{release}". The 'tito tag' then fails:

ERROR: Error running command: git log --no-merges --pretty='format:%s (%ae)' --relative v2023.2.alpha1..HEAD -- .
 
Status code: 128
 
Command output: fatal: bad revision 'v2023.2.alpha1..HEAD'
 
Creating output directory: /tmp/tito
Traceback (most recent call last):
  File "/usr/bin/tito", line 33, in <module>
    sys.exit(load_entry_point('tito==0.6.22', 'console_scripts', 'tito')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tito/cli.py", line 910, in main
    CLI().main(sys.argv[1:])
  File "/usr/lib/python3.11/site-packages/tito/cli.py", line 209, in main
    return module.main(argv)
           ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tito/cli.py", line 685, in main
    return tagger.run(self.options)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tito/tagger/main.py", line 115, in run
    self._tag_release()
  File "/usr/lib/python3.11/site-packages/tito/tagger/main.py", line 135, in _tag_release
    self._make_changelog()
  File "/usr/lib/python3.11/site-packages/tito/tagger/main.py", line 268, in _make_changelog
    output = self._generate_default_changelog(last_tag)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tito/tagger/main.py", line 220, in _generate_default_changelog
    output = run_command(patch_command)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tito/common.py", line 305, in run_command
    raise RunCommandException(command, status, output)
tito.exception.RunCommandException: Error running command: git log --no-merges --pretty='format:%s (%ae)' --relative v2023.2.alpha1..HEAD -- .
@praiskup
Copy link
Member Author

Applied

From 4f41eec5e0cf6fa2f8bbf0fdc902a035c35496c3 Mon Sep 17 00:00:00 2001
From: Pavel Raiskup <[email protected]>
Date: Fri, 19 May 2023 15:36:39 +0200
Subject: [PATCH] Initialized to use tito.

---
 .tito/packages/.readme | 3 +++
 .tito/packages/crush   | 1 +
 .tito/tito.props       | 6 ++++++
 crush.spec             | 5 ++---
 4 files changed, 12 insertions(+), 3 deletions(-)
 create mode 100644 .tito/packages/.readme
 create mode 100644 .tito/packages/crush
 create mode 100644 .tito/tito.props

diff --git a/.tito/packages/.readme b/.tito/packages/.readme
new file mode 100644
index 0000000..b9411e2
--- /dev/null
+++ b/.tito/packages/.readme
@@ -0,0 +1,3 @@
+the .tito/packages directory contains metadata files
+named after their packages. Each file has the latest tagged
+version and the project's relative directory.
diff --git a/.tito/packages/crush b/.tito/packages/crush
new file mode 100644
index 0000000..ca1f7db
--- /dev/null
+++ b/.tito/packages/crush
@@ -0,0 +1 @@
+v2023.2.alpha1-1 ./
diff --git a/.tito/tito.props b/.tito/tito.props
new file mode 100644
index 0000000..32d182d
--- /dev/null
+++ b/.tito/tito.props
@@ -0,0 +1,6 @@
+[buildconfig]
+builder = tito.builder.Builder
+tagger = tito.tagger.VersionTagger
+changelog_do_not_remove_cherrypick = 0
+changelog_format = %s (%ae)
+tag_format = v{version}
diff --git a/crush.spec b/crush.spec
index 6077f40..ae0a43a 100644
--- a/crush.spec
+++ b/crush.spec
@@ -1,10 +1,9 @@
-Name: {{{ git_dir_name }}}
-Version: {{{ git_dir_version }}}
+Name: crush
+Version: v2023.2.alpha1
 Release: 1%{?dist}
 Summary: A drgn-based crash-util replacement
 BuildArch: noarch
 URL: https://codeberg.org/pf-kernel/crush
-VCS: {{{ git_dir_vcs }}}
 License: GPLv3+
 BuildRequires: python3-devel
 Source: {{{ git_dir_pack }}}
-- 
2.40.1

On top of the commit 4f41eec5e0cf6fa2f8bbf0fdc902a035c35496c3 from https://codeberg.org/pf-kernel/crush.git

@praiskup
Copy link
Member Author

The tito build --srpm --test works:
Wrote: /tmp/tito/crush-v2023.2.alpha1-1.git.435.4f41eec.fc38.src.rpm

@FrostyX FrostyX added effort/medium Can be done in 1-2 days gain/medium Affects multiple users bug Something is clearly a bug labels Jan 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is clearly a bug effort/medium Can be done in 1-2 days gain/medium Affects multiple users
Projects
None yet
Development

No branches or pull requests

2 participants