dakanji / RefindPlusUDK

RefindPlus UEFI Development Kit
BSD 2-Clause "Simplified" License
7 stars 39 forks source link

Error in Repoupdater.sh #8

Closed startergo closed 3 years ago

startergo commented 3 years ago
/Users/MBP113/Documents/RefindPlus/edk2/000-BuildScript/RepoUpdater.sh
Syncing RefindPlus
Already on 'GOPFix'
Your branch is up to date with 'origin/GOPFix'.
fatal: ambiguous argument '': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

Runtime Error ... Exiting
dakanji commented 3 years ago

Unfortunately an expected outcome of recent change on existing setups. Please sync manually and things should work as expected for future runs.

startergo commented 3 years ago

I did sync manually by removing the offending code from the file. Upon reexecution I got the same error.

/Users/MBP113/Documents/RefindPlus/edk2/000-BuildScript/RepoUpdater.sh 
Syncing RefindPlus
Already on 'GOPFix'
Your branch is up to date with 'origin/GOPFix'.
fatal: ambiguous argument '': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Everything up-to-date
From https://github.com/dakanji/RefindPlus
 * branch            GOPFix     -> FETCH_HEAD
Already up to date.
Everything up-to-date
Everything up-to-date

Synced RefindPlus

## RepoUpdater ##
-----------------

Syncing RefindPlusUDK
M   000-BuildScript/RepoUpdater.sh
Already on 'rudk'
Your branch is up to date with 'origin/rudk'.
HEAD is now at 69bcbeec Improve Resilience of RepoUpdater
Total 0 (delta 0), reused 0 (delta 0)
To https://github.com/startergo/Refind-UDK.git
 + 986bb668...69bcbeec HEAD -> rudk (forced update)
From https://github.com/dakanji/Refind-UDK
 * branch              rudk       -> FETCH_HEAD
Updating 69bcbeec..986bb668
Fast-forward
 000-BuildScript/RepoUpdateSHA.txt        |  2 +-
 MdeModulePkg/Library/UefiHiiLib/HiiLib.c | 13 +++++++++++++
 UefiCpuPkg/Library/MtrrLib/MtrrLib.c     | 12 ++++++++++--
 3 files changed, 24 insertions(+), 3 deletions(-)
Total 0 (delta 0), reused 0 (delta 0)
To https://github.com/startergo/Refind-UDK.git
   69bcbeec..986bb668  rudk -> rudk
Everything up-to-date

Synced RefindPlusUDK

-----------------
## RepoUpdater ##

MBP113@G5s-Mac-Pro-2 ~ % /Users/MBP113/Documents/RefindPlus/edk2/000-BuildScript/RepoUpdater.sh 
Syncing RefindPlus
Already on 'GOPFix'
Your branch is up to date with 'origin/GOPFix'.
fatal: ambiguous argument '': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

Runtime Error ... Exiting
dakanji commented 3 years ago

What offending code was removed? Lost on that.

BTW, "sync manually" means literally do the sync steps manually as outlined in the ReadMe and not through the script. The script is not meant to be edited.

startergo commented 3 years ago

What offending code was removed? Lost on that.

BTW, "sync manually" means literally do the sync steps manually as outlined in the ReadMe and not through the script. The script is not meant to be edited.

If you look at my fork you will see it is in sync with yours. I still get this error when executing the updater script. The error handling code halts the execution of the script.

dakanji commented 3 years ago

Still no idea what was edited and possible this is affecting things. Either way, once you have synced manually and not edited anything, you don't need to to run the sync script again.

startergo commented 3 years ago

Everything works fine if:

## ERROR HANDLER ##
runErr() { # $1: message
    # Declare Local Variables
    local errMessage

    errMessage="${1:-Runtime Error ... Exiting}"
    echo ''
    msg_error "${errMessage}"
    echo ''
    echo ''
    exit 1
}
trap runErr ERR

this code is gone. There must be some error there. Whenever it is present I get:

RepoUpdater.sh
Syncing RefindPlus
Already on 'GOPFix'
Your branch is up to date with 'origin/GOPFix'.
fatal: ambiguous argument '': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

Runtime Error ... Exiting
startergo commented 3 years ago

Every time I need to update the forks I have to remove this:

## ERROR HANDLER ##
runErr() { # $1: message
    # Declare Local Variables
    local errMessage

    errMessage="${1:-Runtime Error ... Exiting}"
    echo ''
    msg_error "${errMessage}"
    echo ''
    echo ''
    exit 1
}
trap runErr ERR
dakanji commented 3 years ago

That is treating a symptom as all that does is halt the script because of an actual error. Removing it does not fix the error that triggers it.

The actual error is emitted by git here: fatal: ambiguous argument '': unknown revision or path not in the working tree. There is something out of place in your git setup.

dakanji commented 3 years ago

Let me update the Reset SHA then do the sync manually as per the ReadMe. Things should be fine then.

EDIT: Updated as was possible that what was currently there was wrong Update your 000-BuildScript/RepoUpdateSHA.txt file with the current version manually and rerun the script.

PS: Specially setup to avoid issues with manual update which is not the typical case so not something to repeat.

dakanji commented 3 years ago

Sorry ... you might have issues with that.

Copy the script folder to your desktop, update RepoUpdateSHA.txt and run the script on the desktop. RepoUpdateSHA.txt in the git folder should not be changed.

startergo commented 3 years ago

So if I manually try to update and get this:

git pull upstream GOPFix
From https://github.com/dakanji/RefindPlus
 * branch            GOPFix     -> FETCH_HEAD
error: Your local changes to the following files would be overwritten by merge:
  EfiLib/AcquireGOP.c

.gitignore:

# Ignore RefindPlusPkg and Build items
/Build
!/Python/build/*
.Build-TMP/
cov-int/
000-BOOTx64-Files/
RefindPlusPkg/
000-Releases/
dakanji commented 3 years ago

See: https://github.com/dakanji/RefindPlusUDK/issues/8#issuecomment-804401110

Hang on. Spotted something.

dakanji commented 3 years ago

Run the attached from your desktop. Will fix the repo version later

startergo commented 3 years ago
/Users/MBP113/Desktop/RepoUpdater.sh 
Syncing RefindPlus
M   EfiLib/AcquireGOP.c
Already on 'GOPFix'
Your branch is up to date with 'origin/GOPFix'.
fatal: Could not parse object '986bb668c163a81be980cf79cf439faa68f8684b'.

Runtime Error ... Exiting
dakanji commented 3 years ago

Try this: RepoUpdater.sh.zip

You need to commit or discard your pending changes to EfiLib/AcquireGOP.c btw.

startergo commented 3 years ago

This one works like a charm. No need to commit/discard anything.