Open Lecrapouille opened 2 years ago
The workflow looks like this. Say you want to add a new repo, named bar and you already have:
repos:
- url: git@github.com:dmerejkowsky/foo.git
dest: foo
- url: git@github.com:dmerejkowsky/dummy-manifest.git
dest: manifest
tsrc init
so that 'foo' and 'manifest' are cloned in their respective folders<workspace>/manifest/manifest.yml
to add the new repo: - url: git@github.com:dmerejkowsky/foo.git
dest: foo
+
+ - url: git@github.com:dmerejkowsky/bar.git
+ dest: bar
tsrc apply-manifest <workspace/manifest/manifest.yml
to make sure your changes are correct add-bar
add-bar
branch into the master branch of the manifesttsrc sync
. .tsc/manifest
is updatedapply-manifest
no new repo is clonedmanifest/manifest
is not updated because it's on the branch add-bar
and it should be on master
cd <workspace>/manifest ; git checkout master
tsrc did not switch to the branch to master. Not sure why !
That's expected. See the relevant documentation
@dmerejkowsky thank you for confirming that we can call apply-manifest inside the workspace but not necessary have to be applied from a manifest outside the workspace. The documentation was unclear on this point and you should include your example to remove any confusion.
Sorry for my poor English. In fact, I wanted to say that I tried two different things:
First thing:
Inital workspace/manifest/manifest.yml:
repos:
- url: git@github.com:dmerejkowsky/foo.git
dest: foo
If I add a new repo bar:
repos:
- url: git@github.com:dmerejkowsky/foo.git
dest: foo
- url: git@github.com:dmerejkowsky/bar.git
dest: bar
The command tsrc apply-manifest workspace/manifest/manifest.yml
will git clone the bar/ repo.
Ok so far so good :) but :
Second thing:
Inital workspace/manifest/manifest.yml. Initial repo (repo foo with branch dev-foo):
repos:
- url: git@github.com:dmerejkowsky/foo.git
branch: dev-foo
dest: foo
Change the branch of repo foo to follow master:
repos:
- url: git@github.com:dmerejkowsky/foo.git
dest: foo
The foo repo is not dirty ! Even if I commit (or not) workspace/manifest/manifest.yml in local (your step 3.) when I call tsrc apply-manifest workspace/manifest/manifest.yml
the branch is not switched. Do you consider that I'm on the case described by your documentation in case the repository is on an incorrect branch, the fast-forward merge will still be attempted, but an error message will be show in the end
because tsrc does not print error (echo $? is 0) and there is no possible conflict because the repo is clean and the switch to the branch is possible (git checkout works). But it stays to the dev-foo branch.
Environment
tsrc version
: 2.5.0Hi ! Close question to this topic https://github.com/dmerejkowsky/tsrc/issues/279
The documentation could be updated to clarify the following incertitude. I was questioning myself concerning https://dmerejkowsky.github.io/tsrc/guide/manifest/ with sections "Using the apply-manifest command to avoid breaking developers' workflow" and "Additional notes".
Is:
(described in Additional notes)
Compatible with this command:
? (described in Using the apply-manifest command to avoid breaking developers' workflow
In other way: is the command
tsrc apply-manifest
works fine when the git repository holding the manifest is inside the workspace installed bytsrc init
?The answer seems to be yes, but this is not obvious because
manifest/manifest.yml
is dirty iand it will update.tsrc/xxx/manifest.yml
which will try to updatemanifest/manifest.yml
(but since dirty tsrc will not try to update ... or failed).I tried two things:
branch: dev-foo
and calltsrc apply-manifest manifest/manifest.yml
no error but tsrc did not switch to the branch to master. Not sure why !