Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "OSEE/Workspace Setup"
Line 1: | Line 1: | ||
This guide describes how to set up an Eclipse workspace to develop OSEE. | This guide describes how to set up an Eclipse workspace to develop OSEE. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
= Working with Git = | = Working with Git = | ||
Line 25: | Line 5: | ||
This guide explains how to set up a local OSEE source repository using Git. When you complete it, you will have an Eclipse workspace populated with the OSEE projects from your Git working directory, with full tool support from both the EGit plugin and the original command-line <tt>git</tt>. | This guide explains how to set up a local OSEE source repository using Git. When you complete it, you will have an Eclipse workspace populated with the OSEE projects from your Git working directory, with full tool support from both the EGit plugin and the original command-line <tt>git</tt>. | ||
− | === | + | == Installation == |
+ | |||
+ | === Install Git on Windows === | ||
# Download the full installer for the [http://code.google.com/p/msysgit/downloads/list latest version of msysGit]. | # Download the full installer for the [http://code.google.com/p/msysgit/downloads/list latest version of msysGit]. | ||
# Run the installer, using the default settings. | # Run the installer, using the default settings. | ||
# Open Git Bash and run the following commands: | # Open Git Bash and run the following commands: | ||
− | |||
− | |||
## <tt>git config --global http.proxy "proxy_url:proxy_port"</tt> (if you have a proxy) | ## <tt>git config --global http.proxy "proxy_url:proxy_port"</tt> (if you have a proxy) | ||
## <tt>git config --global http.sslcainfo \bin/curl-ca-bundle.crt</tt> | ## <tt>git config --global http.sslcainfo \bin/curl-ca-bundle.crt</tt> | ||
Line 37: | Line 17: | ||
## <tt>git config --global http.postbuffer "524288000"</tt> | ## <tt>git config --global http.postbuffer "524288000"</tt> | ||
## <tt>git config --global core.autocrlf "false"</tt> | ## <tt>git config --global core.autocrlf "false"</tt> | ||
− | |||
− | |||
=== Installing EGit === | === Installing EGit === | ||
Line 52: | Line 30: | ||
# ''Do not'' copy the projects into the workspace. | # ''Do not'' copy the projects into the workspace. | ||
# Finish the import. | # Finish the import. | ||
+ | |||
+ | == OSEE Git Developer Workflow == | ||
+ | |||
+ | ===Setup=== | ||
+ | # Create a directory for git repository (example: c:\gitroot). | ||
+ | # cd into the local git directory | ||
+ | # Create a clone of the OSEE repository. | ||
+ | ## <tt>git clone <nowiki>https://<commiterId>@git.eclipse.org/gitroot/osee/org.eclipse.osee.git</nowiki></tt> | ||
+ | # cd into org.eclipse.osee folder (the local OSEE repository) | ||
+ | # Add credential information | ||
+ | ## <tt>git config user.email my_committer_email@address.com</tt> | ||
+ | ## <tt>git config user.name "Committer Name"</tt> | ||
+ | # Create tracking development branch | ||
+ | ## <tt>git checkout -b 0.9.6_dev origin/0.9.6_dev</tt> | ||
+ | '''Note: Development should only be performed on the development branch (never commit to master, or *_int branches)''' | ||
+ | ===Local Development=== | ||
+ | #Ensure you are in the dev branch | ||
+ | ##<tt>git checkout 0.9.6_dev</tt> | ||
+ | #Update local 0.9.6_dev branch with remote changes before any changes are made | ||
+ | ##<tt>git pull</tt> | ||
+ | #You can check what was pulled in by running<tt>git log</tt> | ||
+ | #You can work directly on the development branch or create a local feature/bug branch to encapsulate work | ||
+ | ##Option1: Create local branch | ||
+ | ###<tt>git checkout -b <WORK_BRANCH_NAME> 0.9.6_dev</tt> | ||
+ | See naming work branches below | ||
+ | ###Continue to local changes | ||
+ | ##Option2: Make changes directly on the development branch | ||
+ | ***Check state (index and working tree): <tt>git status</tt> | ||
+ | ***Add a new untracked file: <tt>git add <file_path></tt> | ||
+ | ***Add all untracked and modified files: <tt>git add -A</tt> | ||
+ | ***Commit a change: <tt>git commit -am "Comment Format Below"</tt> | ||
+ | ***Rebase against the remote branch frequently to prevent branch from diverging: | ||
+ | ****<tt>git fetch origin 0.9.6.dev</tt> | ||
+ | ****<tt>git rebase origin/0.9.6.dev</tt> | ||
+ | |||
+ | ===Incorporation a Finished Working Branch Into Develop=== | ||
+ | #Switch to development branch: <tt>git checkout 0.9.6_dev</tt> | ||
+ | #Merge work branch into development: <tt>git merge --no-ff <WORK_BRANCH_NAME></tt> | ||
+ | #Once work has been pushed to remote you can delete your local development branch: <tt>git branch -d <WORK_BRANCH_NAME></tt> | ||
+ | #Push Changes to Remote: <tt>git push origin 0.9.6_dev</tt> | ||
+ | |||
+ | ===Common Remote Operations=== | ||
+ | *Compare two branches: <tt>git diff branch1..branch2</tt> | ||
+ | *Sharing a local work branch with others | ||
+ | ##Switch to working branch: <tt>git checkout <WORK_BRANCH_NAME></tt> | ||
+ | ##Push working branch to remote: <tt>git push origin <WORK_BRANCH_NAME>:refs/heads/<WORK_BRANCH_NAME></tt> | ||
+ | |||
+ | === Naming Work branches === | ||
+ | Use the following format: | ||
+ | |||
+ | === PREFIX === | ||
+ | |||
+ | *Change Types | ||
+ | **Bug | ||
+ | **Feature | ||
+ | **Refactor | ||
+ | |||
+ | Example: | ||
+ | "Refactor[ID]: Update copyright statements" | ||
+ | "Bug[ID]: Fix concurrency issue in artifact update" | ||
+ | "Feature[ID]: Added conflict detection" | ||
+ | |||
+ | *Identifiers | ||
+ | **Bugzilla Number - bgz_12314 | ||
+ | **Action HRID - ats_HRID | ||
=== Git common configuration (in a file) === | === Git common configuration (in a file) === | ||
Line 222: | Line 265: | ||
Repository path: /cvsroot/org.eclipse | Repository path: /cvsroot/org.eclipse | ||
connection type: extssh | connection type: extssh | ||
+ | |||
+ | == SVN Checkout == | ||
+ | |||
+ | Download and import the relevant (client or application server) OSEE Team Project Set file frrom https://dev.eclipse.org/svnroot/technology/org.eclipse.osee/trunk/plugins/org.eclipse.osee.support.config/projectSets/ into your workspace. | ||
+ | |||
+ | In Eclipse, open the '''SVN Repository''' perspective and check out https://dev.eclipse.org/svnroot/technology/org.eclipse.osee/trunk/. The username and password can be left blank for anonymous read-only access. | ||
+ | |||
+ | == Configure a Development Runtime == | ||
+ | |||
+ | Using an SVN client such as [http://www.eclipse.org/subversive Subversive], check out into your Eclipse workspace all the projects from https://dev.eclipse.org/svnroot/technology/org.eclipse.osee/trunk/. When configuring this SVN repository leave the user name and password blank in order to get anonymous, read-only access. | ||
+ | |||
+ | # Follow the [http://www.eclipse.org/osee/documentation/installation/postgresql_install.php PostgreSQL installation instructions]. | ||
+ | #Use the configuration <tt>/org.eclipse.osee.support.config/launchConfig/OSEE Demo Application Server [localhost].launch</tt> to run an OSEE application server | ||
+ | #Use the configuration <tt>/org.eclipse.osee.ats.config.demo/MasterTestSuite_DemoDbInit.launch</tt> to initialize an OSEE database | ||
+ | #Use the configuration <tt>/org.eclipse.osee.ats.config.demo/MasterTestSuite_DemoDbPopulate.launch</tt> to populate the database for demonstration purposes | ||
+ | #Use the configuration <tt>/org.eclipse.osee.support.config/launchConfig/OSEE Demo product [localhost].launch</tt> to run a local OSEE client |
Revision as of 20:34, 8 September 2010
This guide describes how to set up an Eclipse workspace to develop OSEE.
Contents
Working with Git
This guide explains how to set up a local OSEE source repository using Git. When you complete it, you will have an Eclipse workspace populated with the OSEE projects from your Git working directory, with full tool support from both the EGit plugin and the original command-line git.
Installation
Install Git on Windows
- Download the full installer for the latest version of msysGit.
- Run the installer, using the default settings.
- Open Git Bash and run the following commands:
- git config --global http.proxy "proxy_url:proxy_port" (if you have a proxy)
- git config --global http.sslcainfo \bin/curl-ca-bundle.crt
- git config --global http.sslverify "false"
- git config --global http.postbuffer "524288000"
- git config --global core.autocrlf "false"
Installing EGit
Install the latest stable versions of EGit and JGit from this update site.
Setting up a workspace
- Create a new Eclipse workspace.
- File > Import... > Existing Projects into Workspace
- As the root directory, select the plugins folder in the OSEE repository.
- Select all projects.
- Do not copy the projects into the workspace.
- Finish the import.
OSEE Git Developer Workflow
Setup
- Create a directory for git repository (example: c:\gitroot).
- cd into the local git directory
- Create a clone of the OSEE repository.
- git clone https://<commiterId>@git.eclipse.org/gitroot/osee/org.eclipse.osee.git
- cd into org.eclipse.osee folder (the local OSEE repository)
- Add credential information
- git config user.email my_committer_email@address.com
- git config user.name "Committer Name"
- Create tracking development branch
- git checkout -b 0.9.6_dev origin/0.9.6_dev
Note: Development should only be performed on the development branch (never commit to master, or *_int branches)
Local Development
- Ensure you are in the dev branch
- git checkout 0.9.6_dev
- Update local 0.9.6_dev branch with remote changes before any changes are made
- git pull
- You can check what was pulled in by runninggit log
- You can work directly on the development branch or create a local feature/bug branch to encapsulate work
- Option1: Create local branch
- git checkout -b <WORK_BRANCH_NAME> 0.9.6_dev
- Option1: Create local branch
See naming work branches below
- Continue to local changes
- Option2: Make changes directly on the development branch
- Check state (index and working tree): git status
- Add a new untracked file: git add <file_path>
- Add all untracked and modified files: git add -A
- Commit a change: git commit -am "Comment Format Below"
- Rebase against the remote branch frequently to prevent branch from diverging:
- git fetch origin 0.9.6.dev
- git rebase origin/0.9.6.dev
Incorporation a Finished Working Branch Into Develop
- Switch to development branch: git checkout 0.9.6_dev
- Merge work branch into development: git merge --no-ff <WORK_BRANCH_NAME>
- Once work has been pushed to remote you can delete your local development branch: git branch -d <WORK_BRANCH_NAME>
- Push Changes to Remote: git push origin 0.9.6_dev
Common Remote Operations
- Compare two branches: git diff branch1..branch2
- Sharing a local work branch with others
- Switch to working branch: git checkout <WORK_BRANCH_NAME>
- Push working branch to remote: git push origin <WORK_BRANCH_NAME>:refs/heads/<WORK_BRANCH_NAME>
Naming Work branches
Use the following format:
PREFIX
- Change Types
- Bug
- Feature
- Refactor
Example: "Refactor[ID]: Update copyright statements" "Bug[ID]: Fix concurrency issue in artifact update" "Feature[ID]: Added conflict detection"
- Identifiers
- Bugzilla Number - bgz_12314
- Action HRID - ats_HRID
Git common configuration (in a file)
[core] repositoryformatversion = 0 filemode = false bare = false logallrefupdates = true symlinks = false ignorecase = true hideDotFiles = dotGitOnly autocrlf = false [http] sslverify = false postbuffer = 524288000 [svn-remote "svn"] url = https://dev.eclipse.org/svnroot/technology/org.eclipse.osee fetch = trunk:refs/remotes/trunk branches = branches/*:refs/remotes/* tags = tags/*:refs/remotes/tags/* [apply] whitespace = fix [diff] renames = copy [merge] conflictstyle = diff3 [alias] s = status c = commit co = checkout cpnx = cherry-pick --no-commit -x rhh = reset --hard HEAD [user] name = Gallus Anonymus email = GallusAnonymus@your_email.com
You can save the following in a .git/config_file and load it in with:
git config --file -- .git/config_file
Connecting to the Git repository
- Highlight all of the projects just imported from the repository.
- Right click and select Team > Share Project... (not Share Projects..., which is provided by SVN)
- Select Git as the repository type; click Next.
- Highlight all the lines displayed in the combo box (Ctrl+A).
- Click Finish.
Git Commands
Stash |
git stash save <message> git stash list git stash show -p stash@{0} git stash drop stash@{0} git stash pop |
Changes |
git show --name-only HASH path git diff HASH |
Compare two commits |
git diff OLDHASH NEWHASH |
Undo |
git rebase -i HEAD~5 git reset --hard HEAD git reset --hard HEAD~3 git reset --hard <specific_commit_id> |
To replace with incoming file so you can re-make your changes (or abandon them):
git checkout --[theirs|our] <path>
- Git Log
View history for a given path even if it has been moved/renamed:
git log --follow [current path]
View current branch activity:
git log --name-only HASH git lg | head
Show full history even with removed commits
git reflog show [log-options] master
- Branching and Merging
git checkout -b newLocalBranchName existingBranch
i.e.
git checkout -b 91 remotes/MS_0_9_1_20100111
creates a local tracking branch called 91
Switch branches:
git checkout [master|94|...]
Merge onto current branch:
git merge branch
git rebase --continue
Generating individual patches (one per commit) to submit by email (or bug report):
git format-patch -o ../ trunk..HEAD
will export all commits made to current branch, from trunk to HEAD.
-o ../
will put them one level above in individual .patch files
Generate a big patch for your local changes, (good for backup)
git diff trunk HEAD -p > Z:/backup_date_time.patch
In this case Z:\ is mounted as a shared windows folder, so if you do not have faith in your local backup software, this could help you quickly restore your work.
Splitting commits
In case you have multiple, conceptually unrelated changes in a single commit you can split them by doing a regular rebase:
git rebase -i HASH_WHERE_TO_START_FROM
mark 'e' or 'edit' the commit you want to Edit/Split. When you get dropped back into the shell, issue:
git reset HEAD^
which effectively undoes that commit and leaves the modified files unstaged ProGit Book Chapter 6-4
Afterwards you can 'add' and 'commit' changes as appr. To resume rebase operation issue the simple:
git rebase --continue
to continue.
Conflicts
Git Resources
- GIT PRO BOOK
- Git Community Book
- Git Tips
- Git Cheatsheets
- Git Brain Dump
- Sample Git Workflow
- GIT Branches, RC, etc Workflow
- GIT Branching Model
- GIT for Eclipse Users
Locations of all OSEE bundles
Git org.eclipse.osee
- git: /org.eclipse.osee/features/*
- git: /org.eclipse.osee/plugins/*
- git: /org.eclipse.osee/releng/*
Orbit Release Engineering Bundles
host: dev.eclipse.org Repository path: /cvsroot/tools connection type: extssh
- org.eclipse.orbit/org.eclipse.orbit.build.feature.set1
- org.eclipse.orbit/org.eclipse.orbit.releng
SWT Nebula Bundles
host: dev.eclipse.org Repository path: /cvsroot/technology connection type: pserver user: anonymous
- /cvsroot/technology/org.eclipse.swt.nebula/org.eclipse.nebula.widgets.xviewer
OSEE Website
host: dev.eclipse.org Repository path: /cvsroot/org.eclipse connection type: extssh
SVN Checkout
Download and import the relevant (client or application server) OSEE Team Project Set file frrom https://dev.eclipse.org/svnroot/technology/org.eclipse.osee/trunk/plugins/org.eclipse.osee.support.config/projectSets/ into your workspace.
In Eclipse, open the SVN Repository perspective and check out https://dev.eclipse.org/svnroot/technology/org.eclipse.osee/trunk/. The username and password can be left blank for anonymous read-only access.
Configure a Development Runtime
Using an SVN client such as Subversive, check out into your Eclipse workspace all the projects from https://dev.eclipse.org/svnroot/technology/org.eclipse.osee/trunk/. When configuring this SVN repository leave the user name and password blank in order to get anonymous, read-only access.
- Follow the PostgreSQL installation instructions.
- Use the configuration /org.eclipse.osee.support.config/launchConfig/OSEE Demo Application Server [localhost].launch to run an OSEE application server
- Use the configuration /org.eclipse.osee.ats.config.demo/MasterTestSuite_DemoDbInit.launch to initialize an OSEE database
- Use the configuration /org.eclipse.osee.ats.config.demo/MasterTestSuite_DemoDbPopulate.launch to populate the database for demonstration purposes
- Use the configuration /org.eclipse.osee.support.config/launchConfig/OSEE Demo product [localhost].launch to run a local OSEE client