How To Use Trunk Version?

Development-related discussion, including bundled plugins
miked333
Bear Rating Trainee
Bear Rating Trainee
Posts: 3
Joined: 28 Mar 2013, 06:52

How To Use Trunk Version?

Postby miked333 » 04 Apr 2013, 00:16

I'm interested in using trunk but have no experience with that sort of thing. Here's how I think I can do that, if someone could let me know if this is correct I would appreciate it.

I go to github here: https://github.com/gothfox/Tiny-Tiny-RSS

I download a zip file while viewing the "Master" branch.

I unzip the files, configure the config.php and upload them to my server, replacing the existing files.

Is that all there is to it?

Thanks!

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: How To Use Trunk Version?

Postby fox » 04 Apr 2013, 00:17

Don't download zips, that's way too complicated. Read a basic git tutorial of which there's a million on the internet, learn about git clone, use it, and do git pulls from then on.

craywolf
Mr. Awesome
Posts: 97
Joined: 19 Mar 2013, 18:07

Re: How To Use Trunk Version?

Postby craywolf » 04 Apr 2013, 00:27


xtaz
Bear Rating Master
Bear Rating Master
Posts: 174
Joined: 24 Dec 2009, 16:48

Re: How To Use Trunk Version?

Postby xtaz » 04 Apr 2013, 01:04

I've done exactly this tonight. You really ought to read some of the tutorials so that you understand what it's doing, but if you want to get going quickly I did this:

Code: Select all

git clone https://github.com/gothfox/Tiny-Tiny-RSS.git tt-rss (where tt-rss is the directory I wanted it installed to)
git clone https://github.com/mboinet/ttrss-mobile.git tt-rss/mobile (to get the mobile version)


And then configured it like normal. To get updates I'll just run:

Code: Select all

cd tt-rss
git pull
cd mobile
git pull


Easy. I also worked out a few other useful commands:

Code: Select all

git status (see the status of the working directory)
git log -n2 index.php (to see the last two commit logs of index.php, and get the commit references)
git revert <commit_ref> (to revert to the last version)


What I'm not sure about is if that revert command is the correct way of going back to the previous version in case of problems. And also if I do that how I should revert the reversion and go back to the main trunk code. I come from the world of subversion where things are done differently. I need to spend some time reading the git tutorials.

shabble
Bear Rating Trainee
Bear Rating Trainee
Posts: 33
Joined: 18 Mar 2013, 23:40

Re: How To Use Trunk Version?

Postby shabble » 04 Apr 2013, 05:34

xtaz wrote:What I'm not sure about is if that revert command is the correct way of going back to the previous version in case of problems.
You do run the risk of one of the git updates involving an update to the database, and a git-revert won't rollback your database, and your reverted code won't (I'm fairly certain) run against the 'new' database.

I come from the world of subversion where things are done differently.

This isn't a 'git' issue; you'd have exactly the same problem with svn.

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: How To Use Trunk Version?

Postby fox » 04 Apr 2013, 08:51

>You do run the risk of one of the git updates involving an update to the database

You can add a post-merge hook which would dump your database into a (for example, timestamped) file before each pull.

>What I'm not sure about is if that revert command is the correct way of going back to the previous version in case of problems.

You will run into problems with getting new code later.

Either create a local branch and revert in there, or go to an older changeset manually using git checkout (which would put the work directory in the detached state, which for this situation is mostly the same thing as a branch). Use git log, select the commit before I broke thing, and do git checkout xxxxxxxxx.

Then to return to master using git checkout master and update using git pull etc.

Edit 2: I'll move this thread to Development and sticky it.

xtaz
Bear Rating Master
Bear Rating Master
Posts: 174
Joined: 24 Dec 2009, 16:48

Re: How To Use Trunk Version?

Postby xtaz » 04 Apr 2013, 12:43

shabble wrote:This isn't a 'git' issue; you'd have exactly the same problem with svn.


I agree with that. I see the point about the database. I track the cutting-edge version of the FreeBSD operating system via subversion, if they ever make a code change that causes my system to crash I just do svn update -r <rev_number> blah.c and recompile the code, then when they've fixed the issue I run svn update blah.c to get back up to the HEAD revision for that file. I was just wondering what the equivalents were for git in case I ever need to do such a thing with tt-rss. Admittedly I guess the likelihood is that I never will have to as if there are any issues I'd just report them here and they will likely get fixed within minutes from what I've seen of fox's work, but I was still just curious for those rare moments that I might have to.

The git checkout stuff that fox mentions in the last post tells me everything I need to know though. Thanks fox, that makes sense!

Also, updated to "1.7.7" this morning just by typing the git push command. SO much easier than using the release tarballs. You're definitely right when you say people should follow the trunk. On most projects using the stable releases is generally the better way to go as the trunk is experimental, but I can see that tt-rss is different. It's just always a work in progress and the trunk is basically the stable code.

Athanasius
Bear Rating Trainee
Bear Rating Trainee
Posts: 38
Joined: 02 Apr 2013, 21:01

Re: How To Use Trunk Version?

Postby Athanasius » 04 Apr 2013, 14:03

For what it's worth I've started using the git trunk and maintaining a local branch in order to preserve any local changes (certainly things like non-trunk plugins):

1) git clone to get started
2) git checkout -b <local branch name>
3) Get it all running
4) When you feel it's time to update:
4a) Just in case, stop the feed update daemon if you have it running
4b) git checkout master (so we pull to there first, rather than directly over local branch)
4c) git pull (as this is to master there shouldn't ever be any conflicts)
4d) git checkout <local branch name>
4e) git merge master (and pay attention to output in case of conflicts)
4f) Double-check no file permissions went screwy.
4g) Login as 'admin' in tt-rss in case of any DB updates.
4h) Restart feed update daemon if needed.

Obviously if you actually make any local edits to trunk code in your local branch you're more likely to get conflicts on the merge and will have to sort them out yourself. I'd also advise doing a 'git tag -a <some local tag with a date>' each time after the merge so you can hop between local versions if testing some issue. It's that or remembering the hashtags for the HEAD at the time.

Athanasius
Bear Rating Trainee
Bear Rating Trainee
Posts: 38
Joined: 02 Apr 2013, 21:01

Re: How To Use Trunk Version?

Postby Athanasius » 04 Apr 2013, 14:07

Oh and I should add that using such a local branch means that you can do things like the following.

Grab the tweet.zip download and whilst the local branch is checked out unzip it to plugins/, now you can:

git add tweet/
git commit

And you have the tweet plugin in your local branch with any changes tracked (assuming you check them in!). Rather than having to remember to unzip a copy on every "git pull".

xtaz
Bear Rating Master
Bear Rating Master
Posts: 174
Joined: 24 Dec 2009, 16:48

Re: How To Use Trunk Version?

Postby xtaz » 04 Apr 2013, 14:53

Interesting stuff, but is that strictly necessary to keep a local branch? I don't seem to have an issue with local additions. Obviously if I changed any files that were part of master then there would be conflicts but as long as I don't do that this seems to work just using the master:

Code: Select all

$ git branch
* master

$ git status
# On branch master
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       mobile/
#       themes/xtaz.css
#       xtaz/
nothing added to commit but untracked files present (use "git add" to track)

$ git pull
remote: Counting objects: 20, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 12 (delta 9), reused 10 (delta 7)
Unpacking objects: 100% (12/12), done.
From https://github.com/gothfox/Tiny-Tiny-RSS
   9fb91a2..e6cdbae  master     -> origin/master
Updating 9fb91a2..e6cdbae
Fast-forward
 include/functions.php | 1 +
 include/rssfuncs.php  | 6 +++---
 include/sessions.php  | 3 +++
 3 files changed, 7 insertions(+), 3 deletions(-)

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: How To Use Trunk Version?

Postby fox » 04 Apr 2013, 14:54

Yeah it's way overkill, you can just keep things which are not in origin/master without any special branches and stuff. Pull is not going to complain about them.

Athanasius
Bear Rating Trainee
Bear Rating Trainee
Posts: 38
Joined: 02 Apr 2013, 21:01

Re: How To Use Trunk Version?

Postby Athanasius » 04 Apr 2013, 17:08

It does give me an easy way to switch to pure master for testing if an update seems to be buggy, so as to rule out it being an issue with my local additions. Without the local branch I'd have to delete/disable all the local-only content, retest, and put it back after if it made no difference (or once a fix was in place).

That and I like to keep track of the local only files as well, especially when I'll inevitably update one of those local-only plugins and it breaks something. So much easier to roll back with git than hoping I remembered to keep the old copy around.

dewman
Bear Rating Trainee
Bear Rating Trainee
Posts: 2
Joined: 06 Apr 2013, 06:52

Re: How To Use Trunk Version?

Postby dewman » 06 Apr 2013, 07:05

I used this guide to install tt-rss using git twice, both times when I did git pull i get this

tt-rss$ git pull
remote: Counting objects: 61, done.
remote: Compressing objects: 100% (23/23), done.
remote: Total 41 (delta 27), reused 31 (delta 17)
Unpacking objects: 100% (41/41), done.
From https://github.com/gothfox/Tiny-Tiny-RSS
1e2ce29..b87bd8e master -> origin/master
Updating 1e2ce29..b87bd8e
error: Your local changes to the following files would be overwritten by merge:
classes/pref/feeds.php
classes/pref/prefs.php
include/functions.php
js/prefs.js
plugins/embed_original/init.js
plugins/googlereaderimport/init.php
Please, commit your changes or stash them before you can merge.
Aborting

i didn't change any of these files. Is this normal, if so how do I get past this?

Awesome piece of software

Thanks
John

Vassius
Bear Rating Trainee
Bear Rating Trainee
Posts: 6
Joined: 01 Apr 2013, 16:53

Re: How To Use Trunk Version?

Postby Vassius » 06 Apr 2013, 11:50

dewman wrote:I used this guide to install tt-rss using git twice, both times when I did git pull i get this

....

i didn't change any of these files. Is this normal, if so how do I get past this?

Awesome piece of software

Thanks
John


A "git status" should confirm that you have uncommitted changes. A "git diff" gives you a diff showing the changes since last commit (last pull in your case probably). Try these commands to see what has changed.

If the changes are trivial, you could do a "git reset --hard" to undo the uncommitted changes. Then you should be able to merge upstream master with a pull.
If there are changes you need to keep, do a "git commit -am 'Your commit message'" and then a pull.

dewman
Bear Rating Trainee
Bear Rating Trainee
Posts: 2
Joined: 06 Apr 2013, 06:52

Re: How To Use Trunk Version?

Postby dewman » 06 Apr 2013, 18:28

Thanks You. like I said I didn't make any of the changes. unless the software itself changes them.

Thanks for the quick and understandable reply.


Return to “Development”

Who is online

Users browsing this forum: No registered users and 0 guests