How To Use Trunk Version?

Development-related discussion, including bundled plugins
feader
Bear Rating Master
Bear Rating Master
Posts: 160
Joined: 26 Dec 2012, 20:03

Re: How To Use Trunk Version?

Postby feader » 10 Apr 2013, 01:33

I'm toying with the idea to use trunk, too. Since I have ttrss on a machine that has no X11: Is there a passable diff/merge tool for the command line, or would it be smarter to use a git that is installed on my PC and mount ttrsses directory there whenever I feel I should pull & update a new version?
When I think about it: It would make a db dump much harder to accomplish, so I only do this when there is a merge? I'd like to have some local changes, like the number switch in the feed display, I have to commit those for a trouble free update, right?

Concerning the db dump: When using mysql, should I install a script executing

Code: Select all

mysqldump -u ttrssuser -ppass ttrssdb > ttrssdump

as a update hook? And what happens when the db schema is updated, it is installed before the first login after update?

Last not least: Up to this point, I mostly used mercurial as distributed VS. I think I remember that it can also pull/push/etc from git repos, has anyone experiences with that scenario, or is this consired :shock:?

Would really appreciate some feedback :|

phz
Bear Rating Disaster
Bear Rating Disaster
Posts: 77
Joined: 18 Mar 2013, 18:32

Re: How To Use Trunk Version?

Postby phz » 10 Apr 2013, 10:03

feader wrote:I'm toying with the idea to use trunk, too. Since I have ttrss on a machine that has no X11: Is there a passable diff/merge tool for the command line, or would it be smarter to use a git that is installed on my PC and mount ttrsses directory there whenever I feel I should pull & update a new version?

You don't need X to use Git. I sure have never used their GUI components.

As for diffing in a terminal, e.g. vimdiff (included with Vim) works, and many others. I don't know what you want to diff, though; unless you also do development on the X-less server, there shouldn't be any manual merging going on. Git will solve that for you.

feader wrote:When I think about it: It would make a db dump much harder to accomplish, so I only do this when there is a merge? I'd like to have some local changes, like the number switch in the feed display, I have to commit those for a trouble free update, right?

If you want to keep local patches, you will have to apply them or, if they are of common interest, get them included in the mainline tree. In the latter case, you can use Github to issue a "pull request" to the project for the project maintainer to review. If these words mean nothing to you - read up. Github itself has excellent and thorough documentation.

If it concerns a one-line patch, you could probably just use the regular `patch` tool to apply it after pulling. Or keep a separate Git branch that you locally merge with master after pulls. DVCSs are famously good at managing merges like this automatically.

feader wrote:Concerning the db dump: When using mysql, should I install a script executing

Code: Select all

mysqldump -u ttrssuser -ppass ttrssdb > ttrssdump

as a update hook? And what happens when the db schema is updated, it is installed before the first login after update?

There is no need to use it as a update hook. Do your backups on the same schedule as before. If the database scheme version is incremented with a new TT-RSS version, this is automatically recognized and converted. If you would restore an old backup, this will be handled by TT-RSS on the first startup.

feader wrote:Last not least: Up to this point, I mostly used mercurial as distributed VS. I think I remember that it can also pull/push/etc from git repos, has anyone experiences with that scenario, or is this consired :shock:?

It really should not be needed (I've used Mercurial a lot more than Git myself). You won't be doing any really advanced stuff, so its just a matter of learning a small number of new commands; often they are even the same.

See it as an opportunity to learn Git as well as Mercurial. Using both makes one better at both.

There is an Hg-Git plugin for Mercurial that allows collaboration between the systems, but in really simple cases it should not be needed since its, well, simple anyway. In really complex situations you'd run into some trouble concerning subtle differences in Hg and Git's interpretation of concepts such as "branches", "tags", commit reversion, etc. The effort is better spent at learning Git than learning the ins and outs of some abstraction layer on top of Hg, imho.

feader
Bear Rating Master
Bear Rating Master
Posts: 160
Joined: 26 Dec 2012, 20:03

Re: How To Use Trunk Version?

Postby feader » 10 Apr 2013, 21:45

phz wrote:See it as an opportunity to learn Git as well as Mercurial. Using both makes one better at both.

OK, you convinced me. :wink: Installed git.

phz wrote:You don't need X to use Git. I sure have never used their GUI components. […]
If it concerns a one-line patch, you could probably just use the regular `patch` tool to apply it after pulling. Or keep a separate Git branch that you locally merge with master after pulls. DVCSs are famously good at managing merges like this automatically.

Yeah, I know you don't need a GUI. However, when I need to do a 3-way-merge, I only feel comfortable with one GUI I have installed on my PC. And right now, I only want to change trivial things that are 1-5–liners, and of no common interest; so I'll commit my own changes locally, and reconcile them when I pull from fox. I heard that git is more confident when merging then mercurial, and at least you always have a fallback.

phz wrote:
feader wrote:Concerning the db dump: When using mysql, should I install a script executing

Code: Select all

mysqldump -u ttrssuser -ppass ttrssdb > ttrssdump

as a [pre-]update hook? And what happens when the db schema is updated, it is installed before the first login after update?

There is no need to use it as a update hook. Do your backups on the same schedule as before. If the database scheme version is incremented with a new TT-RSS version, this is automatically recognized and converted. If you would restore an old backup, this will be handled by TT-RSS on the first startup.

OK. But when I think about it, it would be nice to have something like this, since the update daemon must be stopped/started before/after update, so why not dump the db with it? So, would the code do what I think it should?

Thank you for your thoughts, anyway :D

smeerbartje
Bear Rating Disaster
Bear Rating Disaster
Posts: 67
Joined: 04 Apr 2013, 23:24
Contact:

Re: How To Use Trunk Version?

Postby smeerbartje » 18 Apr 2013, 15:21

I just did a "git pull" and tt-rss stopped working... see output below. Anyone else having the same problem?

EDIT
Found the problem. I didn't had the mysql port number set in the config.php file. Before the pull this wasn't necessary. Now it is.


Code: Select all

PHP Warning:  mysqli_connect() expects parameter 5 to be long, string given in /var/www/tt-rss/classes/db/mysqli.php on line 6
PHP Warning:  mysqli_error() expects exactly 1 parameter, 0 given in /var/www/tt-rss/classes/db/mysqli.php on line 13
Unable to connect to database (as *** to , database ttrss): [11:10:46/13423] Sleeping for 60 seconds...

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 » 18 Apr 2013, 15:41

What's your DB_PORT in config.php?

smeerbartje
Bear Rating Disaster
Bear Rating Disaster
Posts: 67
Joined: 04 Apr 2013, 23:24
Contact:

Re: How To Use Trunk Version?

Postby smeerbartje » 18 Apr 2013, 15:44

fox wrote:What's your DB_PORT in config.php?

Thanks for your (quick!!!) reply.. see my edit; already found the problem. Indeed I had to set the mysql db-port.

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 » 18 Apr 2013, 15:45

I wonder if it'll work without DB_PORT with the latest changeset.

smeerbartje
Bear Rating Disaster
Bear Rating Disaster
Posts: 67
Joined: 04 Apr 2013, 23:24
Contact:

Re: How To Use Trunk Version?

Postby smeerbartje » 18 Apr 2013, 15:48

fox wrote:I wonder if it'll work without DB_PORT with the latest changeset.

No, doen't work without DB_PORT.

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

Re: How To Use Trunk Version?

Postby Athanasius » 18 Apr 2013, 15:55

Just ran into this myself with a pull that has 1daf0f75faa32aff87db5ea5750aba33ec71c272 as the latest commit.

So I've changed my config.php DB_PORT to uncommented and:

Code: Select all

        define('DB_PORT', '3306'); // 5432 for PG, 3306 for MySQL


Setting it to '' (i.e. empty), results in the same error.

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 » 18 Apr 2013, 15:56

Well I guess on your configuration port is needed for mysqli for some reason.

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

Re: How To Use Trunk Version?

Postby xtaz » 18 Apr 2013, 16:00

Same here. But this seems strange because I have networking switched off in the my.cnf so that it only uses the unix socket. As a result I also just have a blank DB_HOST where it's set to "". If I change the DB_PORT to 3306 it works even though I'm not using networking.

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 » 18 Apr 2013, 16:08

What's interesting is that it works for me with blank DB_PORT.

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

Re: How To Use Trunk Version?

Postby xtaz » 18 Apr 2013, 16:15

Strange. I see you've changed the default config now to use it by default anyway so that'll solve the problem. If it helps I use FreeBSD, PHP 5.4.13, and have mysql, mysqli, and pdo+mysql extensions loaded, and skip-networking enabled in the my.cnf so that it doesn't create a TCP socket.

smeerbartje
Bear Rating Disaster
Bear Rating Disaster
Posts: 67
Joined: 04 Apr 2013, 23:24
Contact:

Re: How To Use Trunk Version?

Postby smeerbartje » 18 Apr 2013, 16:15

PHP bug... see http://ellislab.com/forums/viewthread/94796/
I think we all use different versions of PHP.

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 » 18 Apr 2013, 16:20

Btw you can enable experimental PDO support if you define _ENABLE_PDO in config.php.


Return to “Development”

Who is online

Users browsing this forum: No registered users and 2 guests