Announcement

  •  » Engine
  •  » Switching to Git / GitHub?

#1 2014-10-20 22:40:03

mmoy
Member
France
2014-08-18
74

Switching to Git / GitHub?

Hello/Hi/Greetings,

I had discussions in private with plg about this, but I'm not sure what's the "official" status of the project. My understanding is that there's a project to move to Git as revision control, and GitHub as hosting service.

Is there already a consensus on these two points, or are they still to be debated?

If the consensus is that we should switch to Git and GitHub, I propose the following for a start:

1. Create a "Piwigo" organization on GitHub
2. Create a Git mirror of Piwigo core's SVN in this organization
3. Let the forum learn the git:<commit> links (or perhaps git:core:<commit> to leave room for git:<pluginName>:<commit>). Not critical, but let's start with simple things.
4. See how it goes, play a bit with it. It's just a (read-only) mirror, it doesn't force anything and it's still easy to move back.

Then the hard work would begin but that's something we can talk about later.

I'm volunteer to do steps 1 and 2. I can probably do step 3 (it should be simple indeed), but I have no idea where the code is ;-).

What do you think?

Offline

 

#2 2014-10-20 22:47:57

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3277

Re: Switching to Git / GitHub?

All of the github related stuff is absolutely not a problem, in one hour we can get up the repo and grant access to everyone (I don't see the interest in having a read-only mirror...)

the only blocking thing is Lexiglot which I need to update for Git support, I'm almost the only one to be able to do that (I conceived it alone) but I am also busy

Offline

 

#3 2014-10-20 23:25:07

mmoy
Member
France
2014-08-18
74

Re: Switching to Git / GitHub?

Of course it's not a problem, I thought "for a start" and "let's start with something simple" in my message were clear enough.

I just wanted to help initiate the movement. A read-only mirror can help during the transition. For example, Lexiglot could continue talking to SVN for a while and developers could migrate to Git. You will have to do the SVN to Git import anyway, so letting GitHub do it for you seems the simplest option to me.

Now, if you don't want or need my help, just say so.

Offline

 

#4 2014-10-20 23:48:52

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13541

Re: Switching to Git / GitHub?

mmoy wrote:

Now, if you don't want or need my help, just say so.

We're are thinking about how to achieve the complex part, but we don't refuse your help. As far as I'm concerned, I have to learn a bit more about Git/Github before going deeper!

Thank you for starting this discussion, it "speed things up" :-)

Offline

 

#5 2014-10-21 08:11:10

mmoy
Member
France
2014-08-18
74

Re: Switching to Git / GitHub?

BTW, if the choice is GitHub, you can use the SVN interface for existing clients https://help.github.com/articles/suppor … n-clients/

Offline

 

#6 2014-10-21 13:06:54

rvelices
Piwigo Team
2005-12-29
1960

Re: Switching to Git / GitHub?

I have zero knowledge about git but im in as long as there is anice client for windows whch i dont doubt.

Mmoy would you have a recommandation ?

Offline

 

#7 2014-10-21 13:07:19

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13541

Re: Switching to Git / GitHub?

Back in 2001, when Piwigo was called PhpWebGallery, I was alone on coding and I did not use any source code manager. Then in 2003, I created a CVS repository, on my home computer if I remember correctly. Several years later, maybe in 2006, we switched to SVN, hosted on Gna.org. The Gna experience was quite deceiving because the service was far from perfect and we had not much control. This is why we moved the SVN repository on our own server, in 2009, with full control. This has worked pretty well for the last 5 years! We have more than 30k commits in Piwigo repository :-D

In the meantime, Git has arrived and Github has become "the place to be" for open source projects. Nowadays, each time I say Piwigo is using SVN I get replies such as "you're a dinosaur, switch to Github: it's a whole new world" ! I don't like the idea to lose control on Piwigo source code repository, but I like even less that Piwigo is not where it should be to attract contributors the easiest way. This is why, after discussions and several months of thinking, I strongly think we have to switch to Git and to Github for source code and for bugtracker.

The move is complex, because we have a long history, extensions, tools linked with SVN (the extension manager and the translation manager). Because I don't really like to only rely on an external company, we will need to have synchronized repository on our server and a synchronized bugtracker. I know Piwik do it and we can do the same.

Offline

 

#8 2014-10-21 13:50:58

mmoy
Member
France
2014-08-18
74

Re: Switching to Git / GitHub?

rvelices wrote:

I have zero knowledge about git but im in as long as there is anice client for windows whch i dont doubt.

Mmoy would you have a recommandation ?

I rarely give good answers when the question involves windows ;-).

First, you have to chose between command-line and GUI. I personally love Git's command-line, and Git for windows provides a relatively simple way to get a shell with the "git" command available. Among the good things with the command-line: you really see what you're doing, you call concepts by their real names (you're the one who types the commands!).

If you're a GUI kind of person, then Google will probably advise you better than me. Among the names I hear most often are TortoiseGit and Git Extensions. If you use an IDE, it probably has support for Git too.

Offline

 

#9 2014-10-21 13:55:28

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3277

Re: Switching to Git / GitHub?

TortoiseGit is for me the better choice on Windows, it support almost all Git operations, and integrates well (very similar to TortoiseSVN of course)

I tried a bit the official Github client, don't like it at all, very restricted.

The only real difficulty with git is the use of SSH keys, I'll create a guide for Tortoise under Windows and command line under Linux if we officially take the decision to switch.

Offline

 

#10 2014-10-21 14:04:41

mmoy
Member
France
2014-08-18
74

Re: Switching to Git / GitHub?

plg wrote:

Because I don't really like to only rely on an external company, we will need to have synchronized repository on our server and a synchronized bugtracker. I know Piwik do it and we can do the same.

This part is the less problematic: synchronizing repositories is the point of having a tool like Git. Each developer has a copy of the whole repository on its machine, so even projects that do not have a mirror don't completely depend on GitHub (if Github is shut down, it's relatively easy to recover everything from each developer's machine). Still, I agree with you that a mirror is good, but creating one is essentially a "git clone --mirror" and then a "git pull" in a cron job. Plus a "git fsck" once in a while to be paranoid ("paranoid" is a compliment when coming from me ;-) ).

Offline

 

#11 2014-10-21 14:07:36

mmoy
Member
France
2014-08-18
74

Re: Switching to Git / GitHub?

mistic100 wrote:

The only real difficulty with git is the use of SSH keys, I'll create a guide for Tortoise under Windows and command line under Linux if we officially take the decision to switch.

Nowadays, Git speaks HTTP(S) in addition to SSH, and can memorize passwords or talk to the credential manager of the operating system to remember them (never tried it on windows though). So, SSH keys are one option (the one I use most of the time), but not the only one.

Offline

 

#12 2014-10-22 10:07:15

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13541

Re: Switching to Git / GitHub?

Before planning to move Piwigo core on Github, I think the first step is to make piwigo.org/ext (PEM software) and piwigo.org/translate (Lexiglot software) compatible with remote source code on Github. Indeed several extensions are already hosted on Github and we have currently no "clean" way to interact with them (other than asking them to move/copy on piwigo.org SVN repository):

* Theme SimpleNG https://github.com/saimn/simple-theme-piwigo
* Plugin VideoJS https://github.com/xbgmsharp/piwigo-videojs
* Plugin OpenStreetMap https://github.com/xbgmsharp/piwigo-openstreetmap
* Plugin Kodi https://github.com/abrenoch/piwigo-kodi
* Plugin Twitter Cards https://github.com/umrysh/Piwigo-Twitter-Cards

(and several others...)

I'm going to work on PEM to be able to generate the archive from Git (as we do from SVN). I think mistic has already started to investigate on how Lexiglot can remotely work with Github.

Offline

 

#13 2014-10-22 16:22:02

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13541

Re: Switching to Git / GitHub?

plg wrote:

I'm going to work on PEM to be able to generate the archive from Git (as we do from SVN).

Partially done : http://piwigo.org/pem/ticket/22

Now I have to manage specific changes for Piwigo.org (automatic replacements in main.inc.php and themeconf.inc.php)

Offline

 

#14 2014-10-22 16:43:17

mmoy
Member
France
2014-08-18
74

Re: Switching to Git / GitHub?

plg wrote:

Partially done : http://piwigo.org/pem/ticket/22

Code:

 exec('rm -rf '.$temp_path.'/.git');

You probably want to use escapeshellarg() to avoid bad surprises.

Code:

$git_command = $conf['git_path'].' log ';

Avoid using porcelain commands like "git log" in scripts: the output is not guaranteed stable across versions, and can change depending on Git's configuration. Prefer plumbing commands, like "git cat-file commit HEAD" and then let PHP format the date as you want with date(), or use git rev-list instead of git log.

Offline

 

#15 2014-10-22 18:49:50

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13541

Re: Switching to Git / GitHub?

mmoy wrote:

You probably want to use escapeshellarg() to avoid bad surprises.

$temp_path is not a user input. It is something like /path/to/pem/_data/git_clone/2bde29a6dbe17ec08291be6b09386103 where 2bde29a6dbe17ec08291be6b09386103 is a  md5(uniqid(rand(), true)). Do you think it could become "../../../" ?

mmoy wrote:

Code:

$git_command = $conf['git_path'].' log ';

Avoid using porcelain commands like "git log" in scripts: the output is not guaranteed stable across versions, and can change depending on Git's configuration. Prefer plumbing commands, like "git cat-file commit HEAD" and then let PHP format the date as you want with date(), or use git rev-list instead of git log.

$ git cat-file commit HEAD
tree d1e8e5c0dea0297fb6700c505df638ec4c90c48a
parent f8f4665ccbe66d0375aface322fdc266c2fa970e
author Dave Umrysh <dave@***.com> 1403846946 -0600
committer Dave Umrysh <dave@***.com> 1403846946 -0600

...

It doesn't give me the commit "hash" (which is 72a0ca7d709be32d39a5195bb0dc227276f2a590).

I want to fill pem_metadata.txt; with something like:

File automatically created from SVN or Git repository.

URL: https://github.com/umrysh/Piwigo-Twitter-Cards
Revision: 72a0ca7d709be32d39a5195bb0dc227276f2a590 (Thu Jun 26 23:29:06 2014 -0600)

Maybe that's not relevant for Git. My pattern for SVN exported plugins is:

File automatically created from SVN repository.

URL: http://piwigo.org/svn/extensions/ContactForm
Revision: 29789

Offline

 
  •  » Engine
  •  » Switching to Git / GitHub?

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2022 · Contact