[test] scripts: Reset working repository to match origin during clean up

Submitted by Michael Halstead on Jan. 11, 2019, 7:02 p.m. | Patch ID: 157801

Details

Message ID 20190111190256.9354-1-mhalstead@linuxfoundation.org
State New
Headers show

Commit Message

Michael Halstead Jan. 11, 2019, 7:02 p.m.
If the local HEAD is a patchtest generated merge commit patchtest may be unable
to apply new patches. This should prevent patchtest from becoming stuck
in that state.

Signed-off-by: Michael Halstead <mhalstead@linuxfoundation.org>
---
 scripts/create-share-folder | 2 +-
 scripts/host                | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/scripts/create-share-folder b/scripts/create-share-folder
index 861da4b..9432cb1 100755
--- a/scripts/create-share-folder
+++ b/scripts/create-share-folder
@@ -122,7 +122,7 @@  function update_repository() {
 	(
 	    cd $REPODIR
 	    git am --abort --quiet
-	    git reset --hard --quiet
+	    git reset --hard --quiet FETCH_HEAD
 	    git clean -f -e ".git-pw*" --quiet
 	)
 	
diff --git a/scripts/host b/scripts/host
index 85f0e4a..893ce63 100755
--- a/scripts/host
+++ b/scripts/host
@@ -83,7 +83,7 @@  function clean() {
     (
 	cd $path
 	git am --abort
-	git reset --hard
+	git reset --hard FETCH_HEAD
 	git clean -f -e ".git-pw*"
     )
 }

Comments

Khem Raj Jan. 11, 2019, 8:25 p.m.
Hi Michael

Can we enable these checks for meta-openembedded repo as well

On Fri, Jan 11, 2019 at 11:03 AM Michael Halstead <
mhalstead@linuxfoundation.org> wrote:

> If the local HEAD is a patchtest generated merge commit patchtest may be
> unable
> to apply new patches. This should prevent patchtest from becoming stuck
> in that state.
>
> Signed-off-by: Michael Halstead <mhalstead@linuxfoundation.org>
> ---
>  scripts/create-share-folder | 2 +-
>  scripts/host                | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/create-share-folder b/scripts/create-share-folder
> index 861da4b..9432cb1 100755
> --- a/scripts/create-share-folder
> +++ b/scripts/create-share-folder
> @@ -122,7 +122,7 @@ function update_repository() {
>         (
>             cd $REPODIR
>             git am --abort --quiet
> -           git reset --hard --quiet
> +           git reset --hard --quiet FETCH_HEAD
>             git clean -f -e ".git-pw*" --quiet
>         )
>
> diff --git a/scripts/host b/scripts/host
> index 85f0e4a..893ce63 100755
> --- a/scripts/host
> +++ b/scripts/host
> @@ -83,7 +83,7 @@ function clean() {
>      (
>         cd $path
>         git am --abort
> -       git reset --hard
> +       git reset --hard FETCH_HEAD
>         git clean -f -e ".git-pw*"
>      )
>  }
> --
> 2.17.2
>
> --
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>
Michael Halstead Jan. 11, 2019, 9:47 p.m.
Since these commands run in $REPODIR and $path I think they will apply 
to any repository under test.

On 1/11/19 12:25 PM, Khem Raj wrote:
> Hi Michael
>
> Can we enable these checks for meta-openembedded repo as well
>
> On Fri, Jan 11, 2019 at 11:03 AM Michael Halstead 
> <mhalstead@linuxfoundation.org <mailto:mhalstead@linuxfoundation.org>> 
> wrote:
>
>     If the local HEAD is a patchtest generated merge commit patchtest
>     may be unable
>     to apply new patches. This should prevent patchtest from becoming
>     stuck
>     in that state.
>
>     Signed-off-by: Michael Halstead <mhalstead@linuxfoundation.org
>     <mailto:mhalstead@linuxfoundation.org>>
>     ---
>      scripts/create-share-folder | 2 +-
>      scripts/host                | 2 +-
>      2 files changed, 2 insertions(+), 2 deletions(-)
>
>     diff --git a/scripts/create-share-folder b/scripts/create-share-folder
>     index 861da4b..9432cb1 100755
>     --- a/scripts/create-share-folder
>     +++ b/scripts/create-share-folder
>     @@ -122,7 +122,7 @@ function update_repository() {
>             (
>                 cd $REPODIR
>                 git am --abort --quiet
>     -           git reset --hard --quiet
>     +           git reset --hard --quiet FETCH_HEAD
>                 git clean -f -e ".git-pw*" --quiet
>             )
>
>     diff --git a/scripts/host b/scripts/host
>     index 85f0e4a..893ce63 100755
>     --- a/scripts/host
>     +++ b/scripts/host
>     @@ -83,7 +83,7 @@ function clean() {
>          (
>             cd $path
>             git am --abort
>     -       git reset --hard
>     +       git reset --hard FETCH_HEAD
>             git clean -f -e ".git-pw*"
>          )
>      }
>     -- 
>     2.17.2
>
>     -- 
>     _______________________________________________
>     yocto mailing list
>     yocto@yoctoproject.org <mailto:yocto@yoctoproject.org>
>     https://lists.yoctoproject.org/listinfo/yocto
>
Khem Raj Jan. 11, 2019, 9:53 p.m.
OK then I need to understand how this will be invoked for
meta-openembedded repos

On Fri, Jan 11, 2019 at 1:47 PM Michael Halstead
<mhalstead@linuxfoundation.org> wrote:
>
> Since these commands run in $REPODIR and $path I think they will apply to any repository under test.
>
> On 1/11/19 12:25 PM, Khem Raj wrote:
>
> Hi Michael
>
> Can we enable these checks for meta-openembedded repo as well
>
> On Fri, Jan 11, 2019 at 11:03 AM Michael Halstead <mhalstead@linuxfoundation.org> wrote:
>>
>> If the local HEAD is a patchtest generated merge commit patchtest may be unable
>> to apply new patches. This should prevent patchtest from becoming stuck
>> in that state.
>>
>> Signed-off-by: Michael Halstead <mhalstead@linuxfoundation.org>
>> ---
>>  scripts/create-share-folder | 2 +-
>>  scripts/host                | 2 +-
>>  2 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/scripts/create-share-folder b/scripts/create-share-folder
>> index 861da4b..9432cb1 100755
>> --- a/scripts/create-share-folder
>> +++ b/scripts/create-share-folder
>> @@ -122,7 +122,7 @@ function update_repository() {
>>         (
>>             cd $REPODIR
>>             git am --abort --quiet
>> -           git reset --hard --quiet
>> +           git reset --hard --quiet FETCH_HEAD
>>             git clean -f -e ".git-pw*" --quiet
>>         )
>>
>> diff --git a/scripts/host b/scripts/host
>> index 85f0e4a..893ce63 100755
>> --- a/scripts/host
>> +++ b/scripts/host
>> @@ -83,7 +83,7 @@ function clean() {
>>      (
>>         cd $path
>>         git am --abort
>> -       git reset --hard
>> +       git reset --hard FETCH_HEAD
>>         git clean -f -e ".git-pw*"
>>      )
>>  }
>> --
>> 2.17.2
>>
>> --
>> _______________________________________________
>> yocto mailing list
>> yocto@yoctoproject.org
>> https://lists.yoctoproject.org/listinfo/yocto
>
> --
> Michael Halstead
> Linux Foundation / SysAdmin
Michael Halstead Jan. 11, 2019, 10:30 p.m.
On 1/11/19 1:53 PM, Khem Raj wrote:
> OK then I need to understand how this will be invoked for
> meta-openembedded repos

I think that is beyond the scope of this patch. Can you clarify a bit 
more? Or perhaps this topic deserves its own thread on an OE list.


> On Fri, Jan 11, 2019 at 1:47 PM Michael Halstead
> <mhalstead@linuxfoundation.org> wrote:
>> Since these commands run in $REPODIR and $path I think they will apply to any repository under test.
>>
>> On 1/11/19 12:25 PM, Khem Raj wrote:
>>
>> Hi Michael
>>
>> Can we enable these checks for meta-openembedded repo as well
>>
>> On Fri, Jan 11, 2019 at 11:03 AM Michael Halstead <mhalstead@linuxfoundation.org> wrote:
>>> If the local HEAD is a patchtest generated merge commit patchtest may be unable
>>> to apply new patches. This should prevent patchtest from becoming stuck
>>> in that state.
>>>
>>> Signed-off-by: Michael Halstead <mhalstead@linuxfoundation.org>
>>> ---
>>>   scripts/create-share-folder | 2 +-
>>>   scripts/host                | 2 +-
>>>   2 files changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/scripts/create-share-folder b/scripts/create-share-folder
>>> index 861da4b..9432cb1 100755
>>> --- a/scripts/create-share-folder
>>> +++ b/scripts/create-share-folder
>>> @@ -122,7 +122,7 @@ function update_repository() {
>>>          (
>>>              cd $REPODIR
>>>              git am --abort --quiet
>>> -           git reset --hard --quiet
>>> +           git reset --hard --quiet FETCH_HEAD
>>>              git clean -f -e ".git-pw*" --quiet
>>>          )
>>>
>>> diff --git a/scripts/host b/scripts/host
>>> index 85f0e4a..893ce63 100755
>>> --- a/scripts/host
>>> +++ b/scripts/host
>>> @@ -83,7 +83,7 @@ function clean() {
>>>       (
>>>          cd $path
>>>          git am --abort
>>> -       git reset --hard
>>> +       git reset --hard FETCH_HEAD
>>>          git clean -f -e ".git-pw*"
>>>       )
>>>   }
>>> --
>>> 2.17.2
>>>
>>> --
>>> _______________________________________________
>>> yocto mailing list
>>> yocto@yoctoproject.org
>>> https://lists.yoctoproject.org/listinfo/yocto
>> --
>> Michael Halstead
>> Linux Foundation / SysAdmin