Skip to content

Keeping west modules in sync with main tree #28651

Closed Answered by nashif
nashif asked this question in General
Discussion options

You must be logged in to vote

add two git hooks:

$ cat  .git/hooks/post-merge
#!/bin/sh

CHANGED=`git diff HEAD@{1} --stat -- west.yml | wc -l`
if [ $CHANGED -gt 0 ];
then
    echo "west.yml has changed!"
    west update
fi

and

$ cat  .git/hooks/post-checkout
#!/bin/sh

GIT_ROOT=`git rev-parse --show-toplevel`
CHANGED=`git diff HEAD@{1} --stat -- ${GIT_ROOT}/west.yml | wc -l`
if [ $CHANGED -gt 0 ];
then
    echo "west.yml has changed!"
    west update
fi

Now every time you move in git history, modules will get updated and be in sync with main git repo.

Replies: 2 comments 8 replies

Comment options

nashif
Sep 23, 2020
Maintainer Author

You must be logged in to vote
0 replies
Answer selected by nashif
Comment options

You must be logged in to vote
8 replies
@mbolivar-nordic
Comment options

@nashif
Comment options

nashif Jun 18, 2021
Maintainer Author

@mbolivar-nordic
Comment options

@nashif
Comment options

nashif Jun 18, 2021
Maintainer Author

@marc-hb
Comment options

marc-hb Jul 23, 2021
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: West West utility
3 participants