Skip to main content

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.

Jump to: navigation, search

OSEE/Workspace Setup

< OSEE
Revision as of 23:33, 9 September 2010 by Roberto.e.escobar.boeing.com (Talk | contribs) (Additional Git Commands)

This guide describes how to set up an Eclipse workspace to develop OSEE.

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

  1. Download the full installer for the latest version of msysGit.
  2. Run the installer, using the default settings.
  3. 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

  1. Create a new Eclipse workspace.
  2. File->Import...->Git->Projects from Git this opens the Import Projects from Git dialog
  3. Click on Add to add a git repository path
  4. Browse to the location of the local cloned git repositories
  5. Select the repository to import projects from
  6. Click Next
  7. From the Select a wizard and decide how to share the imported projects page, select the Share new projects interactively radio option in the Method for sharing projects after project creation group
  8. Click Next
  9. From the Import Projects page, click the Select All button to check all the projects
  10. Click Next
  11. From the Share Projects with Git page
  12. Click Finish to finish the import

OSEE Git Development Workflow

The goals of the workflow:

  • Fail fast
    • Code conflicts and integration problems should be discovered as soon as possible
    • Fix small problems often instead of fixing large problems seldom
  • Always releasable
  • Keep it simple and repeatable

The OSEE Git repository contains the following main branches:

  • master: origin/master is the main branch where HEAD always reflects a production ready state.
  • build_dev: origin/build_dev is the main branch where HEAD always reflects a state with the latest delivered development changes for integration.
  • build_int: origina/build_int is the main branch where HEAD always reflects a state with the latest changes from development that have been tested/built and ready for customer assurance testing. The integration branch reflects the last development changes that have been incorporated into a release candidate.

Developers wanting to incorporate a change for a specific build should make the change in that build's development branch (ex. 0.9.6_dev).

Developers should not make changes on master or _int branches

Setup

  1. Create a directory for the git repository (example: c:\gitroot)
  2. cd into the local git directory
  3. Create a clone of the OSEE repository: git clone https://<commiterId>@git.eclipse.org/gitroot/osee/org.eclipse.osee.git
  4. cd into org.eclipse.osee folder (the local OSEE repository)
  5. Add credential information:
git config user.email my_committer_email@address.com

git config user.name "Committer Name"

Local Development

Development should only be performed on a development branch (never commit to master, or *_int branches)

Track a development branch

Before starting development, we need to create a local tracking development branch. You only need to perform this step at the beginning of the development cycle.

To create a tracking development branch: git checkout -b 0.9.6_dev origin/0.9.6_dev

Make Change

  1. Keep development branch up-to-date
    1. Switch to the target build development branch: git checkout 0.9.6_dev
    2. Update local development branch with remote changes before any changes are made: git pull
    3. Optionally, you can inspect the changes pulled in: git log
  2. Making Changes: When working on a change, you have the option of making the changes directly on the development branch or creating a local feature/bug branches to encapsulate the work.
    • To create a local branch: git checkout -b [Bug|Feature|Refactor]_[ID]_description 0.9.6_dev
    • 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 - See comment conventions below: git commit -am "Comment" or git commit to open editor for comment editting
    • Rebase against the remote branch frequently to prevent branch from diverging:
    1. git pull --rebase 0.9.6.dev
Creating a local working branch allows for better grouping of related changes and easier task switching
Always follow comment and branch naming convetions

Incorporate a Finished Working Branch Into Development Branch

  1. Switch to development branch: git checkout 0.9.6_dev
  2. Rebase the development branch to ensure it has the latest changes: git pull --rebase
  3. Merge work branch into development: git merge --no-ff <working_branch_name>
  4. (Optional) - Once work has been pushed to remote you can delete your local development branch: git branch -d <working_branch_name>

Push local Development changes to remote Development branch

  1. Rebase the development branch to ensure it has the latest changes: git pull --rebase 0.9.6.dev
  2. Push Changes to Remote: git push origin 0.9.6_dev

Additional Git Commands

Collection of Useful Git Commands

Name Description Commands
Stash Stores changes into a stack
git stash save <message>
git stash list
git stash show -p stash@{0}
git stash drop stash@{0}
git stash pop
Show Modified File Names Lists files modified
git show --name-only HASH path
Show changes introduced by each commit shows commit change information
git whatchanged --name-only
git whatchanged -2 --name-only #to display the last two
git whatchanged --format=email --name-only #display in email format
Undo Undo local changes
git rebase -i HEAD~5
git reset --hard HEAD
git reset --hard HEAD~3
git reset --hard <specific_commit_id>
Show Commit File Differences Compares files from current commit with previous commit
git diff HASH
Compare two commits Compares files between two commits
git diff OLDHASH NEWHASH
Compare two branches Compares changes made between two branches
git diff branch1..branch2
git diff localBranchName..origin/remoteName
Git Log view history for a given path even if it has been moved/renamed
git log --follow [current path]
Git Log vew current branch activity
git log --name-only HASH
git log --graph --pretty=format:'%Cred%h%Creset 
 -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' 
 --abbrev-commit --date=relative
Git Log Print single log entry
git log -1 branch_name
Git Log Show full history even with removed commits
git reflog show [log-options] master
Create a local branch Creates a branch and switches working tree to new branch
git checkout -b newLocalBranchName sourceBranch
Create a local tracking branch Creates a local tracking branch called 91 and switches working tree
git checkout -b 91 remotes/MS_0_9_1_20100111 
Switch branches switches the working tree to a different branch
git checkout [master|94|...]
Sharing a local work branch with others Switch to working branch, Push working branch to remote
git checkout <working_branch_name>
git push origin <working_branch_name>:refs/heads/<working_branch_name>
Merge onto current branch Merge branch into current branch, if there is nothing to merge a fast-forward will be performed. HEAD pointer moved to HEAD of branch
git merge branch
Branching and Merging To replace with incoming file so you can re-make your changes (or abandon them)
git checkout --[theirs|our] <path>
Continue rebasing After conflicts have been resolved
git rebase --continue
Patches Generating individual patches (one per commit) to submit by email (or bug report), exports all commits made to current branch, from trunk to HEAD "-o ../" puts them one level above in individual .patch files
git format-patch -o ../ trunk..HEAD
Local Change Patch Generate a big patch for your local changes, (good for backup), 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.
git diff trunk HEAD -p > Z:/backup_date_time.patch
Splitting commits In case you have multiple, conceptually unrelated changes in a single commit you can split them by doing an interactive rebase
--Rebase current working tree
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:
 git rebase --continue
Change author name/email of a commit with yours Edit commit author, email, or comments using the following. This should only be performed on commits that have not been pushed to the remote repository. If you just need to change the author name you can change --reset-author with --author AUTHOR NAME
git rebase -i SHA_OF_COMMIT_PREVIOUS_TO_TARGET
git commit --amend --reset-author -- Repeat this and the next step for each file
git rebase --continue
Clean up untracked files from repository Remove untracked files and directories from the working tree
git clean -fdx


Comment Conventions

A commit comment consists of the following written in present tense:

  • a summary line short (50 chars or less) summary of changes made. Should use the following format: CHANGE_TYPE[ID]: Summary
  • a newline - Always follow your summary with a newline.
  • an (optional) details section: Should be wrapped to 72 columns (git command such as git log don't wrap).

Summary Change Types:

  • Bug Fixes: Any change the fixes problems with the existing code. Tag=bug
  • Features: Any change that is new functionality. Tag=feature
  • Refactors: Changes that are done to improve code design/quality. Tag=refactor

Summary Change Type Identifiers:

  • Bugzilla Number - change originated from a bugzilla item, therefore use the following format: bgz_12314
  • Action HRID - change originated from an ATS action, therefore use the following format: ats_HRID

Examples:

  • Summary Lines:
refactor: A refactor with no id
refactor[ID]: Update copyright statements
bug[ID]: Fix concurrency issue in artifact update
feature[ID]: Added conflict detection
  • Comment with Details:
bug[ats_ABCDE]: Fix artifact copy/paste copying invalid attribute types

Artifact copy/paste code change to check attribute types before creating them in the copied artifact. Additional checks include:

- Change one

- Change two

- Change three

Git Resources

Source Repositories and Access

Name Description Location
Main OSEE Source OSEE Source Code
git clone https:/ /<user.name>@git.eclipse.org/gitroot/osee/org.eclipse.osee.git

org.eclipse.osee
..features/
..plugins/
..releng/
Orbit Release Engineering Bundles 3rd Party Libraries
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 XViewer Source Code
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 OSEE Eclipse Website Source Code
 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.

  1. Follow the PostgreSQL installation instructions.
  2. Use the configuration ../org.eclipse.osee.support.config/launchConfig/OSEE Demo Application Server [localhost].launch to run an OSEE application server
  3. Use the configuration ../org.eclipse.osee.ats.config.demo/MasterTestSuite_DemoDbInit.launch to initialize an OSEE database
  4. Use the configuration ../org.eclipse.osee.ats.config.demo/MasterTestSuite_DemoDbPopulate.launch to populate the database for demonstration purposes
  5. Use the configuration ../org.eclipse.osee.support.config/launchConfig/OSEE Demo product [localhost].launch to run a local OSEE client

Back to the top