Pocket Plane Group

Friends and Neighbors => Weimer Republic (WeiDU.org) => WeiDU => Topic started by: the bigg on January 13, 2009, 10:36:45 AM

Title: Source code access.
Post by: the bigg on January 13, 2009, 10:36:45 AM
This post has been edited to update the URLs.

The source code for WeiDU is now managed via git. The repository is git://github.com/WeiDUorg/weidu.git (Web Interface (http://github.com/WeiDUorg/weidu/)). This post will be edited with actual instructions on how to install git, checkout the code, and submit your changes, once I find a readable tutorial.



Using git with a graphical user interface (probably easier for newbies, but if you're going to edit WeiDU you should really learn up on cygwin anyway):
See this article (http://kylecordes.com/2008/04/30/git-windows-go/).



Using git with cygwin (instructions can be adapted for OSX and Linux users pretty easily):
This is how Taimon suggests to work:

Quote
Just for the record, here is what I did for to get started:

    * `cd WeiDU'
    * `git clone git://github.com/WeiDUorg/weidu.git
    * log into github and fork the main project
    * `git remote add mypub git@github.com:<username>/weidu.git'


And these were the steps for the changes:

    * `cd WeiDU'
    * `git pull' for syncing the local repos with upstream (runs git fetch + git merge)
    * edit the files (they're in c::\cygwin\home\<username>\WeiDU if you follow these instructions)
    * `git commit -a'
    * `git push mypub' for pushing the changes to my public repos on github

Not mentioned here: install cygwin (http://www.cygwin.com); when you get to select packages, choose the 'full' system and install the git and ssh packages. Run cygwin, run these commands:
Code: [Select]
mkdir WeiDU
cd WeiDU
git init
git config add user.name "Your full name"
git config add user.email "a valid email address"
ssh-keygen <and follow the instructions>
register to github; when it asks for the public key, it's in c:\cygwin\home\<username>\.ssh\id_rsa.pub by default.

Edited for details on where to access the source code.
Title: Re: Source code access.
Post by: Taimon on January 13, 2009, 03:13:35 PM
Let me know if you need any help concerning git itself.
Title: Re: Source code access.
Post by: the bigg on January 13, 2009, 03:32:54 PM
Can you attempt submitting a patch? I need to see if I've understood fully the 300 steps required for me to accept it.
Title: Re: Source code access.
Post by: Taimon on January 13, 2009, 04:47:51 PM
Since I don't have write access to the github repos, that leaves me with the git-send-email option.
I've send the patch to your spellholdstudios.net address.

By the way, you should set user.email to a valid email address. :)
Title: Re: Source code access.
Post by: the bigg on January 13, 2009, 04:57:20 PM
Since I don't have write access to the github repos, that leaves me with the git-send-email option.
The point is to give you (or other continuative contributers) write access, otherwise I could've just kept manually running patch. What's your github login?

Quote
By the way, you should set user.email to a valid email address. :)
I managed to set user.mail instead  :(
Title: Re: Source code access.
Post by: Taimon on January 13, 2009, 05:47:24 PM
The point is to give you (or other continuative contributers) write access, otherwise I could've just kept manually running patch.
There is a git utility that directly applies the patch emails to your local repository. (Haven't tried it.)

Quote
What's your github login?
taimon

/Edit:
I guess the github plan is, that I create my own "fork" of your weidu repos and you pull my changes from this fork.
Title: Re: Source code access.
Post by: the bigg on January 13, 2009, 06:02:13 PM
There is a git utility that directly applies the patch emails to your local repository. (Haven't tried it.)
Oh. Guess it's 1% easier than downloading a patch from here, since I use thunderbird and not mutt  ;)

Quote
taimon
OK, now you're a contributor to WeiDU. You should be able to merge stuff directly to the repo, if I understand this correctly.
Title: Re: Source code access.
Post by: the bigg on January 13, 2009, 06:20:30 PM
Cheers, I got the whole process going  :)

Can you write a straight tutorial for pulling, branching and pushing for the benefit of other contributors?
Title: Re: Source code access.
Post by: Taimon on January 13, 2009, 06:31:46 PM
Wait a sec, I think I messed something up. :D
I've created the fork and pushed there, but afterwards decided to also push to git@github.com:vbigiani/weidu.git.
(Check git log to see what I mean.)

I'm unsure whether I should push to my fork or to the main-line (i.e. your account) now.
Title: Re: Source code access.
Post by: the bigg on January 13, 2009, 06:36:50 PM
Wait a sec, I think I messed something up. :D
I've created the fork and pushed there, but afterwards decided to also push to git@github.com:vbigiani/weidu.git.
(Check git log to see what I mean.)

I'm unsure whether I should push to my fork or to the main-line (i.e. your account) now.
Um, your patch needs my signoff for being applied, so what you're doing appears to work correctly... But then again, it's not like I actually know 100% of what's going on and what's supposed to go on.
Title: Re: Source code access.
Post by: Taimon on January 13, 2009, 07:10:17 PM
So I guess there are two different options for the workflow:

1. I get updates from the main repos (your public repos), make changes locally, push them to my fork and send a pull request to you.
You pull from my public to your local repos, check if everything is fine and push the changes to the main repos.

2. Instead of pushing to the fork, I directly push to your public repos (needs the contributor status)
Title: Re: Source code access.
Post by: the bigg on January 13, 2009, 07:11:38 PM
Umm, I guess 1 is fine for occasional contributors and 2 is better for people who contribute more consistently (you, dev, and somebody else I guess).
Title: Re: Source code access.
Post by: devSin on January 13, 2009, 07:41:57 PM
Umm, I guess 1 is fine for occasional contributors and 2 is better for people who contribute more consistently (you, dev, and somebody else I guess).
Uh, whatever.

Like Wes before you, if I come up with it, you'll hear about it here. You guys can repo main and repo public and repo local and push and pull and fork and request. I'm sticking to "DO THIS PLEASE THANK YOU GBYE."
Title: Re: Source code access.
Post by: Mike1072 on January 14, 2009, 02:19:59 AM
I tried making some edits to the docs via Cygwin.  Hadn't used git before but I think that it worked...

However, I'm pretty lost as to whether I should be also doing stuff on the website or just via the command-line.  Also I don't know about all this branch/forking stuff.
Title: Re: Source code access.
Post by: Taimon on January 14, 2009, 06:06:05 AM
The fork process is a special github action.
By clicking on the fork button you basically create your own public repository (that is somehow linked to the original project) and push your local changes into it.
(Try something like `git remote add mypub git@github.com:username/weidu.git' and then `git push mypub'.)
Title: Re: Source code access.
Post by: the bigg on January 14, 2009, 07:01:44 AM
The workflow is like this:
setup:
install cygwin, and the git and ssh package.
register at github. Follow the instructions for setting up git and ssh and providing all the required info.
Fork my github repository (via github)
Via cygwin, create a new directory (for ex. WeiDU-devel), cd into it, and run `git init && git remote add mypub git@github:<username>/weidu.git'

writing publishing one or more diffs:
via github, merge your repository with mine.
cd into the git directory
git pull mypub
do whatever change you might want and test it
git commit -a -m 'one line description of the patch'
git push mypub master

once you're done and your work is tested:
if you're a contributor: push your commit to my repository (via github)
if not: send me a pull request

I don't need either because I subscribe via RSS to everything happening to vbigiani/weidu, but a push to my repo/pull request is a good way of telling me 'I'm done with this work, and it's tested'.
Title: Re: Source code access.
Post by: Taimon on January 14, 2009, 08:31:46 AM
Just for the record, here is what I did for to get started:

And these were the steps for the changes:
Title: Re: Source code access.
Post by: the bigg on January 14, 2009, 08:47:47 AM
Just for the record, here is what I did for to get started:
  • `git clone git://github.com/vbigiani/weidu.git'
  • log into github and fork the main project
  • `git remote add mypub git@github.com:<username>/weidu.git'

And these were the steps for the changes:
  • `git pull' for syncing the local repos with upstream (runs git fetch + git merge)
  • edit + `git commit -a'
  • `git push mypub' for pushing the changes to my public repos on github
Um, does that sync with my repo before your editing?
Title: Re: Source code access.
Post by: Taimon on January 14, 2009, 11:04:20 AM
Yep, the `git pull' there fetches any updates from your repos  (as this was the one I cloned from) and merges them into the current branch.
Title: Re: Source code access.
Post by: Mike1072 on January 14, 2009, 08:20:57 PM
Just for the record, here is what I did for to get started:
  • `git clone git://github.com/vbigiani/weidu.git'
  • log into github and fork the main project
  • `git remote add mypub git@github.com:<username>/weidu.git'

And these were the steps for the changes:
  • `git pull' for syncing the local repos with upstream (runs git fetch + git merge)
  • edit + `git commit -a'
  • `git push mypub' for pushing the changes to my public repos on github
Just wanted to say, this works and is relatively easy.

Thanks for the instructions.
Title: Re: Source code access.
Post by: plainab on July 02, 2009, 02:38:57 PM
I tested out github. Hope it worked. I think it did. Taimon sent me an e-mail saying that I didn't have to send requests for him to look at my edits.
But I didn't do everything that was listed in the instructions.  I just used the github website.  Is that sufficient? Or do I need to figure out how to use the various offline programs?
If it helps, the only thing I'd ever do is add new macros and/or functions and adjust the readme doc to include information about them.  I'll leave the actual "weidu engine" alone...
Title: Re: Source code access.
Post by: the bigg on July 02, 2009, 06:39:01 PM
I received correctly the patches. The only hiccup was that you sent the whole files as patches because of CRLF issues, but this is not a git(hub) issue.
Title: Re: Source code access.
Post by: plainab on July 15, 2009, 06:13:13 PM
Finally got msysgit to work.  So now I should be able to add macros or functions to the appropriate tpp files, push the changes to my public repo and ask for them to be pulled.
When I set it up I told it to use unix style line endings, it seemed the least confusing of all the options.  Also, might solve some of the crlf issues I apparently had the last time I made some adjustments...

Title: Re: Source code access.
Post by: the bigg on July 15, 2009, 06:39:56 PM
cough some git guru should tell me the option to ignore crlf issues cough
Title: Re: Source code access.
Post by: Taimon on July 16, 2009, 12:34:55 AM
Well, at least for the diff you can say --ignore-space-at-eol.
Title: Re: Source code access.
Post by: Taimon on July 16, 2009, 04:13:40 AM
When I set it up I told it to use unix style line endings, it seemed the least confusing of all the options.
I suggest you disable autocrlf  in the config (should be in "%GIT_DIR%/etc/gitconfig"). If you use an editor that keeps line endings as they are, you should be fine.
Title: Re: Source code access.
Post by: plainab on July 16, 2009, 07:51:20 PM
When I set it up I told it to use unix style line endings, it seemed the least confusing of all the options.
I suggest you disable autocrlf  in the config (should be in "%GIT_DIR%/etc/gitconfig"). If you use an editor that keeps line endings as they are, you should be fine.
The first time I had just used the github website and that is probably what brought up the crlf issue.  Now that I've got a local copy, I plan on using ConTEXT do any edits/additions. I would think that it leaves the line endings as they are, but I don't really know...

I found the gifconfig file. Took a wild guess and forced it to open with ConTEXT (no extension so Windows won't automatically let me open it).  It's a basic text file, and the autoCRLF is set to input.  Do I just replace 'input' with 'disable' or is there something else that I should enter?  I'd rather get it done right, than do something wrong and screw things up later...

Title: Re: Source code access.
Post by: Taimon on July 17, 2009, 01:11:36 AM
Do I just replace 'input' with 'disable' or is there something else that I should enter?  I'd rather get it done right, than do something wrong and screw things up later...
Either delete the autocrlf line or set it to false.
You can see the effect of autocrlf if you do a fresh checkout and a `git diff' shows you that all files are modified.