tsrc
tsrc copied to clipboard
tsrc generate a manifest of current sha1 or branches
Given the current config of all repositories, I would like to create a manifest made of sha1 or made of current branches...
Right now, is it possible to do so?
If not, I guess it should not be complicated to do such a feature, but I am not really sure how users would call it?
Well, we could call it 'snapshot'.
You could run tsrc snapshot -o snapshot.yml
It would generate a file looking like:
# just an integer we can bump if we change our mind about the syntax
format: 1
repos:
- src: foo
url: [email protected]:foo
branch: master
sha1: abfe123
# optional: commit message and author ?
- src: bar
...
manifest:
url: [email protected]:manifest
branch: master
sha1: 124bef6
And then later on you could run:
$ tsrc reset --snapshot /path/to/snapshot
Regarding the format, if you want to add one integer in the yml, it should also appear in the manifest.yml provided to start/init with, right?
snapshot sounds great!
How about:
tsrc snapshot -bwhich would by default make a snapshot to replace manifest.yml with branches to te tracked?tsrc snapshot -b -m /path/snapshot.ymlit would save to a given file with branches to be tracked?tsrc snapshot -c -m /path/snapshot.ymlit would save to a given file with only sha1?tsrc snapshot -b -c -m /path/snapshot.ymlit would save to a given file with branch and sha1? (Although this one does not make much sense since you would checkout a sha1 which could be on any branch)
I like tsrc reset and tsrc reset --snapshot, but also it would be great to be able to init from a given snapshot file:
$ tsrc init <url> -m snapshot.yml
$ tsrc init -m /path/to/snapshot.yml
And if we could log/diff from a given snapshot.
I have just realized that it is also linked to the groups you have checked out/cloned locally...
What do you think?
I'm not sure I understand the difference between tsrc snapshot -b and tsrc snapshot -b -m. Could you elaborate ?
Otherwise, all of this looks like nice features to have, but I'm afraid the CLI is going to become quite complicated if we are not careful.
I think the best way to move forward is to list all the use cases and look for generic solutions that can satisfy them.
If you do not specify any manifest file by the means of -m, (i.e. by default) it will replace the default one (which is supposed to be .tsrc/manifest/manifest.yml?)
Oh I see. Thanks for the clarification
I'm quite interested in implementing this. Is there anyone else here interesting collaborating or dog-fooding?
Our specific use-case is building a release from a snapshot.yaml in a manner that is completely reproducable in future. Subsequent releases can simply reset to the snapshot and advance relevant repos forward. Our preference is not to pollute all the repos with product-specific tags.