'git repo upload' report errors when using latest-ok version
Closed this issue · 2 comments
guestliu commented
'Latest-ok version' is a version defined by a manifest file with revisions, like the following release.xml:
<manifest>
<remote name="origin" fetch=".." review="ssh://git@gitlab.alibaba-inc.com/"></remote>
<default remote="origin" revision="master" sync-j="8"></default>
<project name="alicpp2/test-repo1" path="test_repo1" revision="d3c878ac1786e5a6d31b4e8908010580e1f6e584" groups="holo" upstream="master"></project>
<project name="alicpp2/test-repo2" path="test_repo2" revision="c6d2fa67c86febc802896991414c34c67ea8ee44" groups="holo" upstream="master"></project>
</manifest>
Run the bash to get an error:
#!/bin/bash
SCRIPT_DIR="$(cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd)"
cd $SCRIPT_DIR
set -ex
rm -rf repo && mkdir -p repo
cd repo
git repo init -u git@gitlab.alibaba-inc.com:alicpp2/test-repo.git -m release.xml
git repo sync -j 32
git repo start my_patch --all
cd test_repo1
touch ZZZ
git add ZZZ
git commit -m 'a test commit'
echo xxx | git repo upload
Expect:
Run 'git repo upload' successfully when users work in a repo with latest-ok version.
jiangxin commented
It's not recommend to do like this. Projects with fixed revisions in a manifest.xml should not been changed. If you really want to so, we may:
- Define two revision for project in a manifest file. One revision is a fixed revision which is used for checking out the worktree, and another revision should point to a branch which used for user to upload changes.
- The worktree will never get chance to be updated, because of the fixed revision. Any changes synced from upstream in local worktree will be treated as changes need to be uploaded to upstream.
Is that what you want?
guestliu commented
It's not recommend to do like this. Projects with fixed revisions in a manifest.xml should not been changed. If you really want to so, we may:
- Define two revision for project in a manifest file. One revision is a fixed revision which is used for checking out the worktree, and another revision should point to a branch which used for user to upload changes.
- The worktree will never get chance to be updated, because of the fixed revision. Any changes synced from upstream in local worktree will be treated as changes need to be uploaded to upstream.
Is that what you want?
- Why 'git pr' works but 'git repo upload' fails?
- 'Define two revisions' does not make sense, one revision is the fixed revision and the next one is the newest revision on the branch which is always in change.
- 'The worktree will never get chance to be updated' is FALSE. The manifest file(latest_ok_release.xml) may be changed in the remote. When we run 'git repo sync' , we will sync a newest latest-ok version whose revisions are fixed.