Skip to content

Fix Git error during project configuration#2971

Open
YoshiWalsh wants to merge 1 commit into
meshcore-dev:mainfrom
YoshiWalsh:fix/projectconfigurationgit
Open

Fix Git error during project configuration#2971
YoshiWalsh wants to merge 1 commit into
meshcore-dev:mainfrom
YoshiWalsh:fix/projectconfigurationgit

Conversation

@YoshiWalsh

Copy link
Copy Markdown

Previously project configuration would fail with "fatal: couldn't find remote ref d541301" (git v2.55.0)

This affected almost all platformio commands too. E.g.

 *  Executing task: platformio run --environment RAK_3401_repeater 

Processing RAK_3401_repeater (board: rak3401; platform: nordicnrf52; framework: arduino)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Tool Manager: Installing git+https://github.com/meshcore-dev/Adafruit_nRF52_Arduino#d541301
git version 2.55.0
hint: Using 'master' as the name for the initial branch. This default branch name
hint: will change to "main" in Git 3.0. To configure the initial branch name
hint: to use in all of your new repositories, which will suppress this warning,
hint: call:
hint:
hint:   git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint:   git branch -m <name>
hint:
hint: Disable this message with "git config set advice.defaultBranchName false"
Initialized empty Git repository in /root/.platformio/.cache/tmp/pkg-installing-wokqua5c/.git/
fatal: couldn't find remote ref d541301
VCSBaseException: VCS: Could not process command ['git', 'fetch', '--depth=1', 'origin', 'd541301']

Per https://git-scm.com/docs/git-fetch#Documentation/git-fetch.txt-refspec, the argument needs to be either a ref (read: branch or tag) or a "fully spelled hex object name". The error appears to have been caused by the partial hex.

This requirement is also mentioned in this SO answer: https://stackoverflow.com/a/30701724

After this change, project configuration now succeeds.

Previously project configuration would fail with "fatal: couldn't find remote ref d541301" (git v2.55.0)

Per https://git-scm.com/docs/git-fetch#Documentation/git-fetch.txt-refspec, the <src> needs to be either a ref or a "**fully spelled** hex object name"

This requirement is also mentioned in this SO answer: https://stackoverflow.com/a/30701724

After this change, project configuration now succeeds.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant