Add workflows chapter with page about channels
[?]
Dec 5, 2020, 11:20 AM
LYR3UWPMN2GBD5CKIB37RJM6TP5N5D4M2KF5VUZ2CIPTSPEISLBACDependencies
- [2]
SCSV2FNSReboot
Change contents
- file addition: workflows.md[2.6]
# WorkflowsTo give you a feeling of how `pijul` can be used in day-to-day situations, thischapter collects a couple of scenarios and how they can be solved with `pijul`.These scenarios hopefully also convey a way of thinking about Pijul concepts,such as your repository, remote repositories, channels, changes, merges etc.Most of these scenarios are taken from the Discourse forum hosted at`discourse.pijul.org`. - file addition: workflows[2.6]
- file addition: channels.md[0.451]
# Working with channels## What is a channelChannels are a way to maintain two related versions of a repository in the sameplace (a bit like branches in Git).Formally, a channel is a pointer to a set of changes (the state of a channel isa set of changes).However, channels are different from Git branches, and do not serve the samepurpose. In Pijul, independent changes commute, which means that in many caseswhere branches are used in Git, there is no need to create a channel in Pijul.The main differences with Git branches are:* The identity of a change doesn't depend on the branch it is on, or in otherwords, rebase and merge are the same operation in Pijul.* This implies that conflicts do not mysteriously come back after you solvethem (which is what git rerere is for).* Also, conflicts are between changes, so the resolution of a conflict on onechannel solves the same conflict in all other channels.## What you can do with channels### Creating a channelA channel is created by using `pijul fork <new-channel>`. A succeeding commanddoes not issue any output.### Listing channelsYou can get a list of all channels with `pijul channel`:```bashme@host ~/pijul-test \$ pijul channel* mainother```The currently active channel is marked with a `*` (asterisk).### Switching channelsTo work effectively with a channel, you need to be able to switch channels, sothat any changes you `pijul record` goes into the channel by default. This way,there is no chance of forgetting the `--channel` option, for example. Longstory short, to change the channel, use```bashme@host ~/pijul-test \$ pijul channel switch other```Do not expect any output here, no news is good news!### Merging channelsThere is no simple way to merge all changes from one channel into another. Thisbeing said, the usual workflow currently is:```bashme@host ~/pijul-test \$ pijul log --channel featureChange EXKC67TCSWSPRG4JP5AK2MYSRG6RCC3N5W3N62KESUUFN3FN6R4ACAuthor: []Date: 2020-11-14 02:06:21.014281963 UTCSome change...me@host ~/pijul-test \$ pijul apply EXKC67TCSWSPRG4JP5AK2MYSRG6RCC3N5W3N62KESUUFN3FN6R4AC```All changes this change depends upon will be applied as well.### Deleting and renaming channelsYou can delete a channel by using the command `pijul channel delete <channel>`.Rename it with `pijul channel rename [<old>] <new>`, where `<old>` is optionaland defaults to the current channel.NOTE: There seems to be a [bug](https://nest.pijul.com/pijul/pijul/discussions/163) (in 1.0.0-alpha.15) where the old channel isstill around after a rename. - edit in src/SUMMARY.md at line 18
- [Workflows](./workflows.md)- [Channels](./workflows/channels.md)