<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>16354</bug_id>
          
          <creation_ts>2026-07-09 08:38:59 +0000</creation_ts>
          <short_desc>devtool: adding recipe with autorev fails</short_desc>
          <delta_ts>2026-07-26 12:17:18 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>devtools / tool chain</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>6.1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Gyorgy Sarvari">skandigraun</reporter>
          <assigned_to name="Babanpreet Singh">bbnpreetsingh</assigned_to>
          <cc>bbnpreetsingh</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>randy.macleod</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>106129</commentid>
    <comment_count>0</comment_count>
    <who name="Gyorgy Sarvari">skandigraun</who>
    <bug_when>2026-07-09 08:38:59 +0000</bug_when>
    <thetext>In case a new recipe is created with devtool from a git repository using AUTOREV, finishing the recipe fails.

Reproduction (any repository should work for the reproduction, this one is just an example):

devtool add --autorev minit git://git@github.com/OldManYellsAtCloud/minit.git\;protocol=https\;branch=master
devtool finish minit ../openembedded-core/meta

Result:
the first command succeeds, the recipe is created in the workspace. But finishing the recipe fails with the following error:

```
INFO: Updating SRCREV in recipe minit_git.bb
Traceback (most recent call last):
  File &quot;/yocto/init-sandbox/openembedded-core/scripts/devtool&quot;, line 352, in &lt;module&gt;
    ret = main()
  File &quot;/yocto/init-sandbox/openembedded-core/scripts/devtool&quot;, line 338, in main
    ret = args.func(args, config, basepath, workspace)
  File &quot;/yocto/init-sandbox/openembedded-core/scripts/lib/devtool/standard.py&quot;, line 2183, in finish
    updated, appendfile, removed = _update_recipe(args.recipename, workspace, rd, args.mode, appendlayerdir, wildcard_version=True, no_remove=False, no_report_remove=removing_original, initial_rev=args.initial_rev, dry_run_outdir=dry_run_outdir, no_overrides=args.no_overrides, force_patch_refresh=args.force_patch_refresh)
                                   ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File &quot;/yocto/init-sandbox/openembedded-core/scripts/lib/devtool/standard.py&quot;, line 1878, in _update_recipe
    updated, appendf, removed = _update_recipe_srcrev(recipename, workspace, srctree, crd, appendlayerdir, wildcard_version, no_remove, no_report_remove, dry_run_outdir)
                                ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File &quot;/yocto/init-sandbox/openembedded-core/scripts/lib/devtool/standard.py&quot;, line 1562, in _update_recipe_srcrev
    upd_p, new_p, del_p = _export_patches(srctree, rd, old_srcrev,
                          ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
                                          patches_dir)
                                          ^^^^^^^^^^^^
  File &quot;/yocto/init-sandbox/openembedded-core/scripts/lib/devtool/standard.py&quot;, line 1329, in _export_patches
    new_patches = GitApplyTree.extractPatches(srctree, start_revs, destdir, patch_pathspec)
  File &quot;/yocto/init-sandbox/openembedded-core/meta/lib/oe/patch.py&quot;, line 528, in extractPatches
    out = runcmd([&quot;sh&quot;, &quot;-c&quot;, &quot; &quot;.join(shellcmd)], os.path.join(tree, name))
  File &quot;/yocto/init-sandbox/openembedded-core/meta/lib/oe/patch.py&quot;, line 49, in runcmd
    raise CmdError(cmd, exitstatus &gt;&gt; 8, &quot;stdout: %s\nstderr: %s&quot; % (stdout, stderr))
oe.patch.CmdError: Command Error: &apos;sh -c &apos;git format-patch --no-signature --no-numbered AUTOINC -o /tmp/oepatchxu0ig0v0 -- .&apos;&apos; exited with 0  Output:
stdout: 
stderr: fatal: bad revision &apos;AUTOINC&apos;

```


If the revision is specified explicitly in the &quot;devtool add&quot; command, then &quot;devtool finish&quot; also succeeds.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106140</commentid>
    <comment_count>1</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2026-07-09 15:00:59 +0000</bug_when>
    <thetext>Good catch. Clearly a regression.
There should also be another test added.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106171</commentid>
    <comment_count>2</comment_count>
    <who name="Babanpreet Singh">bbnpreetsingh</who>
    <bug_when>2026-07-15 15:12:53 +0000</bug_when>
    <thetext>I recently submitted a patch regarding this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106336</commentid>
    <comment_count>3</comment_count>
    <who name="Babanpreet Singh">bbnpreetsingh</who>
    <bug_when>2026-07-26 06:30:36 +0000</bug_when>
    <thetext>ae7be93cfd devtool: standard: fix finish/update-recipe for recipes using AUTOREV
b05a903407 oeqa/selftest/devtool: exercise devtool finish on an AUTOREV recipe

Series (v2): https://lore.kernel.org/openembedded-core/20260714032029.7-1-bbnpreetsingh@gmail.com/
Patchwork: 92391 and 92392, both accepted.

The second commit is the extra test Randy asked for: it runs devtool
finish on an AUTOREV recipe and checks that SRCREV is written out as a
real revision instead of the literal AUTOINC.

I do not appear to have permission to change the bug fields here. Could
someone with editbugs move this to RESOLVED/FIXED.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106338</commentid>
    <comment_count>4</comment_count>
    <who name="Gyorgy Sarvari">skandigraun</who>
    <bug_when>2026-07-26 12:17:18 +0000</bug_when>
    <thetext>Fixed by: https://git.openembedded.org/openembedded-core/commit/scripts?id=ae7be93cfd63088f6f160e75a99d9eaca1e1bd7f</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>