Re: west and (no) data loss, was: Re: [Zephyr-users] Do not use west v0.6.1; upgrade to v0.6.2


Carles Cufi
 

Thanks Martí for the extensive explanation.

I just want to add one more comment

b) "Is it true that west, when
asked to update modules, doesn't run any workcopy-destructive
commands, like git reset, some forms of git checkout; or, if it does,
it first performs (regression-tested) check for local changes in the
corresponding modules ?"
The default "west update" behavior uses "git checkout --detach".

From git-checkout(1):

Prepare to work on top of <commit>, by detaching HEAD at
it (see "DETACHED HEAD" section), and updating the index
and the files in the working tree. Local modifications to
the files in the working tree are kept, so that the
resulting working tree will be the state recorded in the
commit plus the local modifications.

Beyond preserving working tree state (unless there is a bug in git
itself), this leaves your existing branches behind untouched.
This is also the rationale behind leaving west projects in a detached HEAD state. If we were to use a specific branch name there would be potential for name collisions with local branches, as well as the potential for the emergence of serious bugs in the logic that would handle the branch maintenance and switching.

Carles

Join users@lists.zephyrproject.org to automatically receive all group messages.