Re: git: Pulling from master

2017-11-17 Thread Willem Ferguson
>From phone. Thank you everyone. I am finally github - able. Took large
chunk of my day but it was worth it. Kind regards, Willem

On 17 Nov 2017 17:53, "Dirk Hohndel"  wrote:


> On Nov 17, 2017, at 7:51 AM, Willem Ferguson <
willemfergu...@zoology.up.ac.za> wrote:
>
> On 17/11/2017 17:38, Dirk Hohndel wrote:
>>
>> And just in case that isn't obvious - there really isn't a huge need to
keep the 'master' in your fork in sync with upstream. You can always just
pull from upstream on your local machine.

> But I can only issue a PR from my fork on Github. Therefore my Github
fork should contain an up-to-date master with my change that I wish to have
pulled. Is this correct?

Actually, GitHub doesn't care if YOUR master is up to date. If you push a
branch on which you worked to GitHub, it will offer to you to create a PR
against master of the upstream project which you forked.

/D

___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: git: Pulling from master

2017-11-17 Thread Dirk Hohndel

> On Nov 17, 2017, at 7:51 AM, Willem Ferguson 
>  wrote:
> 
> On 17/11/2017 17:38, Dirk Hohndel wrote:
>> 
>> And just in case that isn't obvious - there really isn't a huge need to keep 
>> the 'master' in your fork in sync with upstream. You can always just pull 
>> from upstream on your local machine.

> But I can only issue a PR from my fork on Github. Therefore my Github fork 
> should contain an up-to-date master with my change that I wish to have 
> pulled. Is this correct?

Actually, GitHub doesn't care if YOUR master is up to date. If you push a 
branch on which you worked to GitHub, it will offer to you to create a PR 
against master of the upstream project which you forked.

/D

___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: git: Pulling from master

2017-11-17 Thread Dirk Hohndel

> On Nov 17, 2017, at 4:32 AM, Willem Ferguson 
>  wrote:
> ~/src/$ git clone g...@github.com:Subsurface-divelog/subsurface.git
> Cloning into 'subsurface'...
> Permission denied (publickey).
> fatal: Could not read from remote repository.

See my other email - that's for the maintainers, for most people

git://github.com/Subsurface-divelog/subsurface

is the better choice.

/D
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: git: Pulling from master

2017-11-17 Thread Dirk Hohndel

> On Nov 17, 2017, at 2:20 AM, Jan Mulder  wrote:
> 
> On 17-11-17 10:59, Willem Ferguson wrote:
>> I am  sorting out the Github mechanism for myself.
>> Two questions:
>> 1) The upstream repository. Currently there are two such repositories:
>> i) git://subsurface.hohndel.org/subsurface.git  [git has the label "origin"]
>> ii) https://github.com/Subsurface-divelog/subsurface [git has the label 
>> "upstream"]
>> What is the current relationship between these two repositories?
> 
> Dirk can tell that (when he wakes up), but just don't bother with the 
> git://subsurface.hohndel.org/subsurface.git one. You do not need it.

This is a sign how long you have been involved in Subsurface :-)
For a while (quite a while) we ran everything on our own (read: mine) 
infrastructure.
And initially that was based on my domain, hohndel.org (since 2011).
Then, in 2014 I registered subsurface-divelog.org and migrated things to there, 
including the git server and preferred address (of course with a DNS forward). 
Thankfully last year smarter people convinced me to instead move to GitHub and 
use its PR and issue instead of doing all this on my own server.
So the git://git.subsurface-divelog.org server is still around (in order not to 
break old scripts, links, and the working setups of contributors), and 
subsurface.hohndel.org might still point there (but hasn't been tested / 
verified by me in ages) but I consider 
git://github.com/Subsurface-divelog/subsurface the true reference.

>> $ git remote -v
> 
> my git remote -v
> 
> origin  g...@github.com:janmulder/subsurface.git (fetch)
> origin  g...@github.com:janmulder/subsurface.git (push)

That's a good way to do it for people who have a fork on GitHub

> upstreamg...@github.com:Subsurface-divelog/subsurface.git (fetch)
> upstreamg...@github.com:Subsurface-divelog/subsurface.git (push)

That of course only works for the maintainers - Jan is one of the people who 
can, indeed, push to the official repo.

>> I get:
>> forkhttps://github.com/willemferguson/subsurface (fetch) [this comes 
>> from doing git remote add fork https://github.com/willemferguson/subsurface ]
>> forkhttps://github.com/willemferguson/subsurface (push)
>> origingit://subsurface.hohndel.org/subsurface.git (fetch)
>> origingit://subsurface.hohndel.org/subsurface.git (push)
>> upstreamhttps://github.com/Subsurface-divelog/subsurface (fetch)
>> upstreamhttps://github.com/Subsurface-divelog/subsurface (push)
> 
> And I use a stupid script to get things synced:
> 
> git checkout master
> git tag -d continuous # recently added to get the continuous label moved
> git fetch upstream
> git merge upstream/master
> git push origin master # push things to my github account

And just in case that isn't obvious - there really isn't a huge need to keep 
the 'master' in your fork in sync with upstream. You can always just pull from 
upstream on your local machine.
And there's even a small risk here. If you think that your master is in sync 
but it actually has a stray commit in there, then the SHAs don't match and PRs 
start getting weird.

/D
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: git: Pulling from master

2017-11-17 Thread Willem Ferguson

On 17/11/2017 12:20, Jan Mulder wrote:


And I use a stupid script to get things synced:

git checkout master
git tag -d continuous # recently added to get the continuous label moved
git fetch upstream
git merge upstream/master
git push origin master # push things to my github account

--jan


~/src/$ git clone g...@github.com:Subsurface-divelog/subsurface.git
Cloning into 'subsurface'...
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Then, alternatively, I selected on the upstream web site the "Clone or 
Download" button.


After extracting the .zip to src/subsurface, I did:

~/src/subsurface/$ git remote -v
fatal: Not a git repository (or any of the parent directories): .git

I need another indication of what the right approach is.

Kind regards,

willem



--
This message and attachments are subject to a disclaimer.
Please refer to 
http://upnet.up.ac.za/services/it/documentation/docs/004167.pdf for full 
details.

___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface