Op 21 aug. 2012, om 13:52 heeft Martin Jansa <martin.ja...@gmail.com> het 
volgende geschreven:

> On Tue, Aug 21, 2012 at 12:21:44PM +0200, Koen Kooi wrote:
>> 
>> Op 21 aug. 2012, om 10:47 heeft Martin Jansa <martin.ja...@gmail.com> het 
>> volgende geschreven:
>> 
>>> Signed-off-by: Martin Jansa <martin.ja...@gmail.com>
>>> ---
>>> scripts/layerman |   13 ++++++++++++-
>>> 1 files changed, 12 insertions(+), 1 deletions(-)
>>> 
>>> diff --git a/scripts/layerman b/scripts/layerman
>>> index 60b1588..87400fa 100755
>>> --- a/scripts/layerman
>>> +++ b/scripts/layerman
>>> @@ -28,11 +28,22 @@ function check_layer() {
>>>     cd ${LAYERDIR}
>>>     CURRENTCOMMIT="$(git log --oneline --no-abbrev -1 | awk '{print $1}')"
>>>     CURRENTBRANCH="$(git branch | grep '*' | awk '{print $2}')"
>>> +   CURRENTURI="$(git config remote.origin.url)"
>>> 
>>> +   if [ "${CURRENTURI}" != "${LAYERURI}" ] ; then
>>> +           echo "WARNING!!!!"
>>> +           echo "WARNING: ${LAYERNAME} is using a different uri 
>>> '${CURRENTURI}' than configured in layers.txt '${LAYERURI}'"
>>> +           echo "WARNING: Changing uri to: '${LAYERURI}'"
>>> +           echo "WARNING!!!!"
>>> +           git remote set-url origin ${LAYERURI}
>>> +           git remote update
>>> +   fi
>> 
>> The above part of the patch is awesome!
>> 
>>>     if [ "${CURRENTBRANCH}" != "${BRANCH}" ] ; then
>>>             echo "WARNING!!!!"
>>> -           echo "WARNING: ${LAYERNAME} is using a different branch than 
>>> configured in layers.txt"
>>> +           echo "WARNING: ${LAYERNAME} is using a different branch 
>>> '${CURRENTBRANCH}' than configured in layers.txt '${BRANCH}'"
>>> +           echo "WARNING: Changing branch to: '${BRANCH}'"
>>>             echo "WARNING!!!!"
>>> +           git checkout origin/${BRANCH} -b ${BRANCH} >/dev/null || git 
>>> checkout ${BRANCH}
>>>     fi
>> 
>> But this breaks the intention. The general idea is to allow people to add 
>> their own commits to a custom branch, but remove changes otherwise. The 
>> current implementation is inconsitent and non-obvious, so I'd welcome 
>> suggestions. Whatever we turn out to do, it will get documented in the 
>> README to lessen the surprise.
>> 
>> Do you want me to commit only the top part?
> 
> I'm not using setup-scripts as such, but I've used layerman and
> layers.txt format in some other "setup" env, so if you like only top
> part, feel free to merge it.

The top part has been merged and the README has been updated.

> For own commits in custom branch I expect user to change layers.txt for
> his custom branch and for that (or switching default branch) I needed
> that bottom change.


I'm thinking of doing the following:

1) Create a new flag that controls branch resets
2) Default the flag to allow resets
3) update README
4) send announcement.

Does that fit your use case?

regards,

Koen
_______________________________________________
Angstrom-distro-devel mailing list
Angstrom-distro-devel@linuxtogo.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/angstrom-distro-devel

Reply via email to