Page 1 of 1

[SOLVED] Am I on master or develop?

Posted: June 10th, 2017, 3:56 am
by OneCD
Hi all,

Upgraded from 2.0.1 to 2.1.0 earlier today, and now I seem to be on the 'develop' branch.

Code: Select all

2017-06-10 17:14:55,891::INFO::[SABnzbd:1170] --------------------------------
2017-06-10 17:14:55,892::INFO::[SABnzbd:1171] SABnzbd.py-2.1.0-develop (rev=unknown)
2017-06-10 17:14:55,893::INFO::[SABnzbd:1172] Full executable path = /share/MD0_DATA/.qpkg/SABnzbdplus/SABnzbdplus/SABnzbd.py
2017-06-10 17:14:55,893::INFO::[SABnzbd:1184] Platform = posix
2017-06-10 17:14:55,894::INFO::[SABnzbd:1185] Python-version = 2.7.13 (default, Apr 24 2017, 15:51:42) 
[GCC 6.3.0]
... or am I???

Code: Select all

[/share/MD0_DATA/.qpkg/SABnzbdplus/SABnzbdplus] # git branch
  develop
* master
Afraid this is going to need knowledge of Git branches that I lack. My own small projects only have a master branch, so I haven't learned how to navigate and change branches properly.

Can anyone advise how I can get back onto the 'master' branch?

Thank you.

Re: Am I on master or develop?

Posted: June 10th, 2017, 7:10 am
by safihre
How about doing another pull on the master branch? Because about half an hour later I pushed a commit that sets the version.

Re: Am I on master or develop?

Posted: June 10th, 2017, 12:29 pm
by OneCD
Thanks @safihre.

I stopped SAB then ran:

Code: Select all

[/share/MD0_DATA/.qpkg/SABnzbdplus/SABnzbdplus] # git pull
Already up-to-date.
... then restarted SAB. No change.

Also tried a complete reinstall. Same thing. SAB says develop, but Git says master. ???

Re: Am I on master or develop?

Posted: June 10th, 2017, 12:47 pm
by OneCD
More info: I did some mucking about after that last re-install - which seems to have resulted in the master message in my OP.

Here's a new install only completed a couple of minutes ago:

Code: Select all

[/share/MD0_DATA/.qpkg/SABnzbdplus/SABnzbdplus] # git branch
* develop
... which now looks accurate, but is still not where I'd like to be.

Just in case it is relevant, here's the basics of what I'm using to pull SAB:

Code: Select all

GIT_HTTP_URL="http://github.com/sabnzbd/sabnzbd.git"
GIT_HTTPS_URL=${GIT_HTTP_URL/http/git}

[ -d "${QPKG_GIT_PATH}/.git" ] || $GIT_CMD clone --depth 1 "$GIT_HTTPS_URL" "$QPKG_GIT_PATH" || $GIT_CMD clone --depth 1 "$GIT_HTTP_URL" "$QPKG_GIT_PATH"
cd "$QPKG_GIT_PATH" && $GIT_CMD pull && /bin/sync
Also looks like there is no remote 'master' branch?

Code: Select all

[/share/MD0_DATA/.qpkg/SABnzbdplus/SABnzbdplus] # git branch -a
* develop
  remotes/origin/HEAD -> origin/develop
  remotes/origin/develop

Re: Am I on master or develop?

Posted: June 10th, 2017, 2:00 pm
by safihre
I'm not sure how that's possible.. As you see on github there's clearly a master branch and there the version is fixed to 2.1.0.

Re: Am I on master or develop?

Posted: June 10th, 2017, 2:27 pm
by OneCD
Agreed, it shows here too:

Code: Select all

[/share/MD0_DATA/.qpkg/SABnzbdplus/SABnzbdplus] # git ls-remote --heads origin
5ecbf795afffeae9b722c2e3af19db5a4e8ad051        refs/heads/0.6.x
1df2943d05d64915a166e2c97e1eef86f72e3ff3        refs/heads/0.7.x
927ba3cd9d330a74fbdfc8d926f9cbc6aee764af        refs/heads/1.0.x
527a03ee973d1deabd166ec4e74029f426288867        refs/heads/1.1.x
d34e14370c49080b950e390904311f0f5e92b657        refs/heads/1.2.x
e69eeebdd8dfaab47ff412baa88a72aeef84c2a4        refs/heads/2.0.x
61a6cb6d96600d858cfb200e0da5baf581b01d57        refs/heads/develop
84dec96038ff87605803ddadd4c27ec211a6bcb3        refs/heads/feature/2to3
6dbe57e2df811240d0db473eeb85f9c585508522        refs/heads/feature/slots
4605c3fd306b5f5a909d28fce0f8038b316eec03        refs/heads/master
How do I switch to master?

Code: Select all

[/share/MD0_DATA/.qpkg/SABnzbdplus/SABnzbdplus] # git checkout master
error: pathspec 'master' did not match any file(s) known to git.

Re: Am I on master or develop?

Posted: June 10th, 2017, 2:59 pm
by OneCD
I think I might have worked it out (in my stumbling-around-in-the-dark fashion). ;)

Code: Select all

[/share/MD0_DATA/.qpkg/SABnzbdplus/SABnzbdplus] # git branch
* develop
[/share/MD0_DATA/.qpkg/SABnzbdplus/SABnzbdplus] # git fetch
[/share/MD0_DATA/.qpkg/SABnzbdplus/SABnzbdplus] # cd .git

Code: Select all

[/share/MD0_DATA/.qpkg/SABnzbdplus/SABnzbdplus/.git] # cat config 
[core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
[remote "origin"]
        url = git://github.com/sabnzbd/sabnzbd.git
        fetch = +refs/heads/develop:refs/remotes/origin/develop
[branch "develop"]
        remote = origin
        merge = refs/heads/develop

Code: Select all

[/share/MD0_DATA/.qpkg/SABnzbdplus/SABnzbdplus/.git] # cp config config.bak
[/share/MD0_DATA/.qpkg/SABnzbdplus/SABnzbdplus/.git] # sed -i 's|develop|master|g' config
[/share/MD0_DATA/.qpkg/SABnzbdplus/SABnzbdplus/.git] # cat config
[core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
[remote "origin"]
        url = git://github.com/sabnzbd/sabnzbd.git
        fetch = +refs/heads/master:refs/remotes/origin/master
[branch "master"]
        remote = origin
        merge = refs/heads/master

Code: Select all

[/share/MD0_DATA/.qpkg/SABnzbdplus/SABnzbdplus/.git] # cd ..
[/share/MD0_DATA/.qpkg/SABnzbdplus/SABnzbdplus] # git pull
remote: Counting objects: 46069, done.
remote: Compressing objects: 100% (12277/12277), done.
remote: Total 46069 (delta 31528), reused 45723 (delta 31183), pack-reused 0
Receiving objects: 100% (46069/46069), 91.73 MiB | 772.00 KiB/s, done.
Resolving deltas: 100% (31528/31528), completed with 243 local objects.
From git://github.com/sabnzbd/sabnzbd
 * [new branch]        master     -> origin/master
 * [new tag]           2.1.0      -> 2.1.0
 * [new tag]           0.6.0       -> 0.6.0
 * [new tag]           0.6.1       -> 0.6.1
 * [new tag]           0.6.2       -> 0.6.2
 * [new tag]           0.6.3       -> 0.6.3
 * [new tag]           0.6.4       -> 0.6.4
 * [new tag]           0.6.5       -> 0.6.5
 * [new tag]           0.6.6       -> 0.6.6
 * [new tag]           0.6.7       -> 0.6.7
 * [new tag]           0.6.8       -> 0.6.8
 * [new tag]           0.6.8RC1    -> 0.6.8RC1
 * [new tag]           0.6.9       -> 0.6.9
 * [new tag]           0.6.9RC1    -> 0.6.9RC1
 * [new tag]           0.6.9RC2    -> 0.6.9RC2
 * [new tag]           0.7.0       -> 0.7.0
 * [new tag]           0.7.0Alpha1 -> 0.7.0Alpha1
 * [new tag]           0.7.0Alpha2 -> 0.7.0Alpha2
 * [new tag]           0.7.0Alpha3 -> 0.7.0Alpha3
 * [new tag]           0.7.0Beta1  -> 0.7.0Beta1
 * [new tag]           0.7.0Beta2  -> 0.7.0Beta2
 * [new tag]           0.7.0Beta3  -> 0.7.0Beta3
 * [new tag]           0.7.0Beta4  -> 0.7.0Beta4
 * [new tag]           0.7.0Beta5  -> 0.7.0Beta5
 * [new tag]           0.7.0Beta6  -> 0.7.0Beta6
 * [new tag]           0.7.0Beta7  -> 0.7.0Beta7
 * [new tag]           0.7.0Beta8  -> 0.7.0Beta8
 * [new tag]           0.7.0RC1    -> 0.7.0RC1
 * [new tag]           0.7.0RC2    -> 0.7.0RC2
 * [new tag]           0.7.1       -> 0.7.1
 * [new tag]           0.7.10      -> 0.7.10
 * [new tag]           0.7.10RC1   -> 0.7.10RC1
 * [new tag]           0.7.11      -> 0.7.11
 * [new tag]           0.7.11RC1   -> 0.7.11RC1
 * [new tag]           0.7.11RC2   -> 0.7.11RC2
 * [new tag]           0.7.1RC1    -> 0.7.1RC1
 * [new tag]           0.7.1RC2    -> 0.7.1RC2
 * [new tag]           0.7.1RC3    -> 0.7.1RC3
 * [new tag]           0.7.1RC4    -> 0.7.1RC4
 * [new tag]           0.7.1RC5    -> 0.7.1RC5
 * [new tag]           0.7.2       -> 0.7.2
 * [new tag]           0.7.2RC1    -> 0.7.2RC1
 * [new tag]           0.7.2RC2    -> 0.7.2RC2
 * [new tag]           0.7.3       -> 0.7.3
 * [new tag]           0.7.3Beta1  -> 0.7.3Beta1
 * [new tag]           0.7.3Beta2  -> 0.7.3Beta2
 * [new tag]           0.7.3RC1    -> 0.7.3RC1
 * [new tag]           0.7.4       -> 0.7.4
 * [new tag]           0.7.4Beta1  -> 0.7.4Beta1
 * [new tag]           0.7.4Beta2  -> 0.7.4Beta2
 * [new tag]           0.7.4Beta3  -> 0.7.4Beta3
 * [new tag]           0.7.4RC1    -> 0.7.4RC1
 * [new tag]           0.7.4RC2    -> 0.7.4RC2
 * [new tag]           0.7.5       -> 0.7.5
 * [new tag]           0.7.5RC1    -> 0.7.5RC1
 * [new tag]           0.7.6       -> 0.7.6
 * [new tag]           0.7.6Beta1  -> 0.7.6Beta1
 * [new tag]           0.7.6Beta2  -> 0.7.6Beta2
 * [new tag]           0.7.6Final  -> 0.7.6Final
 * [new tag]           0.7.7       -> 0.7.7
 * [new tag]           0.7.8       -> 0.7.8
 * [new tag]           0.7.8RC1    -> 0.7.8RC1
 * [new tag]           0.7.9       -> 0.7.9
 * [new tag]           0.7.9RC1    -> 0.7.9RC1
 * [new tag]           0.8.0Alpha1 -> 0.8.0Alpha1
 * [new tag]           0.8.0Alpha2 -> 0.8.0Alpha2
 * [new tag]           0.8.0Beta1  -> 0.8.0Beta1
 * [new tag]           0.8.0Beta2  -> 0.8.0Beta2
 * [new tag]           0.8.0Beta3  -> 0.8.0Beta3
 * [new tag]           0.8.0Beta4  -> 0.8.0Beta4
 * [new tag]           0.8.0Beta5  -> 0.8.0Beta5
 * [new tag]           0.8.0Beta6  -> 0.8.0Beta6
 * [new tag]           1.0.0       -> 1.0.0
 * [new tag]           1.0.0RC1    -> 1.0.0RC1
 * [new tag]           1.0.0RC2    -> 1.0.0RC2
 * [new tag]           1.0.0RC3    -> 1.0.0RC3
 * [new tag]           1.0.0RC4    -> 1.0.0RC4
 * [new tag]           1.0.0RC5    -> 1.0.0RC5
 * [new tag]           1.0.1       -> 1.0.1
 * [new tag]           1.0.1RC1    -> 1.0.1RC1
 * [new tag]           1.0.2       -> 1.0.2
 * [new tag]           1.0.3       -> 1.0.3
 * [new tag]           1.1.0       -> 1.1.0
 * [new tag]           1.1.0Beta1  -> 1.1.0Beta1
 * [new tag]           1.1.0RC1    -> 1.1.0RC1
 * [new tag]           1.1.0RC2    -> 1.1.0RC2
 * [new tag]           1.1.0RC3    -> 1.1.0RC3
 * [new tag]           1.1.0RC4    -> 1.1.0RC4
 * [new tag]           1.2.0       -> 1.2.0
 * [new tag]           1.2.0Beta1  -> 1.2.0Beta1
 * [new tag]           1.2.0RC1    -> 1.2.0RC1
 * [new tag]           1.2.1       -> 1.2.1
 * [new tag]           1.2.1Beta1  -> 1.2.1Beta1
 * [new tag]           1.2.1RC1    -> 1.2.1RC1
 * [new tag]           1.2.2       -> 1.2.2
 * [new tag]           1.2.3       -> 1.2.3
 * [new tag]           2.0.0       -> 2.0.0
 * [new tag]           2.0.0Alpha1 -> 2.0.0Alpha1
 * [new tag]           2.0.0Beta1  -> 2.0.0Beta1
 * [new tag]           2.0.0RC1    -> 2.0.0RC1
 * [new tag]           2.0.0RC2    -> 2.0.0RC2
 * [new tag]           2.0.0RC3    -> 2.0.0RC3
 * [new tag]           2.0.1       -> 2.0.1
 * [new tag]           2.0.1RC1    -> 2.0.1RC1
 * [new tag]           2.0.1RC2    -> 2.0.1RC2
Updating 61a6cb6d..4605c3fd
Fast-forward
 interfaces/smpl/templates/static/MochiKit/MochiKit.js    | 16146 +++++++++++++++++++++++++++++------------------------------
 interfaces/smpl/templates/static/MochiKit/__package__.js |     4 +-
 licenses/License-pynewsleecher.txt                       |    22 +-
 licenses/License-systrayicon.txt                         |    16 +-
 sabnzbd/version.py                                       |     4 +-
 scripts/Sample-PostProc.cmd                              |    30 +-
 6 files changed, 8111 insertions(+), 8111 deletions(-)

Code: Select all

[/share/MD0_DATA/.qpkg/SABnzbdplus/SABnzbdplus] # git checkout master
Branch master set up to track remote branch master from origin.
Switched to a new branch 'master'
Your branch is up-to-date with 'origin/master'.
[/share/MD0_DATA/.qpkg/SABnzbdplus/SABnzbdplus] # git branch
  develop
* master
Then a:

Code: Select all

[/share/MD0_DATA/.qpkg/SABnzbdplus/SABnzbdplus] # /etc/init.d/sabnzbd.sh start
And everything now looks fine.

Code: Select all

2017-06-11 05:56:20,724::INFO::[SABnzbd:1170] --------------------------------
2017-06-11 05:56:20,725::INFO::[SABnzbd:1171] SABnzbd.py-2.1.0 (rev=<HASH>4989a6300ec458c)
2017-06-11 05:56:20,725::INFO::[SABnzbd:1172] Full executable path = /share/MD0_DATA/.qpkg/SABnzbdplus/SABnzbdplus/SABnzbd.py
2017-06-11 05:56:20,726::INFO::[SABnzbd:1184] Platform = posix
2017-06-11 05:56:20,726::INFO::[SABnzbd:1185] Python-version = 2.7.13 (default, Apr 24 2017, 15:51:42) 
[GCC 6.3.0]
Another one solved. Thanks @safihre. 8)

Re: [SOLVED] Am I on master or develop?

Posted: June 12th, 2017, 2:03 am
by OneCD
Then today, I find that it's possible to specify the required branch when cloning:

Code: Select all

[/share/Public] # git clone -b master --depth 1 https://[email protected]/sabnzbd/sabnzbd.git
Cloning into 'sabnzbd'...
remote: Counting objects: 503, done.
remote: Compressing objects: 100% (446/446), done.
remote: Total 503 (delta 78), reused 209 (delta 38), pack-reused 0
Receiving objects: 100% (503/503), 4.72 MiB | 744.00 KiB/s, done.
Resolving deltas: 100% (78/78), done.
[/share/Public] # cd sabnzbd/
[/share/Public/sabnzbd] # git branch
* master
This is much neater solution, so I'm going to integrate this in to my SABnzbd QPKG for Sherpa. ;D

Re: [SOLVED] Am I on master or develop?

Posted: June 12th, 2017, 2:20 am
by safihre
Git is indeed a wonderful world of surprises, I also find myself often Googling for "git do *something*" :P

Re: [SOLVED] Am I on master or develop?

Posted: June 12th, 2017, 2:43 am
by OneCD
Odd that it defaults to 'develop' if a branch is not specified. Is that supposed to happen? ???

Re: [SOLVED] Am I on master or develop?

Posted: June 13th, 2017, 2:06 am
by safihre
Yes, that's what we defined. Because git should only be used by developers or users that know what they are doing. Others should use our releases, which also include things like compiled translations.

Re: [SOLVED] Am I on master or develop?

Posted: June 13th, 2017, 2:54 am
by OneCD
Ah, no worries. Thank you. 8)