Bug 9368

Summary: devtool: sdk-update: metadata update can result in conflict resolution
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Paul Eggleton <bluelightning>
Component: devtools / tool chainAssignee: Stephano Cetola <stephano>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: meta.mr.watcher, meta.watcher
Version: 2.1   
Target Milestone: 2.1 M4   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Paul Eggleton 2016-04-01 03:11:12 UTC
At the moment as part of devtool sdk-update we are performing a "git pull" on the metadata repository and that can be problematic - you may not get a fast-forward merge since the repository might have been re-created on the server end. We should probably do the following:

1) Use git status --porcelain to check if the user has made any changes and error out if so

2) Use "git fetch" followed by "git reset --hard" instead of "git pull" so that we avoid any potential conflicts.
Comment 1 Stephano Cetola 2016-04-07 13:56:47 UTC
Regarding Paul's comment, I'm going to be changing the way that the esdk is generated so that layers repo is already created and a commit only needs to be made by oe-publish-sdk.

--
Paul Eggleton: thinking about it though if we're to take better advantage of being able to pull down updates we probably need to initialise the repo when we create the SDK, and then as part of publishing we set it up as a commit in an existing repo if one exists
--

Also note that we should check to be sure that a git user exists in .gitconifg before we try to make a commit, or it will fail.