Re: Include git commit id and git tree id in *.changes files when uploading?
On 19/12/25 at 14:37 +0200, Adrian Bunk wrote:
> 3. give higher-level tools like git-buildpackage the ability to add it
Yeah, I think that it would be better to make higher-level tools emit
that information, since they are already git-aware, rather than add
git-awareness to lower-level tools.
For git-buildpackage, it looks like it would be easy to add such
information to generated dsc/changes, with the patch below (submitted as
#1123842)
diff --git i/gbp/scripts/buildpackage.py w/gbp/scripts/buildpackage.py
index 36ad8d02..733fe936 100755
--- i/gbp/scripts/buildpackage.py
+++ w/gbp/scripts/buildpackage.py
@@ -572,6 +572,10 @@ def main(argv):
'GBP_BUILD_DIR': build_dir})
)(dir=build_dir)
+ if repo.is_clean()[0]:
+ dpkg_args.append('--source-option=-DGit-Tag-Info=tag=%s' % repo.head)
+ dpkg_args.append('--changes-option=-DGit-Tag-Info=tag=%s' % repo.head)
+
# Finally build the package:
gbp.log.info("Performing the build")
RunAtCommand(options.builder,
Lucas
Reply to: