gitslave
gitslave copied to clipboard
Support including and excluding by branch
It would be nice to be able to execute gits commands that only affected slaves on specific branches.
Let's say I have a master repository with the .gitslave file, and 5 slave repos.
Now I want to work on a feature that spans 3 of those repos, so I create a feature branch in them.
I would like to be able to gits commands that only affect the 3 repos i'm working on, e.g.:
gits --include-branch feature/XX-1234_my_feature commit -am "XX-1234: Added foo"
To make 3 commits instead of 6.
Since you only make changes in 3 of the repos, the other 3 won't have anything to commit. A total of 3 commits will be created, not 6.
gits add --all
gits commit -m "My new commit message"
gits --no-pager log --oneline
In case you made changes but don't want to include them, perhaps the --exclude SLAVE-REGEXP flag can help? See also --no-master. Note that if you have untracked/modified files in some repositories gits add might not work without --keep-going. Will add another comment with a test script showing example usage and some corner-cases (including some non-interactive scripting-specific errors).
Does that help?
Test script to show gits usage and corner-cases where gits might not want to continue, for example due to untracked/modified files.
Sets up a superproject and four slaves. Adds/modifies files across all repositories, but sometimes skips one or more of the superproject, slave 2, slave 4.
chmod +x issue-10.sh
./issue-10.sh |& tee log.txt
You can inspect the generated files and logs to see the effect of each step. Remove the temporary directories to rerun the tests.
rm -rf ./fake-remote/ ./local/
Some corner-cases are due to set -e (exit script if any command fails) and might not be as important for human terminal usage.
The script and logs turned out a lot longer than I had expected, but bear with me ;)
issue-10.sh
#!/usr/bin/env bash
set -e
set -u
set -o pipefail
# NOTE: set up super and slave repositories, with an initialized but empty master branch.
mkdir fake-remote
cd fake-remote
mkdir super
git -C super/ init --bare
git -C super/ --work-tree . checkout --orphan master
git -C super/ --work-tree . commit --allow-empty --message "Initalized repository super"
mkdir slave-01
git -C slave-01/ init --bare
git -C slave-01/ --work-tree . checkout --orphan master
git -C slave-01/ --work-tree . commit --allow-empty --message "Initalized repository slave-01"
mkdir slave-02
git -C slave-02/ init --bare
git -C slave-02/ --work-tree . checkout --orphan master
git -C slave-02/ --work-tree . commit --allow-empty --message "Initalized repository slave-02"
mkdir slave-03
git -C slave-03/ init --bare
git -C slave-03/ --work-tree . checkout --orphan master
git -C slave-03/ --work-tree . commit --allow-empty --message "Initalized repository slave-03"
mkdir slave-04
git -C slave-04/ init --bare
git -C slave-04/ --work-tree . checkout --orphan master
git -C slave-04/ --work-tree . commit --allow-empty --message "Initalized repository slave-04"
cd ..
# NOTE: clone the superproject and attach slaves.
git clone fake-remote/super ./local
cd local
gits prepare
gits attach ../slave-01 ./slave-01
gits attach ../slave-02 ./slave-02
gits attach ../slave-03 ./slave-03
gits attach ../slave-04 ./slave-04
gits push
# NOTE: add and commit an empty file to each repository (including the superproject).
echo -e "\n-------------- my-file-01.txt --------------\n"
gits exec touch my-file-01.txt
gits add my-file-01.txt
gits commit --message "Add my-file-01.txt"
gits --no-pager log --oneline --max-count 1
# NOTE: add and commit an empty file to each slave repository.
echo -e "\n-------------- my-file-02.txt --------------\n"
gits --no-master exec touch my-file-02.txt
gits --no-master add my-file-02.txt
gits --no-master commit --message "Add my-file-02.txt"
gits --no-pager log --oneline --max-count 1
# NOTE: add and commit an empty file to each repository (including the superproject) except slave-02 and slave-04.
echo -e "\n-------------- my-file-03.txt --------------\n"
gits --exclude 'slave-0[24]' exec touch my-file-03.txt
gits add --all
gits commit --message "Add my-file-03.txt"
gits --no-pager log --oneline --max-count 1
# NOTE: add and commit an empty file to each repository (including the superproject) except slave-02 and slave-04.
# NOTE: if the specific file/path is missing for a repository git will return exit code 1, which would stop further gits execution, so have to --keep-going.
# NOTE: gitslave considers an add with non-matching files a hard fail, so have to ignore it for the purpose of this test.
echo -e "\n-------------- my-file-04.txt --------------\n"
gits --exclude 'slave-0[24]' exec touch my-file-04.txt
gits --keep-going add my-file-04.txt || echo "TEST WARNING: ignoring partially failed gits add, because of non-matching files." >&2
gits commit --message "Add my-file-04.txt"
gits --no-pager log --oneline --max-count 1
# NOTE: add and commit an empty file to each repository (including the superproject).
# NOTE: there will be stray untracked files in slave-02 and slave-04.
# NOTE: empty commits with untracked files return exit code 1, which would stop further gits execution, so have to --keep-going.
# NOTE: gitslave considers a commit with untracked files a hard fail, so have to ignore it for the purpose of this test.
echo -e "\n-------------- my-file-05.txt --------------\n"
gits exec touch my-file-05.txt
gits --exclude 'slave-0[24]' add my-file-05.txt
gits --keep-going commit --message "Add my-file-05.txt" || echo "TEST WARNING: ignoring partially failed gits commit, because of untracked files." >&2
gits statuses
gits --no-pager log --oneline --max-count 1
# NOTE: there will be stray untracked my-file-05.txt files in slave-02 and slave-04.
# NOTE: aggressively clean up stray files.
# DANGEROUS: possible dataloss for any files/changes which have not been committed.
tree
gits reset :/
gits checkout :/
gits clean -fdx :/
tree
# NOTE: add and commit an empty file to each repository (including the superproject), then modify it and commit the changes except in slave-02 and slave-04..
# NOTE: there will be stray modified files in slave-02 and slave-04.
# NOTE: uses an sh hack to wrap the shell redirect.
# NOTE: empty commits with modified files return exit code 1, which would stop further gits execution, so have to --keep-going.
# NOTE: gitslave considers a commit with modified files a hard fail, so have to ignore it for the purpose of this test.
echo -e "\n-------------- my-file-06.txt --------------\n"
gits exec touch my-file-06.txt
gits add my-file-06.txt
gits commit --message "Add my-file-06.txt"
gits exec sh -c 'echo "Modified file in ${PWD}" > my-file-06.txt'
gits --exclude 'slave-0[24]' add my-file-06.txt
gits --keep-going commit --message "Modify my-file-06.txt" || echo "TEST WARNING: ignoring partially failed gits commit, because of modified files." >&2
gits statuses
gits --no-pager log --oneline --max-count 1
# NOTE: there will be stray modified my-file-06.txt files in slave-02 and slave-04.
# NOTE: aggressively clean up stray files.
# DANGEROUS: possible dataloss for any files/changes which have not been committed.
cat my-file-06.txt */my-file-06.txt
gits reset :/
gits checkout :/
gits clean -fdx :/
cat my-file-06.txt */my-file-06.txt
echo -e "\n-------------- End results --------------\n"
# NOTE: end result.
gits push
gits statuses
gits --no-pager log --oneline
Output from issue-10.sh
The stdin/stderr line output order might not be perfect.
Initialized empty Git repository in /home/joelpurra/development/tmp/gitslave/issues/10/02/fake-remote/super/
Switched to a new branch 'master'
[master (root-commit) 82934be] Initalized repository super
Initialized empty Git repository in /home/joelpurra/development/tmp/gitslave/issues/10/02/fake-remote/slave-01/
Switched to a new branch 'master'
[master (root-commit) da377e0] Initalized repository slave-01
Initialized empty Git repository in /home/joelpurra/development/tmp/gitslave/issues/10/02/fake-remote/slave-02/
Switched to a new branch 'master'
[master (root-commit) 1fa07c4] Initalized repository slave-02
Initialized empty Git repository in /home/joelpurra/development/tmp/gitslave/issues/10/02/fake-remote/slave-03/
Switched to a new branch 'master'
[master (root-commit) 173c43f] Initalized repository slave-03
Initialized empty Git repository in /home/joelpurra/development/tmp/gitslave/issues/10/02/fake-remote/slave-04/
Switched to a new branch 'master'
[master (root-commit) 0ecafe4] Initalized repository slave-04
Cloning into './local'...
done.
[master e3bb452] gits creating .gitslave
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 .gitslave
Cloning into './slave-01'...
done.
[master 66eed5d] gits adding "../slave-01" "./slave-01" (.gitignore)
1 file changed, 1 insertion(+)
create mode 100644 .gitignore
[master e17778f] gits adding "../slave-01" "./slave-01"
1 file changed, 1 insertion(+)
Cloning into './slave-02'...
done.
[master 0f2f09f] gits adding "../slave-02" "./slave-02" (.gitignore)
1 file changed, 1 insertion(+)
[master 761560f] gits adding "../slave-02" "./slave-02"
1 file changed, 1 insertion(+)
Cloning into './slave-03'...
done.
[master 9f33495] gits adding "../slave-03" "./slave-03" (.gitignore)
1 file changed, 1 insertion(+)
[master 27473a8] gits adding "../slave-03" "./slave-03"
1 file changed, 1 insertion(+)
Cloning into './slave-04'...
done.
[master 1a877a8] gits adding "../slave-04" "./slave-04" (.gitignore)
1 file changed, 1 insertion(+)
[master 4cc2450] gits adding "../slave-04" "./slave-04"
1 file changed, 1 insertion(+)
On: (local):
To /home/joelpurra/development/tmp/gitslave/issues/10/02/fake-remote/super
82934be..4cc2450 master -> master
On: ./slave-01, ./slave-02, ./slave-03, ./slave-04:
Everything up-to-date
-------------- my-file-01.txt --------------
There is a pathname in a generic gits command; this is a sign that the command
will not work since it is unlikely to exist in all repositories.
Probably you want to run a raw git command
On: ./slave-01:
[master b5afa79] Add my-file-01.txt
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 my-file-01.txt
On: ./slave-02:
[master 199b011] Add my-file-01.txt
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 my-file-01.txt
On: (local):
[master bd0b106] Add my-file-01.txt
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 my-file-01.txt
On: ./slave-03:
[master 49ba05b] Add my-file-01.txt
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 my-file-01.txt
On: ./slave-04:
[master 3b50085] Add my-file-01.txt
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 my-file-01.txt
On: ./slave-01:
b5afa79 Add my-file-01.txt
On: ./slave-02:
199b011 Add my-file-01.txt
On: ./slave-04:
3b50085 Add my-file-01.txt
On: ./slave-03:
49ba05b Add my-file-01.txt
On: (local):
bd0b106 Add my-file-01.txt
-------------- my-file-02.txt --------------
On: ./slave-01:
[master 5ac0b21] Add my-file-02.txt
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 my-file-02.txt
On: ./slave-04:
[master ae88edf] Add my-file-02.txt
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 my-file-02.txt
On: ./slave-03:
[master 37c2c78] Add my-file-02.txt
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 my-file-02.txt
On: ./slave-02:
[master 1c59946] Add my-file-02.txt
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 my-file-02.txt
On: ./slave-03:
37c2c78 Add my-file-02.txt
On: ./slave-01:
5ac0b21 Add my-file-02.txt
On: ./slave-02:
1c59946 Add my-file-02.txt
On: (local):
bd0b106 Add my-file-01.txt
On: ./slave-04:
ae88edf Add my-file-02.txt
-------------- my-file-03.txt --------------
On: (local):
[master 8bb76a0] Add my-file-03.txt
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 my-file-03.txt
On: ./slave-03:
[master c106a5b] Add my-file-03.txt
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 my-file-03.txt
On: ./slave-01:
[master 29fc94d] Add my-file-03.txt
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 my-file-03.txt
On: ./slave-02, ./slave-04:
# On branch master
# Your branch is ahead of 'origin/master' by 2 commits.
# (use "git push" to publish your local commits)
#
nothing to commit, working tree clean
On: (local):
8bb76a0 Add my-file-03.txt
On: ./slave-01:
29fc94d Add my-file-03.txt
On: ./slave-04:
ae88edf Add my-file-02.txt
On: ./slave-03:
c106a5b Add my-file-03.txt
On: ./slave-02:
1c59946 Add my-file-02.txt
-------------- my-file-04.txt --------------
There is a pathname in a generic gits command; this is a sign that the command
will not work since it is unlikely to exist in all repositories.
Probably you want to run a raw git command
Error in gits add, failed for: './slave-02': exit 128 (continuing)
fatal: pathspec 'my-file-04.txt' did not match any files
Error in gits add, failed for: './slave-04': exit 128 (continuing)
fatal: pathspec 'my-file-04.txt' did not match any files
TEST WARNING: ignoring partially failed gits add, because of non-matching files.
On: ./slave-01:
[master 7c6436d] Add my-file-04.txt
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 my-file-04.txt
On: ./slave-03:
[master c44fd67] Add my-file-04.txt
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 my-file-04.txt
On: (local):
[master fb5252e] Add my-file-04.txt
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 my-file-04.txt
On: ./slave-02, ./slave-04:
# On branch master
# Your branch is ahead of 'origin/master' by 2 commits.
# (use "git push" to publish your local commits)
#
nothing to commit, working tree clean
On: ./slave-03:
c44fd67 Add my-file-04.txt
On: ./slave-01:
7c6436d Add my-file-04.txt
On: (local):
fb5252e Add my-file-04.txt
On: ./slave-04:
ae88edf Add my-file-02.txt
On: ./slave-02:
1c59946 Add my-file-02.txt
-------------- my-file-05.txt --------------
There is a pathname in a generic gits command; this is a sign that the command
will not work since it is unlikely to exist in all repositories.
Probably you want to run a raw git command
Error in gits commit, failed for: './slave-02': exit 1 (continuing)
# On branch master
# Your branch is ahead of 'origin/master' by 2 commits.
# (use "git push" to publish your local commits)
#
# Untracked files:
# my-file-05.txt
#
nothing added to commit but untracked files present
Error in gits commit, failed for: './slave-04': exit 1 (continuing)
# On branch master
# Your branch is ahead of 'origin/master' by 2 commits.
# (use "git push" to publish your local commits)
#
# Untracked files:
# my-file-05.txt
#
nothing added to commit but untracked files present
On: (local):
[master 4c7e4c6] Add my-file-05.txt
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 my-file-05.txt
On: ./slave-01:
[master e7e91ac] Add my-file-05.txt
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 my-file-05.txt
On: ./slave-03:
[master a302dfa] Add my-file-05.txt
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 my-file-05.txt
TEST WARNING: ignoring partially failed gits commit, because of untracked files.
# On branch master
On: (local):
# Your branch is ahead of 'origin/master' by 4 commits.
# (use "git push" to publish your local commits)
#
nothing to commit, working tree clean
On: ./slave-02, ./slave-04:
# Your branch is ahead of 'origin/master' by 2 commits.
# (use "git push" to publish your local commits)
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# my-file-05.txt
#
On: ./slave-01, ./slave-03:
# Your branch is ahead of 'origin/master' by 5 commits.
# (use "git push" to publish your local commits)
#
nothing to commit, working tree clean
On: ./slave-02:
1c59946 Add my-file-02.txt
On: ./slave-03:
a302dfa Add my-file-05.txt
On: ./slave-01:
e7e91ac Add my-file-05.txt
On: (local):
4c7e4c6 Add my-file-05.txt
On: ./slave-04:
ae88edf Add my-file-02.txt
.
├── my-file-01.txt
├── my-file-03.txt
├── my-file-04.txt
├── my-file-05.txt
├── slave-01
│ ├── my-file-01.txt
│ ├── my-file-02.txt
│ ├── my-file-03.txt
│ ├── my-file-04.txt
│ └── my-file-05.txt
├── slave-02
│ ├── my-file-01.txt
│ ├── my-file-02.txt
│ └── my-file-05.txt
├── slave-03
│ ├── my-file-01.txt
│ ├── my-file-02.txt
│ ├── my-file-03.txt
│ ├── my-file-04.txt
│ └── my-file-05.txt
└── slave-04
├── my-file-01.txt
├── my-file-02.txt
└── my-file-05.txt
4 directories, 20 files
Removing slave-02/my-file-05.txt
Removing slave-04/my-file-05.txt
.
├── my-file-01.txt
├── my-file-03.txt
├── my-file-04.txt
├── my-file-05.txt
├── slave-01
│ ├── my-file-01.txt
│ ├── my-file-02.txt
│ ├── my-file-03.txt
│ ├── my-file-04.txt
│ └── my-file-05.txt
├── slave-02
│ ├── my-file-01.txt
│ └── my-file-02.txt
├── slave-03
│ ├── my-file-01.txt
│ ├── my-file-02.txt
│ ├── my-file-03.txt
│ ├── my-file-04.txt
│ └── my-file-05.txt
└── slave-04
├── my-file-01.txt
└── my-file-02.txt
4 directories, 18 files
-------------- my-file-06.txt --------------
There is a pathname in a generic gits command; this is a sign that the command
will not work since it is unlikely to exist in all repositories.
Probably you want to run a raw git command
On: ./slave-04:
[master 8e195eb] Add my-file-06.txt
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 my-file-06.txt
On: ./slave-01:
[master 62ec8f8] Add my-file-06.txt
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 my-file-06.txt
On: ./slave-02:
[master a3176ef] Add my-file-06.txt
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 my-file-06.txt
On: (local):
[master 8d4cbca] Add my-file-06.txt
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 my-file-06.txt
On: ./slave-03:
[master 6b01b39] Add my-file-06.txt
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 my-file-06.txt
There is a pathname in a generic gits command; this is a sign that the command
will not work since it is unlikely to exist in all repositories.
Probably you want to run a raw git command
Error in gits commit, failed for: './slave-02': exit 1 (continuing)
# On branch master
# Your branch is ahead of 'origin/master' by 3 commits.
# (use "git push" to publish your local commits)
#
# Changes not staged for commit:
# modified: my-file-06.txt
#
no changes added to commit
Error in gits commit, failed for: './slave-04': exit 1 (continuing)
# On branch master
# Your branch is ahead of 'origin/master' by 3 commits.
# (use "git push" to publish your local commits)
#
# Changes not staged for commit:
# modified: my-file-06.txt
#
no changes added to commit
On: ./slave-01:
[master c1b79f2] Modify my-file-06.txt
1 file changed, 1 insertion(+)
On: ./slave-03:
[master ab51521] Modify my-file-06.txt
1 file changed, 1 insertion(+)
On: (local):
[master 050fd37] Modify my-file-06.txt
1 file changed, 1 insertion(+)
TEST WARNING: ignoring partially failed gits commit, because of modified files.
# On branch master
On: (local):
# Your branch is ahead of 'origin/master' by 6 commits.
# (use "git push" to publish your local commits)
#
nothing to commit, working tree clean
On: ./slave-02, ./slave-04:
# Your branch is ahead of 'origin/master' by 3 commits.
# (use "git push" to publish your local commits)
#
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: my-file-06.txt
#
On: ./slave-01, ./slave-03:
# Your branch is ahead of 'origin/master' by 7 commits.
# (use "git push" to publish your local commits)
#
nothing to commit, working tree clean
On: ./slave-01:
c1b79f2 Modify my-file-06.txt
On: ./slave-02:
a3176ef Add my-file-06.txt
On: ./slave-04:
8e195eb Add my-file-06.txt
On: (local):
050fd37 Modify my-file-06.txt
On: ./slave-03:
ab51521 Modify my-file-06.txt
Modified file in /home/joelpurra/development/tmp/gitslave/issues/10/02/local
Modified file in /home/joelpurra/development/tmp/gitslave/issues/10/02/local/slave-01
Modified file in /home/joelpurra/development/tmp/gitslave/issues/10/02/local/slave-02
Modified file in /home/joelpurra/development/tmp/gitslave/issues/10/02/local/slave-03
Modified file in /home/joelpurra/development/tmp/gitslave/issues/10/02/local/slave-04
On: ./slave-02, ./slave-04:
Unstaged changes after reset:
M my-file-06.txt
On: (local), ./slave-01, ./slave-03:
Modified file in /home/joelpurra/development/tmp/gitslave/issues/10/02/local
Modified file in /home/joelpurra/development/tmp/gitslave/issues/10/02/local/slave-01
Modified file in /home/joelpurra/development/tmp/gitslave/issues/10/02/local/slave-03
-------------- End results --------------
On: ./slave-04:
To /home/joelpurra/development/tmp/gitslave/issues/10/02/fake-remote/slave-04
0ecafe4..8e195eb master -> master
On: ./slave-01:
To /home/joelpurra/development/tmp/gitslave/issues/10/02/fake-remote/slave-01
da377e0..c1b79f2 master -> master
On: (local):
To /home/joelpurra/development/tmp/gitslave/issues/10/02/fake-remote/super
4cc2450..050fd37 master -> master
On: ./slave-03:
To /home/joelpurra/development/tmp/gitslave/issues/10/02/fake-remote/slave-03
173c43f..ab51521 master -> master
On: ./slave-02:
To /home/joelpurra/development/tmp/gitslave/issues/10/02/fake-remote/slave-02
1fa07c4..a3176ef master -> master
# On branch master
On: (local), ./slave-01, ./slave-02, ./slave-03, ./slave-04:
# Your branch is up to date with 'origin/master'.
nothing to commit, working tree clean
On: ./slave-01:
c1b79f2 Modify my-file-06.txt
62ec8f8 Add my-file-06.txt
e7e91ac Add my-file-05.txt
7c6436d Add my-file-04.txt
29fc94d Add my-file-03.txt
5ac0b21 Add my-file-02.txt
b5afa79 Add my-file-01.txt
da377e0 Initalized repository slave-01
On: ./slave-04:
8e195eb Add my-file-06.txt
ae88edf Add my-file-02.txt
3b50085 Add my-file-01.txt
0ecafe4 Initalized repository slave-04
On: (local):
050fd37 Modify my-file-06.txt
8d4cbca Add my-file-06.txt
4c7e4c6 Add my-file-05.txt
fb5252e Add my-file-04.txt
8bb76a0 Add my-file-03.txt
bd0b106 Add my-file-01.txt
4cc2450 gits adding "../slave-04" "./slave-04"
1a877a8 gits adding "../slave-04" "./slave-04" (.gitignore)
27473a8 gits adding "../slave-03" "./slave-03"
9f33495 gits adding "../slave-03" "./slave-03" (.gitignore)
761560f gits adding "../slave-02" "./slave-02"
0f2f09f gits adding "../slave-02" "./slave-02" (.gitignore)
e17778f gits adding "../slave-01" "./slave-01"
66eed5d gits adding "../slave-01" "./slave-01" (.gitignore)
e3bb452 gits creating .gitslave
82934be Initalized repository super
On: ./slave-02:
a3176ef Add my-file-06.txt
1c59946 Add my-file-02.txt
199b011 Add my-file-01.txt
1fa07c4 Initalized repository slave-02
On: ./slave-03:
ab51521 Modify my-file-06.txt
6b01b39 Add my-file-06.txt
a302dfa Add my-file-05.txt
c44fd67 Add my-file-04.txt
c106a5b Add my-file-03.txt
37c2c78 Add my-file-02.txt
49ba05b Add my-file-01.txt
173c43f Initalized repository slave-03
Thanks for the feedback! I'll have a look and see if it solves my issue. The main annoyance is that I often have 10 slave repos, and due to the structure of the code, changes usually affect 2 or 3 repos. Those 3 are on the same branch, while the rest are on a mixture of master and other branches. Trouble arises when I for one reason or another have uncommitted changes in the stuff I'm not working on, and I accidentally commit it. The fix might be to be more rigid about not working on more than one feature/branch at a time ...
Yes, I'd say that the ordinary gitslave workflow assumes that you use gits to create/checkout/delete branches and to "stay consistent" in general. It's of course not easy to always be disciplined and work on only one feature at a time, but with or without gitslave mixing features can lead to trouble ;)