<?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>7907</bug_id>
          
          <creation_ts>2015-06-18 14:10:24 +0000</creation_ts>
          <short_desc>devtool: update-recipe: only update SRCREV in auto mode when changes already pushed</short_desc>
          <delta_ts>2015-10-12 10:56:36 +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>1.8</version>
          <rep_platform>All</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>1.9</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Paul Eggleton">bluelightning</reporter>
          <assigned_to name="Markus Lehtonen">markus.lehtonen</assigned_to>
          <cc>bogdanx.a.voiculescu</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>patrick.ohly</cc>
    
    <cc>ross.burton</cc>
          
          <qa_contact name="Daniel Istrate">daniel.alexandrux.istrate</qa_contact>
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Yes (doc changes required)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>51789</commentid>
    <comment_count>0</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2015-06-18 14:10:24 +0000</bug_when>
    <thetext>It seems to me that when devtool update-recipe is used on a recipe pointing to a git repository, it probably shouldn&apos;t update SRCREV when mode is &quot;auto&quot; unless it can tell that the changes have already been pushed upstream (i.e. it should check assuming that&apos;s practical).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>52213</commentid>
    <comment_count>1</comment_count>
    <who name="Markus Lehtonen">markus.lehtonen</who>
    <bug_when>2015-07-08 14:06:06 +0000</bug_when>
    <thetext>This probably makes sense. What would you think about the logic for checking that? See if the commit is in origin/${BRANCH}, where ${BRANCH} is the branch defined in src_uri parameter (or master, if not defined)?

It probably would be right thing to do to look at the patch filenames (instead of commit sha1) when checking if a patch has been merged upstream.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>52251</commentid>
    <comment_count>2</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2015-07-09 16:44:44 +0000</bug_when>
    <thetext>I figured it would be as simple as checking if the revision at the head of origin/${BRANCH} matched the tip of the devtool branch and if so, set SRCREV to that. I wasn&apos;t thinking of looking at individual commits, just the revision hashes.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>52261</commentid>
    <comment_count>3</comment_count>
    <who name="Markus Lehtonen">markus.lehtonen</who>
    <bug_when>2015-07-09 19:37:58 +0000</bug_when>
    <thetext>Oh, that simple ;) But yes, we can start with that.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53916</commentid>
    <comment_count>4</comment_count>
    <who name="Markus Lehtonen">markus.lehtonen</who>
    <bug_when>2015-09-10 11:13:39 +0000</bug_when>
    <thetext>Merged in http://git.openembedded.org/openembedded-core/commit/?id=9b9733b7d74032aef4979bec553019421e77da14</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55166</commentid>
    <comment_count>5</comment_count>
    <who name="Daniel Istrate">daniel.alexandrux.istrate</who>
    <bug_when>2015-10-12 10:56:36 +0000</bug_when>
    <thetext>Verified on master: e35c404537db0b46047fcb2ee7d3645e3e0935c5

Steps to verify:
1. You need some package with git sources e.g. btrfs-tools
devtool modify -x btrfs-tools btrfs-tools

2. Then make a change to the source code and commit
cd btrfs-tools/
echo foobar &gt;&gt; INSTALL; git commit -am&quot;My change&quot;

3. Run devtool
cd ..
devtool update-recipe btrfs-tools

4. You can fool devtool a bit to think that your change is already in upstream
cd btrfs-tools/
git rev-parse HEAD &gt; .git/refs/remotes/origin/master

5. Run devtool
cd ..
devtool update-recipe btrfs-tools

6. Check that the patches are deleted and SRCREV updated
git diff meta/recipes-devtools/btrfs-tools/btrfs-tools_*.bb
SRCREV should be the same with &apos;git rev-parse HEAD&apos; typed earlier.


-------------------------------------------------------------------------

[daniel@fedora-ws poky-build]$ devtool modify -x btrfs-tools btrfs-tools
NOTE: Creating workspace layer in /media/ssd/poky-build/workspace
NOTE: Enabling workspace layer in bblayers.conf
Parsing recipes..done.
NOTE: Fetching btrfs-tools...
NOTE: Unpacking...
NOTE: Patching...
NOTE: Source tree extracted to /media/ssd/poky-build/btrfs-tools
NOTE: Using source tree as build directory since recipe inherits autotools-brokensep
NOTE: Recipe btrfs-tools now set up to build from /media/ssd/poky-build/btrfs-tools
[daniel@fedora-ws poky-build]$ cd btrfs-tools/
[daniel@fedora-ws btrfs-tools]$ echo foobar &gt;&gt; INSTALL; git commit -am&quot;My change&quot;
[devtool 064d0c3] My change
 1 file changed, 1 insertion(+)
[daniel@fedora-ws btrfs-tools]$ cd ..
[daniel@fedora-ws poky-build]$ devtool update-recipe btrfs-tools
Parsing recipes..done.
NOTE: Adding new patch 0001-My-change.patch
NOTE: Updating recipe btrfs-tools_4.1.2.bb
[daniel@fedora-ws poky-build]$ cd btrfs-tools/
[daniel@fedora-ws btrfs-tools]$ git rev-parse HEAD &gt; .git/refs/remotes/origin/master
[daniel@fedora-ws btrfs-tools]$ cd ..
[daniel@fedora-ws poky-build]$ devtool update-recipe btrfs-tools
Parsing recipes..done.
NOTE: Updating SRCREV in recipe btrfs-tools_4.1.2.bb
NOTE: Removing file /home/daniel/poky/meta/recipes-devtools/btrfs-tools/btrfs-tools/0001-My-change.patch
NOTE: Removing file /home/daniel/poky/meta/recipes-devtools/btrfs-tools/btrfs-tools/fix-parallel.patch
[daniel@fedora-ws poky]$ git diff meta/recipes-devtools/btrfs-tools/btrfs-tools_*.bb
diff --git a/meta/recipes-devtools/btrfs-tools/btrfs-tools_4.1.2.bb b/meta/recipes-devtools/btrfs-tools/btrfs-tools_4.1.2.bb
index 37c622b..0159eb0 100644
--- a/meta/recipes-devtools/btrfs-tools/btrfs-tools_4.1.2.bb
+++ b/meta/recipes-devtools/btrfs-tools/btrfs-tools_4.1.2.bb
@@ -12,10 +12,8 @@ LIC_FILES_CHKSUM = &quot;file://COPYING;md5=fcb02dc552a041dee27e4b85c7396067&quot;
 SECTION = &quot;base&quot;
 DEPENDS = &quot;util-linux attr e2fsprogs lzo acl&quot;
 
-SRCREV = &quot;7f1328ccb5d159efe850d4eaea9b49bbe8c4181e&quot;
-SRC_URI = &quot;git://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git \
-           file://fix-parallel.patch \
-&quot;
+SRCREV = &quot;064d0c33f9befe7170618036cce967fe59ed1084&quot;
+SRC_URI = &quot;git://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git&quot;
 
 inherit autotools-brokensep pkgconfig
 
[daniel@fedora-ws poky]$</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>