Bug 3017

Summary: bake should check branch state before git rebase
Product: bake Reporter: Tom Henderson <tomh>
Component: bakeAssignee: ns-bugs <ns-bugs>
Status: PATCH WANTED ---    
Severity: normal CC: ns-bugs
Priority: P5    
Version: unspecified   
Hardware: PC   
OS: Linux   

Description Tom Henderson 2018-11-19 22:38:49 UTC
./bake.py configure -e dce-umip-dev && ./bake.py download && ./bake.py update

will fail because dce-umip-dev checks out an older revision of the tree, leaving the repository in detached head state.  bake update will try to stash local changes and rebase, but the rebase operation will fail.

bake could be smarter and check the branch status before attempting a rebase.  

$ git status --branch --porcelain
will return the string 'HEAD (no branch)' if in this state.

However, bake doesn't have an easy way to check this using existing ModuleEnvironment methods, so some other method that calls subprocess.Popen () to check this may be needed.