<div dir="ltr">Hello Markus<br><br>I don't have real-world experience with this, but I am not sure if changing branches and<br>distcleaning/recompiling is the most convenient workflow. I think I would prefer to have<br>multiple local repositories with different branches checked out. Thankfully git makes it<br>rather easy to have this.  E.g.:<br><br>1. You create two root directories. One for Python2 and one for Python3:<br><br>    mkdir /home/user/git/grass-p{2,3}<br><br>2. Create a virtualenv inside grass-p2 and grass-p3. E.g.:<br><br>    cd /home/user/git/grass-p2<br>    virtualenv -p python2 venv<br><br>    cd /home/user/git/grass-p2<br>    python3 -m venv venv<br><br>3. Clone the remote GRASS repo and name the local repo `dev`. You will only do this for `grass-p3`:<br><br>    cd /home/user/git/grass-p3<br>    git clone <a href="https://github.com/neteler/grass">https://github.com/neteler/grass</a> dev<br><br>5. For python 2 and for each release branch you will make a local git clone. This way<br>   you won't be wasting disk space. Read more about this<br>   [here](<a href="https://stackoverflow.com/questions/7187088/git-how-to-create-local-repo-with-symbolic-links-to-the-git-main-repo">https://stackoverflow.com/questions/7187088/git-how-to-create-local-repo-with-symbolic-links-to-the-git-main-repo</a>).<br><br>    cd /home/user/git/grass-p2<br>    git clone ../grass-p3/dev dev<br>    git clone ../grass-p3/dev r72<br>    git clone ../grass-p3/dev r74<br>    git clone ../grass-p3/dev r76<br><br>6. The dir structure should look like this:<br><br>    $ tree grass*<br><br>    grass-p2<br>    ├── dev<br>    ├── r72<br>    ├── r74<br>    ├── r76<br>    └── venv<br>    grass-p3<br>    ├── dev<br>    └── venv<br><br>7. On each release clone you need to checkout the respective branch:<br><br>    cd /home/user/git/grass-p2/r72 && git checkout releasebranch_7_2<br>    cd /home/user/git/grass-p2/r74 && git checkout releasebranch_7_4<br>    cd /home/user/git/grass-p2/r76 && git checkout releasebranch_7_6<br><br>7. Each directory is a full blown git repo. It is only by convention that 7.6 backports<br>   will happen in `r76` etc.  If you want to directly pull/push from/to github from the release<br>   directories, you will probably need to setup remotes. Regardless, setting up remotes<br>   etc should only be done once.<br><br>8. Obviously, when 7.8 gets released, two more directories will need to be added (one<br>   for python2  and one for python 3).<br><br>The benefit of this approach is that at least for trivial backports, you will not need<br>to recompile everything and, perhaps more importantly, you will not need to recompile<br>"master" in order to test a fix in 7.2.<br><br>all the best,<br>Panos<br><br>PS1. There are other ways to achieve something like this, e.g.<br>[`--singlebranch`](<a href="https://stackoverflow.com/a/1911126/592289">https://stackoverflow.com/a/1911126/592289</a>) but I don't see much<br>benefit.<br><br>PS2. You can optionally use something like [direnv](<a href="https://github.com/direnv/direnv">https://github.com/direnv/direnv</a>) to<br>automatically activate the virtualenvs when you cd into the corresponding directory.<br>This way there is no confusion WRT which python is active. I use this and it works<br>marvellously.<br><br><br></div>