You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by Claude Warren <cl...@xenei.com> on 2018/03/19 10:30:38 UTC

number of git clones?

What process are you using to keep your working copy of Jena (assuming you
have a clone on github) from the true master copy of Jena such that you can
create pull requests from you copy and merge them into the master.

So far the only way I have found to do this is to keep 2 copies of the code
in 2 different local git repositories.  the first I pull from master,
update, test, etc. check into my version on github, generate a pull request
from there.

The second is the master from apache git where I pull the code down, and
perform the merge from my github version.

Is there another way to do this?

Claude

-- 
I like: Like Like - The likeliest place on the web
<http://like-like.xenei.com>
LinkedIn: http://www.linkedin.com/in/claudewarren

Re: number of git clones?

Posted by ajs6f <aj...@apache.org>.
This is a great bunch of advice from Rob. The only thing I want to add to it is that I was recently hepped to a really useful tool that Github has created:

https://github.com/github/hub

It's a drop-in replacement for `git`, so all of Rob's notes below (and anything else you find to work with git) will keep working, no change. But it offers some additional commands for working with Github-based projects.

For example, if I wanted to take a look at Chris' recent PR for JENA-1506, I can just type:

git checkout https://github.com/apache/jena/pull/385

(because I have `hub` aliased to `git`) and hub handles the bookkeeping (fetching, pulling, assigning branch names, etc.) to give me:

➜  jena git:(master) git checkout https://github.com/apache/jena/pull/385
remote: Counting objects: 67, done.
remote: Compressing objects: 100% (35/35), done.
remote: Total 67 (delta 18), reused 56 (delta 8), pack-reused 1
Unpacking objects: 100% (67/67), done.
From git://github.com/BuddhistDigitalResourceCenter/jena
 * [new branch]            JENA-1506-PR -> BuddhistDigitalResourceCenter/JENA-1506-PR
Branch BuddhistDigitalResourceCenter-JENA-1506-PR set up to track remote branch JENA-1506-PR from BuddhistDigitalResourceCenter.
Switched to a new branch 'BuddhistDigitalResourceCenter-JENA-1506-PR'
➜  jena git:(BuddhistDigitalResourceCenter-JENA-1506-PR)

and with one command and knowing nothing about where Chris' branch is coming from, I'm ready to go, to examine or merge the PR. (Of course, I'm not going to merge anything, just an example!)

hub provides some other useful tools, for forking on Github and sending PRs and so forth. Well-worth the price of admission!

ajs6f

> On Mar 19, 2018, at 6:44 AM, Rob Vesse <rv...@dotnetrdf.org> wrote:
> 
> You can have multiple remote repositories defined in your local working copy.  Here's the list of my defined remotes on my Jena working copy:
> 
>> git remote -vv
> afs	https://github.com/afs/jena.git (fetch)
> afs	https://github.com/afs/jena.git (push)
> origin	https://git-wip-us.apache.org/repos/asf/jena.git (fetch)
> origin	https://git-wip-us.apache.org/repos/asf/jena.git (push)
> rvesse	ssh://git@github.com/rvesse/jena.git (fetch)
> rvesse	ssh://git@github.com/rvesse/jena.git (push)
> 
> You can use git remote add <name> <url> to add additional remotes and various other git remote commands to manipulate these
> 
> When doing certain remote operations - pull/push/fetch - then you just need to be more explicit about where to push/pull from.  For example to push a new dev branch to my github clone:
> 
>> git push -u rvesse <branch-name>
> 
> Where <branch-name> is the local branch name you are wanting to push
> 
> Or to pull a specific branch:
> 
>> git pull <remote-name> 
> 
> This tries to pull updates for the given branch based on its locally set upstream branch, git branch -vv shows details of your local branches and their corresponding remotes:
> 
>> git branch -vv
>  JENA-1405       5937830 [rvesse/JENA-1405] Use better logging approach (JENA-1405)
>  JENA-1407       9e2b4ce [rvesse/JENA-1407: ahead 1] Change degree of test parallelism (JENA-1407)
>  JENA-1434       8df3702 [rvesse/JENA-1434] Minor fixes to new code (JENA-1434)
>  JENA-1486       0eeb40d [rvesse/JENA-1486] Make sure to use datasets transactionally (JENA-1486)
>  JENA-1497       44683c4 [rvesse/JENA-1497] Rename test cases and fix warnings (JENA-1497)
>  JENA-507        77a69f1 [origin/JENA-507: gone] Merge branch 'master' into JENA-507
>  JENA-541        cbc2dc2 Initial work on custom headers for SPARQL Updates (JENA-541)
>  JENA-893        3ab3138 More experimentation with splitting BZip2 inputs
>  jena-db-testing 10441d7 [afs/jena-db-testing] Check .delete() in beforeTest
>  jena2           9bc5aa9 [origin/jena2] Yet more fixes and test cases for assignment inlining (JENA-780)
> * master          2e732b4 [origin/master: behind 2] Merge branch 'JENA-1497'
>  obfuscate       08bdbc3 [rvesse/obfuscate] Add naive obfuscation provider
> 
> Or:
> 
>> git fetch --all
>> git pull <remote-name>/<branch-name>
> 
> And merging a specific remote branch:
> 
>> git fetch --all
>> git merge <remote-name>/<branch-name>
> 
> Similarly to checkout a specific remote branch locally:
> 
>> git fetch --all
>> git checkout -B <branch-name> --track <remote-name>/<branch-name>
> 
> You just need to be a little careful about doing pull/push without being explicit about the target remote as otherwise you'll go to/from the default (usually origin) which may not always be desired
> 
> Rob
> 
> On 19/03/2018, 10:31, "Claude Warren" <cl...@xenei.com> wrote:
> 
>    What process are you using to keep your working copy of Jena (assuming you
>    have a clone on github) from the true master copy of Jena such that you can
>    create pull requests from you copy and merge them into the master.
> 
>    So far the only way I have found to do this is to keep 2 copies of the code
>    in 2 different local git repositories.  the first I pull from master,
>    update, test, etc. check into my version on github, generate a pull request
>    from there.
> 
>    The second is the master from apache git where I pull the code down, and
>    perform the merge from my github version.
> 
>    Is there another way to do this?
> 
>    Claude
> 
>    -- 
>    I like: Like Like - The likeliest place on the web
>    <http://like-like.xenei.com>
>    LinkedIn: http://www.linkedin.com/in/claudewarren
> 
> 
> 
> 
> 


Re: number of git clones?

Posted by Rob Vesse <rv...@dotnetrdf.org>.
You can have multiple remote repositories defined in your local working copy.  Here's the list of my defined remotes on my Jena working copy:

> git remote -vv
afs	https://github.com/afs/jena.git (fetch)
afs	https://github.com/afs/jena.git (push)
origin	https://git-wip-us.apache.org/repos/asf/jena.git (fetch)
origin	https://git-wip-us.apache.org/repos/asf/jena.git (push)
rvesse	ssh://git@github.com/rvesse/jena.git (fetch)
rvesse	ssh://git@github.com/rvesse/jena.git (push)

You can use git remote add <name> <url> to add additional remotes and various other git remote commands to manipulate these

When doing certain remote operations - pull/push/fetch - then you just need to be more explicit about where to push/pull from.  For example to push a new dev branch to my github clone:

> git push -u rvesse <branch-name>

Where <branch-name> is the local branch name you are wanting to push

Or to pull a specific branch:

> git pull <remote-name> 

This tries to pull updates for the given branch based on its locally set upstream branch, git branch -vv shows details of your local branches and their corresponding remotes:

> git branch -vv
  JENA-1405       5937830 [rvesse/JENA-1405] Use better logging approach (JENA-1405)
  JENA-1407       9e2b4ce [rvesse/JENA-1407: ahead 1] Change degree of test parallelism (JENA-1407)
  JENA-1434       8df3702 [rvesse/JENA-1434] Minor fixes to new code (JENA-1434)
  JENA-1486       0eeb40d [rvesse/JENA-1486] Make sure to use datasets transactionally (JENA-1486)
  JENA-1497       44683c4 [rvesse/JENA-1497] Rename test cases and fix warnings (JENA-1497)
  JENA-507        77a69f1 [origin/JENA-507: gone] Merge branch 'master' into JENA-507
  JENA-541        cbc2dc2 Initial work on custom headers for SPARQL Updates (JENA-541)
  JENA-893        3ab3138 More experimentation with splitting BZip2 inputs
  jena-db-testing 10441d7 [afs/jena-db-testing] Check .delete() in beforeTest
  jena2           9bc5aa9 [origin/jena2] Yet more fixes and test cases for assignment inlining (JENA-780)
* master          2e732b4 [origin/master: behind 2] Merge branch 'JENA-1497'
  obfuscate       08bdbc3 [rvesse/obfuscate] Add naive obfuscation provider

Or:

> git fetch --all
> git pull <remote-name>/<branch-name>

And merging a specific remote branch:

> git fetch --all
> git merge <remote-name>/<branch-name>

Similarly to checkout a specific remote branch locally:

> git fetch --all
> git checkout -B <branch-name> --track <remote-name>/<branch-name>

You just need to be a little careful about doing pull/push without being explicit about the target remote as otherwise you'll go to/from the default (usually origin) which may not always be desired

Rob

On 19/03/2018, 10:31, "Claude Warren" <cl...@xenei.com> wrote:

    What process are you using to keep your working copy of Jena (assuming you
    have a clone on github) from the true master copy of Jena such that you can
    create pull requests from you copy and merge them into the master.
    
    So far the only way I have found to do this is to keep 2 copies of the code
    in 2 different local git repositories.  the first I pull from master,
    update, test, etc. check into my version on github, generate a pull request
    from there.
    
    The second is the master from apache git where I pull the code down, and
    perform the merge from my github version.
    
    Is there another way to do this?
    
    Claude
    
    -- 
    I like: Like Like - The likeliest place on the web
    <http://like-like.xenei.com>
    LinkedIn: http://www.linkedin.com/in/claudewarren