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

Difference between revisions of "OSEE/Workspace Setup"

(Git Resources)
(Local Development)
(93 intermediate revisions by 12 users not shown)
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 =
+
== Downloading and Configuring Eclipse == <!-- Be careful if you modify this section - it is linked from the developer's guide by name -->
 +
 
 +
Use a new Eclipse installation with the latest stable version of OSEE that you are developing installed using the updates page. This will ensure that you have the correct bundles in place to provide the required dependencies.
 +
 
 +
== Working with Git ==
 +
<!-- Be careful if you modify this section - it is linked from the developer's guide by name -->
  
 
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 ==
+
  Excellent explanation of the design and architecture of Git - [http://eagain.net/articles/git-for-computer-scientists/ Git for Computer Scientists]
  
=== Install Git on Windows ===
+
== Git Setup & Install ==
 +
#Download GIT for Windows by selecting the [https://msysgit.github.com latest version of msysGit]
 +
##Select '''Run Git From the Windows Command Prompt''' from the '''Adjusting Your PATH environment''' page
 +
##Select '''Checkout as-is, commit as-is''' from the '''Configuring the line ending conversions''' page
 +
#Install '''Diff/Merge Tool''' [http://kdiff3.sourceforge.net/ KDiff3 HomePage]
 +
#Configure the Merge Tool (These settings should help make merging less painful)
 +
##Launch KDiff3 by clicking '''Start->All Programs->KDiff3->KDiff3'''
 +
##In KDiff3, select on '''Settings->Configure''' to open the configuration dialog
 +
##On the '''Editor''' tab, set '''Line end style''' to '''Unix'''
 +
##On the '''Diff''' tab, check the '''Try hard''' check box
 +
##On the '''Merge''' tab, check the '''Auto save and quit on merge without conflicts''' check box
 +
##On the '''Directory''' tab, un-check the '''Backup files (.orig)''' check box
 +
##On the '''Regional Settings''' tab:
 +
###Check the '''Use the same encoding for everything check box
 +
###Select '''Unicode, 8 bit (UTF-8)''' for '''File Encoding for A'''
 +
###Un-Check the first '''Auto Detect Unicode''' check box
 +
##Click '''OK'''
 +
#Fix Window Home to User Home - ''By default, in Windows, Git sets the HOME environment variable of its bash to the value of the HOMEDRIVE variable. When the HOMEDRIVE is mapped to a network drive, this introduces an annoying delay before Git commands execute.''
 +
##In Windows, select '''Start->Control Panel->System''' to open the system properties dialog
 +
##Select the '''Advanced System Settings''' button on the left
 +
##Click the '''Environment Variables''' button
 +
##In the '''User variables for...''' section perform the following:
 +
###Click on '''New''' to open the '''New User Variable''' dialog
 +
###Enter the following:
 +
###:Variable name: '''HOME'''
 +
###:Variable value: '''C:\Documents and Settings\<User>'''
 +
###Click '''OK'''
 +
###Click '''OK'''
 +
#Launch Git Bash Shell by clicking on the Git desktop shortcut [[File:GitShortcut.png]]
 +
#Configure your Git Window:
 +
##Right-click on the title bar
 +
##Select '''Properties''' to open the window properties dialog
 +
##Select the '''Options''' tab
 +
##Under '''Edit Options''' check '''"Quick Edit Mode"'''
 +
##Select the '''Layout''' tab
 +
##Under '''Screen Buffer Size''' enter '''300''' for both width and height
 +
##Click '''OK'''
 +
##Select the '''Modify shortcut that started this window" radio button
 +
##Click '''OK'''
 +
#Update Git Configuration by copy/pasting the following commands into the Git Shell (if behind a firewall add '''-x address:port''' to curl commands)
 +
#: '''echo "cd ~" > ~/.bashrc'''
 +
#: '''curl http://git.eclipse.org/c/osee/org.eclipse.osee.git/plain/plugins/org.eclipse.osee.support.config/.gitconfig > ~/.gitconfig'''
 +
#Restart Git
  
# Download the full installer for the [http://code.google.com/p/msysgit/downloads/list latest version of msysGit].
+
===Setup Git Password Management===
# Run the installer, using the default settings.
+
# Open Git Bash and run the following commands:
+
<tt>git config --global http.proxy "proxy_url:proxy_port" (if you have a proxy)<br/><br/>git config --global http.sslcainfo "/bin/curl-ca-bundle.crt"<br/><br/>git config --global http.sslverify "false"<br/><br/>git config --system http.postbuffer "524288000"<br/><br/>git config --system core.autocrlf "false"</tt>
+
  
====Change Windows HOME setting if mapped to Network====
+
==== GUI ====
 +
To avoid typing your password during remote interactions, perform the following:
 +
#Launch Git Bash Shell by clicking on the Git desktop shortcut [[Image:GitShortcut.png]]
 +
#At the console copy/paste the following commands (if behind a firewall add '''-x address:port''' to curl commands):
 +
## '''curl http://git.eclipse.org/c/osee/org.eclipse.osee.git/plain/plugins/org.eclipse.osee.support.config/.managePasswords > ~/.managePasswords'''
 +
## '''curl http://git.eclipse.org/c/osee/org.eclipse.osee.git/plain/plugins/org.eclipse.osee.support.config/inputDialog.tcl > ~/inputDialog.tcl'''
 +
## '''git config --global core.askpass "$HOME/.managePasswords"'''
 +
## '''git config --global alias.passwd \!"~/.managePasswords update"'''
  
By default, in Windows, git sets the HOME environment variable used by its bash to whatever the HOMEDRIVE variable is set to.
+
:*Upon the first Git remote repository interaction, Git will ask for your password by opening an input dialog.
When the HOMEDRIVE is mapped to a network drive, this introduces an annoying delay before git commands execute.
+
:*If you need to change your password type: '''git passwd'''
  
To change the HOME directory setting, perform the following steps:
+
==== Simple plain text file ====
#Copy the following files from your mapped HOMEDRIVE to the directory where you'd like your real HOME directory to be; for this example "C:\UserData\git" will be used.
+
If you would like to store your password in a flat file and edit in plain text editor like TextEdit, TextMate, Vi(M)??, Emacs you can use the following file that should reside in your <code>%HOME%</code> or <code>$HOME</code> directory.
#.gitconfig, .gitk, .bash_history, .ssh, (and anything else that you clearly know is part of your git bash usage)
+
#Create a "HOME" variable in Windows that points to your desired directory:
+
##Right-Click on MyComputer (Desktop or Start menu) and select Properties.
+
##Click the Advanced tab and then the Environment Variables button at the bottom.
+
##In the "User variables" area click New. 
+
##Enter the following without the quotes.
+
##*Variable name: "HOME"
+
##*Variable value: <path to directory as seen by git bash>; e.g. "/c/UserData/git"
+
#Click OK twice to save the changes and close out the System Properties window.
+
#Restart your git bash session.
+
  
====Change default drive on GIT Bash Startup====
+
<pre>/c/Documents and Settings/username/_netrc</pre>
After a git bash restart, you will notice that the prompt defaults to the Windows HOMEDRIVE instead of the new home directory "~".
+
This is due to cmd.exe using the Windows HOMEDRIVE location.
+
To get around this, do the following:
+
#Create a ".bashrc" file in your new HOME directory and put "cd ~" on the first line.
+
  
====Additional Windows Settings====
+
<pre>
 +
machine your.server.name.without.any.http
 +
login john.smith
 +
password smithsonian
 +
machine another.server.machine.repository.of.which.you.access
 +
login john.q.smith
 +
password smithsonian1
 +
</pre>
  
Change the size of the <b>cmd</b> window:
+
You're done.
#To start drag the bottom of the window to a desired height.
+
 
#Next, Right-Click on the title bar and select Properties
+
[http://confluence.atlassian.com/display/FISHEYE/Permanent+authentication+for+Git+repositories+over+HTTP%28S%29 Credits]
#Click the Layout tab and change the "Screen Buffer Size" to something like 160 Width and 1000 Height; increase the "Window Size" Width to match your buffer size (the Height was set when you dragged the window bigger).
+
 
#Fonts can be changed on the Font tab.
+
===Additional Windows Settings (Optional)===
#Click OK and select the "Modify shortcut…" option.
+
  
 
Not happy with the font choices of Lucida Console and Raster Fonts?
 
Not happy with the font choices of Lucida Console and Raster Fonts?
Line 57: Line 100:
 
#Go back to the Font tab and select your font!
 
#Go back to the Font tab and select your font!
  
=== Installing EGit ===
+
== OSEE Git Development Workflow ==
  
Install the latest stable versions of EGit and JGit from [http://download.eclipse.org/egit/updates this update site].
+
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
  
=== Setting up a workspace ===
+
The OSEE Git repository contains the following main branches:
 +
*'''master:''' ''origin/master'' is the main branch where ''HEAD'' always reflects a production ready state.
 +
*'''dev:''' ''origin/dev'' is the main branch where ''HEAD'' always reflects a state with the latest delivered development changes for integration.
 +
*'''0.XX.X:''' ''origin/0.XX.X'' 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. This 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. dev).<br/>
 +
: &#9758; '''Developers should not make changes on master branches'''
 +
 
 +
== OSEE GIT Repository ==
 +
 
 +
Create a repository to clone the following branches so they can be imported into OSEE. (ex: /C/UserData/GIT/)
 +
 
 +
'''Committer (write-access)'''
 +
 
 +
In the GIT shell, navigate to the repository you created above and run the following commands. This will clone the branches you need into your repository.
 +
 
 +
git clone https://git.eclipse.org/r/osee/org.eclipse.osee.git
 +
git clone https://git.msc.az.boeing.com/r/osee/lba.osee.git
 +
git clone https://git.msc.az.boeing.com/r/osee/org.eclipse.ip.git
 +
 
 +
[http://git.eclipse.org/c/osee/org.eclipse.osee.git OSEE GIT Web Portal]
 +
 
 +
'''NOTE:''' If you are having permission issues cloning these locations, please see your system administrator to get you access to these repositories, an LDAP account as well as a GERRIT password.
 +
 
 +
== Setting up a workspace ==
 +
 
 +
=== Option 1 ===
  
 
#Create a new Eclipse workspace.
 
#Create a new Eclipse workspace.
 
#'''File->Import...->Git->Projects from Git''' this opens the '''Import Projects from Git''' dialog
 
#'''File->Import...->Git->Projects from Git''' this opens the '''Import Projects from Git''' dialog
 +
#Double Click '''Existing local repository'''
 
#Click on '''Add''' to add a git repository path
 
#Click on '''Add''' to add a git repository path
#Browse to the location of the local cloned git repositories
+
#Browse to the location of the local cloned git repositories (ex: /c/UserData/GIT)
#Select the repository to import projects from
+
#Select the repositories to import projects from
 +
#Click '''Finish'''
 +
#From the '''Select a Git Repository''' page, click the project you wish to import and click '''Next'''
 +
#From the '''Select a wizard to use for importing projects''' page, click '''Next''' again
 +
#From the '''Import Projects''' page
 +
#Click '''Finish''' to finish the import
 +
 
 +
'''NOTE:''' repeat these steps for each project you wish to import.
 +
 
 +
=== Option 2 ===
 +
 
 +
#Create a new Eclipse workspace.
 +
#Open the "Git Repository Exploring" perspective
 +
#Click on the "Clone a Git Repository and add the clone to this view" button
 +
#Put "http://git.eclipse.org/gitroot/osee/org.eclipse.osee.git" (read-only example) in the URL
 +
#Click '''Next'''
 +
#Pick the branch(es) you want to import (e.g. "master")
 
#Click '''Next'''
 
#Click '''Next'''
 +
#Click '''Finish'''
 +
#Wait for the repository to import
 +
#Right-click on the repository and select '''Import Projects...'''
 
#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
 
#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
 
#Click '''Next'''
 
#Click '''Next'''
Line 76: Line 170:
 
#Click '''Finish''' to finish the import
 
#Click '''Finish''' to finish the import
  
== OSEE GIT Repository ==  
+
=== Option 3 ===
 +
Acquiring OSEE source code without a GIT repository.  This is the 'simplest' but also least flexible since it does not prepare you to push your changes. This is a great method for quick debugging at a user's workstation (i.e.: a non-development workstation).
  
'''Anonymous (read-only)'''
+
#Install OSEE locally
git clone git://git.eclipse.org/gitroot/osee/org.eclipse.osee.git
+
#Open OSEE with a brand new workspace
git clone http://git.eclipse.org/gitroot/osee/org.eclipse.osee.git
+
#Window-->Open Perspective-->Java
 +
#Right-click in the Package Explorer
 +
#Select Import...
 +
#Select Plug-in Development-->Plug-ins and Fragments
 +
#In the "Import As" frame select "Projects with source folders" and click Next
 +
#In the "Plug-ins and Fragments Found:" list box select "org.eclipse.osee.framework.plugin.core(...)"
 +
#Click "Add->"
 +
#Click "Required Plug-ins->"
 +
#Click Finish
 +
''Running:''
 +
#Wait for "Building workspace" to complete
 +
#Select Run-->Debug Configurations...
 +
#Select "Ecplipse Application" from the list on the left side of the dialog
 +
#Click the "New launch configuration" button in the upper left corner of the dialog (see screenshot below)
 +
#Click Debug (if you get an error "Errors exist in require project(s)" try clicking Proceed)
 +
[[Image:OseeDebugConfigSShot.png]]
 +
The preceding instructions for running will not display the OSEE logo splash screen.  Instead the default Eclipse splash screen will be displayed.
  
'''Committer (write-access)'''
+
==Local Development==
git clone https://<user.name>@git.eclipse.org/gitroot/osee/org.eclipse.osee.git
+
git clone ssh://git.eclipse.org/gitroot/osee/org.eclipse.osee.git
+
 
+
=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).<br/>
+
: &#9758; '''Developers should not make changes on master or ''_int'' branches'''
+
 
+
==Setup==
+
  
#Create a directory for the git repository (example: c:\gitroot)
+
: &#9758; '''Development should only be performed on a development branch (never commit to master)'''
#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<br/><br/>git config user.name "Committer Name"</tt>
+
  
 
==Local Development==
 
==Local Development==
  
: &#9758; '''Development should only be performed on a development branch (never commit to master, or *_int branches)'''
+
: &#9758; '''Development should only be performed on a development branch (never commit to a master branch)'''
  
 
===Track a development branch===
 
===Track a development branch===
  
 
Before starting development, we need to create a local tracking 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.
+
You only need to perform this step at the beginning of the development cycle and when you are first cloning your branches.
  
To create a tracking development branch: '''<tt>git checkout -b 0.9.6_dev origin/0.9.6_dev</tt>'''
+
To create a tracking development branch: '''<tt>git checkout -b <branch> origin/<branch></tt>'''
  
 
===Make Change===
 
===Make Change===
 
#Keep development branch up-to-date
 
#Keep development branch up-to-date
##Switch to the target build development branch: '''<tt>git checkout 0.9.6_dev</tt>'''
+
##Switch to the target build development branch: '''<tt>git checkout <branch></tt>'''
 
##Update local development branch with remote changes before any changes are made: '''<tt>git pull</tt>'''
 
##Update local development branch with remote changes before any changes are made: '''<tt>git pull</tt>'''
 
##Optionally, you can inspect the changes pulled in: '''<tt>git log</tt>'''
 
##Optionally, you can inspect the changes pulled in: '''<tt>git log</tt>'''
 
#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.
 
#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: '''<tt>git checkout -b [Bug|Feature|Refactor]_[ID]_description 0.9.6_dev</tt>'''
+
#*To create a local branch: '''<tt>git checkout -b [Bug|Feature|Refactor]_[ID]_description <branch></tt>'''
 
#*Check state (index and working tree): '''<tt>git status</tt>'''
 
#*Check state (index and working tree): '''<tt>git status</tt>'''
 
#*Add a new untracked file: '''<tt>git add <file_path></tt>'''
 
#*Add a new untracked file: '''<tt>git add <file_path></tt>'''
 
#*Add all untracked and modified files: '''<tt>git add -A</tt>'''
 
#*Add all untracked and modified files: '''<tt>git add -A</tt>'''
#*Commit a change - ''[[#Comment Conventions|See comment conventions below]]'': '''<tt>git commit -am "Comment"</tt>''' or '''<tt>git commit</tt>''' to open editor for comment editting
+
#*Commit a change - ''[[#Comment Conventions|See comment conventions below]]'': '''<tt>git commit -a -m "Comment"</tt>''' or '''<tt>git commit -a</tt>''' to open editor for comment editting
 
#*Rebase against the remote branch frequently to prevent branch from diverging:  
 
#*Rebase against the remote branch frequently to prevent branch from diverging:  
##'''<tt>git pull --rebase 0.9.6.dev</tt>'''
+
##'''<tt>git pull --rebase <branch></tt>'''
 +
#:<span style="font-variant:small-caps">Tip: By default <tt>git pull</tt> performs a merge, you can skip '''--rebase''' option by running <tt>git config branch.<branch>.rebase true</tt> to  [http://www.kernel.org/pub/software/scm/git/docs/git-pull.html#_options_related_to_merging persist the rebase setting.]</span>
 +
##'''<tt>git checkout <Bug|Feature|Refactor Branch></tt>'''
 +
##'''<tt>git rebase <branch></tt>'''
  
 
: &#9758; '''Creating a local working branch allows for better grouping of related changes and easier task switching'''
 
: &#9758; '''Creating a local working branch allows for better grouping of related changes and easier task switching'''
: &#9758; '''Always follow comment and branch naming convetions'''
+
: &#9758; '''Always follow comment and branch naming conventions'''
  
 
==Incorporate a Finished Working Branch Into Development Branch==
 
==Incorporate a Finished Working Branch Into Development Branch==
 +
#Rebase the development branch to ensure it has the latest changes: '''<tt>git pull --rebase origin 0.9.6_dev</tt>'''
 
#Switch to development branch: '''<tt>git checkout 0.9.6_dev</tt>'''
 
#Switch to development branch: '''<tt>git checkout 0.9.6_dev</tt>'''
#Rebase the development branch to ensure it has the latest changes: '''<tt>git pull --rebase</tt>'''
+
#Merge work branch into development: '''<tt>git merge <working_branch_name> --no-ff ([http://www.kernel.org/pub/software/scm/git/docs/git-merge.html#_fast_forward_merge --ff] is usually the default) </tt>'''
#Merge work branch into development: '''<tt>git merge --no-ff <working_branch_name></tt>'''
+
 
#(Optional) - Once work has been pushed to remote you can delete your local development branch: '''<tt>git branch -d <working_branch_name></tt>'''
 
#(Optional) - Once work has been pushed to remote you can delete your local development branch: '''<tt>git branch -d <working_branch_name></tt>'''
  
 
==Push local Development changes to remote Development branch==
 
==Push local Development changes to remote Development branch==
  
#Rebase the development branch to ensure it has the latest changes: '''<tt>git pull --rebase 0.9.6.dev</tt>'''
+
#Rebase the development branch to ensure it has the latest changes: '''<tt>git pull --rebase origin 0.9.6_dev</tt>'''
 
#Push Changes to Remote: '''<tt>git push origin 0.9.6_dev</tt>'''
 
#Push Changes to Remote: '''<tt>git push origin 0.9.6_dev</tt>'''
  
=Additional Git Commands=
+
==Comment Conventions==
 +
 
 +
A commit comment consists of the following written '''in present tense''':
 +
*'''a summary line''' short (60 chars or less) summary of changes made. Should use the following format: <tt>CHANGE_TYPE[ID]: Summary</tt>
 +
*'''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).
 +
 
 +
A useful command for testing for commits that may not follow these conventions:
 +
  git log --format="%h|%cd|%s" | awk --posix 'BEGIN {FS = "|"} ; {if(!/(bug|refactor|refinement|feature)(\[(ats|bgz)_.{5,6}\])?: [A-Z]/ || /  / || /: [A-z]+ed / || /\.$/){print $1"|"$2"|"$3}}'
 +
 
 +
===='''Comment with Details:'''====
 +
<tt>bug[ats_ABCDE]: Fix artifact copy/paste copying invalid attribute types<br/><br/>Artifact copy/paste code change to check attribute types before creating
 +
them in the copied artifact. Additional checks include:<br/><br/>- Change one<br/><br/>- Change two<br/><br/>- Change three</tt>
 +
 
 +
====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'''
 +
 
 +
====Change Type Examples====
 +
 
 +
{| border="1" cellpadding="1"
 +
|-
 +
! Comment Prefix !! Branch Name Prefix !! Description
 +
|-
 +
|'''feature:'''||'''Feature_'''||
 +
New functionality, Non-Trivial, change in code behavior
 +
e.g.: comment - feature[bgz_12345]: Add ability to import open office docs
 +
      branch - Feature_bgz_12345_open_office_doc_import
 +
|-
 +
|'''refinement:'''||'''Refinement_'''||
 +
Small change in code behavior
 +
Encompasses: performance improvements, memory usage, code robustness, test coverage increase
 +
e.g.: comment - refinement: Improve artifact loading performance
 +
      comment - refinement: Add test case for presentation type RenderAttribute
 +
      branch - Refinement_new_RendererAttribute_test
 +
|-
 +
|'''refactor:'''||'''Refactor_'''||
 +
Non-functional changes to improve code design/quality.
 +
e.g.: comment - refactor: remove unnecessary exception OseeInvalidSessionException
 +
      branch - Refactor_remove_unused_exceptions
 +
|-
 +
|'''bug:'''||'''Bug_'''||
 +
Change that fixes problems with the existing code.
 +
e.g.: comment -  bug: stop export change report from including multiples of the same artifact
 +
      comment -  bug[ats_UNJKK]: Implement client-side change to use search request/response messages
 +
      branch - Bug_ats_UNJKK_fix_quick_search 
 +
|-
 +
|}
 +
<br/>
 +
 
 +
== Additional Git Commands ==
  
 
Collection of Useful Git Commands
 
Collection of Useful Git Commands
Line 165: Line 303:
 
  git stash drop stash@{0}
 
  git stash drop stash@{0}
 
  git stash pop
 
  git stash pop
 +
|-
 +
|'''Selective Push'''|| Push only commits from a certain point (HASH) and prior  ||
 +
git push origin HASH:remoate_branch_name
 
|-
 
|-
 
|'''Show Modified File Names'''|| Lists files modified ||  
 
|'''Show Modified File Names'''|| Lists files modified ||  
Line 190: Line 331:
 
  git diff localBranchName..origin/remoteName
 
  git diff localBranchName..origin/remoteName
 
|-
 
|-
 +
|'''Find common ancestor'''|| finds best common ancestor(s) between two commits ||
 +
git merge-base branch1..branch2
 +
|-
 +
 
|'''Git Log'''|| view history for a given path even if it has been moved/renamed ||
 
|'''Git Log'''|| view history for a given path even if it has been moved/renamed ||
 
  git log --follow [current path]
 
  git log --follow [current path]
Line 208: Line 353:
 
  git checkout -b newLocalBranchName sourceBranch
 
  git checkout -b newLocalBranchName sourceBranch
 
|-
 
|-
|'''Create a local tracking branch'''|| Creates a local tracking branch called 91 and switches working tree||
+
|'''Create a local tracking branch'''|| Creates a local tracking branch called your_branch_name_here and switches working tree||
  git checkout -b 91 remotes/MS_0_9_1_20100111
+
  git checkout -b your_branch_name_here origin/0.9.7_dev
 
|-
 
|-
 
|'''Switch branches'''|| switches the working tree to a different branch ||
 
|'''Switch branches'''|| switches the working tree to a different branch ||
Line 223: Line 368:
 
|'''Branching and Merging'''|| To replace with incoming file so you can re-make your changes (or abandon them)||
 
|'''Branching and Merging'''|| To replace with incoming file so you can re-make your changes (or abandon them)||
 
  git checkout --[theirs|our] <path>
 
  git checkout --[theirs|our] <path>
 +
|-
 +
|'''Merging Again'''|| What to do if you are in the middle of a rebase and don't want the previous merge resolution||
 +
git checkout --conflict=merge -- <file you want to remerge>
 
|-
 
|-
 
|'''Continue rebasing''' ||After conflicts have been resolved||
 
|'''Continue rebasing''' ||After conflicts have been resolved||
Line 229: Line 377:
 
|'''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||
 
|'''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
 
  git format-patch -o ../ trunk..HEAD
 +
|-
 +
|'''Patches'''||Create a patch with the top n number of commits||
 +
git format-patch -n
 
|-
 
|-
 
|'''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. ||
 
|'''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. ||
Line 253: Line 404:
 
  git clean -fdx
 
  git clean -fdx
 
|-
 
|-
 +
|'''Tagging a Build''' || Create, and Push a Tag ||
 +
git tag -a -m "0.9.6.v201009271203 Release Candidate" 0.9.6.v201009271203_RC <COMMIT_ID TO TAG>
 +
git push origin 0.9.6.v201009271203_RC
 +
|-
 +
|'''Deleting a Tag''' || Delete a Tag locally and push change to remote ||
 +
git tag -d 0.9.6.v201009271203_RC
 +
git push origin :refs/tags/0.9.6.v201009271203_RC
 +
|-
 +
|'''delete remote branch''' || different than just deleting a local branch ||
 +
git push origin --delete branchName
 +
|-
 +
|'''List all Tags''' || List tags ||
 +
git tag -l
 +
|-
 +
|'''Create empty branch''' || Create an empty branch for disjoint histories ||
 +
git symbolic-ref HEAD refs/heads/newbranch
 +
rm .git/index
 +
git clean -fdx
 +
<do work>
 +
git add your files
 +
git commit -m 'Initial commit'
 +
|-
 +
|'''Create Mapped Drive Git Repo''' || Use mapped drive to host remote Repo for personal use ||
 +
Note: in this example i is mapped to a remote disk share
 +
git init --bare --shared=0600 /i/git/user.git
 +
cd /c/UserData/git
 +
git clone /i/git/user.git/
 +
cd user
 +
copy your files in
 +
git add -A
 +
git commit -m "initial commit"
 +
git push origin master
 +
|-
 +
|'''Create Git Repo using SSH''' || Use SSH to host remote Repo for personal use ||
 +
on the remote host:
 +
git init --bare --shared=0600 /<path>/user.git
 +
chmod 700 /<path>/user.git
 +
 +
on local machine:
 +
cd /c/UserData/git
 +
git clone ssh://<user_name>@<host>/<path>/user.git
 +
cd user
 +
copy your files in
 +
git add -A
 +
git commit -m "initial commit"
 +
git push origin master
 +
|-
 +
|'''Remove stale remote branches''' || Use Prune to remove stale remote branches (add --dry-run to preview what will be changed) ||
 +
git remote prune origin
 +
|-
 +
|'''Find dangling Commits''' || Find dangling commits ||
 +
git fsck --full --no-reflogs | grep commit
 +
-- or to show the names of each run:
 +
for i in `git fsck --full --no-reflogs | grep commit | awk '{print $3}'`;
 +
    do git show $i --name-only; done
 +
|-
 +
|-
 +
|'''Fast Export/Fast Import''' || Use to move a project from one repo to another repo preserving history ||
 +
git fast-export branchToExport pathOfSourceProject(s) | (cd destinationRepo && git fast-import)
 +
-- done from source repo
 +
|-
 +
|'''Remove all instances of a file from history''' || Run through all commits in history and remove the named file/s.  Also delete commits that would be empty once the file is deleted.  Useful for things like large binary files that are taking up too much space and shouldn't have been committed. ||
 +
git filter-branch --index-filter 'git ls-tree --name-only --full-tree $GIT_COMMIT |
 +
    grep "folder/my.file" |
 +
    xargs git rm --cached -r --ignore-unmatch test.txt ' --prune-empty -f -- --all
 
|}
 
|}
 
<br/>
 
<br/>
  
=Comment Conventions=
+
== Git Scenarios ==
 
+
=== Merge Release development branch into master ===
A commit comment consists of the following written '''in present tense''':
+
git checkout 0.9.7_dev
*'''a summary line''' short (50 chars or less) summary of changes made. Should use the following format: <tt>CHANGE_TYPE[ID]: Summary</tt>
+
git pull --rebase
*'''a newline''' - Always follow your summary with a newline.
+
git rebase -i <commit id of masters head>
*'''an (optional) details section:''' Should be wrapped to 72 columns (git command such as git log don't wrap).
+
open git-rebase-todo in text editor
 
+
git rebase --committer-date-is-author-date 148d414
===Summary Change Types:===
+
git checkout master
*Bug Fixes: Any change the fixes problems with the existing code. Tag='''bug'''
+
git pull --rebase
*Features: Any change that is new functionality. Tag='''feature'''
+
git merge 0.9.7_dev
*Refactors: Changes that are done to improve code design/quality. Tag='''refactor'''
+
git push
 
+
git branch -D 0.9.7_dev
===Summary Change Type Identifiers:===
+
git push origin :0.9.7_dev
*Bugzilla Number - change originated from a bugzilla item, therefore use the following format: '''bgz_12314'''
+
  git checkout -b 0.9.8_dev master
*Action HRID - change originated from an ATS action, therefore use the following format: '''ats_HRID'''
+
  git push origin 0.9.8_dev:refs/heads/0.9.8_dev
 
+
===Examples:===
+
 
+
*'''Summary Lines:'''
+
  refactor: A refactor with no id
+
 
+
  refactor[ID]: Update copyright statements
+
  
  bug[ID]: Fix concurrency issue in artifact update
+
=== End-of-line Normalization ===
 +
  echo "* text=auto\n*.pdf -text" >>.gitattributes
 +
rm .git/index    # Remove the index to force git to
 +
git reset        # re-scan the working directory
 +
git status        # Show files that will be normalized
 +
git add -u
 +
git add .gitattributes
 +
git commit -m "Introduce end-of-line normalization"
  
feature[ID]: Added conflict detection
+
== Git Resources ==
 
+
*'''Comment with Details:'''
+
<tt>bug[ats_ABCDE]: Fix artifact copy/paste copying invalid attribute types<br/><br/>Artifact copy/paste code change to check attribute types before creating
+
them in the copied artifact. Additional checks include:<br/><br/>- Change one<br/><br/>- Change two<br/><br/>- Change three</tt>
+
 
+
= Git Resources =
+
  
 
*'''Git Commands'''
 
*'''Git Commands'''
Line 297: Line 507:
 
**[http://people.gnome.org/~federico/misc/git-cheat-sheet.txt Git Brain Dump]
 
**[http://people.gnome.org/~federico/misc/git-cheat-sheet.txt Git Brain Dump]
 
**[http://wiki.eclipse.org/EGit/Git_For_Eclipse_Users GIT for Eclipse Users]
 
**[http://wiki.eclipse.org/EGit/Git_For_Eclipse_Users GIT for Eclipse Users]
**[http://wiki.eclipse.org/Git GIT SSH Setup]
 
  
 
*'''Git Workflows'''
 
*'''Git Workflows'''
Line 310: Line 519:
 
**[http://git.or.cz/course/svn.html Git for SVN Users]
 
**[http://git.or.cz/course/svn.html Git for SVN Users]
 
**[http://www.chem.helsinki.fi/~jonas/git_guides/HTML/CVS2git/ Git for CVS Users]
 
**[http://www.chem.helsinki.fi/~jonas/git_guides/HTML/CVS2git/ Git for CVS Users]
**[http://wiki.eclipse.org/Git_for_Committers Git for Eclipse Comitters]
+
**[http://wiki.eclipse.org/Git_for_Committers Git for Eclipse Committers]
 +
**[http://wiki.eclipse.org/Git GIT,SSH Setup,Repository Migration, & Committer Info]
  
= Source Repositories and Access =
+
== Source Repositories and Access ==
  
 
{| border="1" cellpadding="1"
 
{| border="1" cellpadding="1"
Line 319: Line 529:
 
|-
 
|-
 
|'''Main OSEE Source'''|| OSEE Source Code||  
 
|'''Main OSEE Source'''|| OSEE Source Code||  
  git clone https:/ /<user.name>@git.eclipse.org/gitroot/osee/org.eclipse.osee.git
+
  <nowiki>git clone https://<user.name>@git.eclipse.org/gitroot/osee/org.eclipse.osee.git</nowiki>
 
   
 
   
 
  org.eclipse.osee
 
  org.eclipse.osee
Line 348: Line 558:
 
<br/>
 
<br/>
  
== 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 ==
 
== 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].
 
# 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 &#91;localhost&#93;.launch</tt> to run an OSEE application server
 
#Use the configuration <tt>../org.eclipse.osee.support.config/launchConfig/OSEE Demo Application Server &#91;localhost&#93;.launch</tt> to run an OSEE application server

Revision as of 16:37, 2 February 2018

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

Downloading and Configuring Eclipse

Use a new Eclipse installation with the latest stable version of OSEE that you are developing installed using the updates page. This will ensure that you have the correct bundles in place to provide the required dependencies.

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.

 Excellent explanation of the design and architecture of Git - Git for Computer Scientists

Git Setup & Install

  1. Download GIT for Windows by selecting the latest version of msysGit
    1. Select Run Git From the Windows Command Prompt from the Adjusting Your PATH environment page
    2. Select Checkout as-is, commit as-is from the Configuring the line ending conversions page
  2. Install Diff/Merge Tool KDiff3 HomePage
  3. Configure the Merge Tool (These settings should help make merging less painful)
    1. Launch KDiff3 by clicking Start->All Programs->KDiff3->KDiff3
    2. In KDiff3, select on Settings->Configure to open the configuration dialog
    3. On the Editor tab, set Line end style to Unix
    4. On the Diff tab, check the Try hard check box
    5. On the Merge tab, check the Auto save and quit on merge without conflicts check box
    6. On the Directory tab, un-check the Backup files (.orig) check box
    7. On the Regional Settings tab:
      1. Check the Use the same encoding for everything check box
      2. Select Unicode, 8 bit (UTF-8) for File Encoding for A
      3. Un-Check the first Auto Detect Unicode check box
    8. Click OK
  4. Fix Window Home to User Home - By default, in Windows, Git sets the HOME environment variable of its bash to the value of the HOMEDRIVE variable. When the HOMEDRIVE is mapped to a network drive, this introduces an annoying delay before Git commands execute.
    1. In Windows, select Start->Control Panel->System to open the system properties dialog
    2. Select the Advanced System Settings button on the left
    3. Click the Environment Variables button
    4. In the User variables for... section perform the following:
      1. Click on New to open the New User Variable dialog
      2. Enter the following:
        Variable name: HOME
        Variable value: C:\Documents and Settings\<User>
      3. Click OK
      4. Click OK
  5. Launch Git Bash Shell by clicking on the Git desktop shortcut GitShortcut.png
  6. Configure your Git Window:
    1. Right-click on the title bar
    2. Select Properties to open the window properties dialog
    3. Select the Options tab
    4. Under Edit Options check "Quick Edit Mode"
    5. Select the Layout tab
    6. Under Screen Buffer Size enter 300 for both width and height
    7. Click OK
    8. Select the Modify shortcut that started this window" radio button
    9. Click OK
  7. Update Git Configuration by copy/pasting the following commands into the Git Shell (if behind a firewall add -x address:port to curl commands)
    echo "cd ~" > ~/.bashrc
    curl http://git.eclipse.org/c/osee/org.eclipse.osee.git/plain/plugins/org.eclipse.osee.support.config/.gitconfig > ~/.gitconfig
  8. Restart Git

Setup Git Password Management

GUI

To avoid typing your password during remote interactions, perform the following:

  1. Launch Git Bash Shell by clicking on the Git desktop shortcut GitShortcut.png
  2. At the console copy/paste the following commands (if behind a firewall add -x address:port to curl commands):
    1. curl http://git.eclipse.org/c/osee/org.eclipse.osee.git/plain/plugins/org.eclipse.osee.support.config/.managePasswords > ~/.managePasswords
    2. curl http://git.eclipse.org/c/osee/org.eclipse.osee.git/plain/plugins/org.eclipse.osee.support.config/inputDialog.tcl > ~/inputDialog.tcl
    3. git config --global core.askpass "$HOME/.managePasswords"
    4. git config --global alias.passwd \!"~/.managePasswords update"
  • Upon the first Git remote repository interaction, Git will ask for your password by opening an input dialog.
  • If you need to change your password type: git passwd

Simple plain text file

If you would like to store your password in a flat file and edit in plain text editor like TextEdit, TextMate, Vi(M)??, Emacs you can use the following file that should reside in your %HOME% or $HOME directory.

/c/Documents and Settings/username/_netrc
machine your.server.name.without.any.http
login john.smith
password smithsonian
machine another.server.machine.repository.of.which.you.access
login john.q.smith
password smithsonian1

You're done.

Credits

Additional Windows Settings (Optional)

Not happy with the font choices of Lucida Console and Raster Fonts?

  1. Run "regedit" from the Windows Run dialog.
  2. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Console\TrueTypeFont
  3. Create a new String Value with consecutively increasing zeros for the name; e.g. "00" for the second font, "000" for the third font.
  4. Modify it and put the name of the font you want to use exactly as it appears in other font chooser dialog boxes in the data field.
  5. When you're done it should look something like this:
00          REG_SZ          Consolas
000 REG_SZ Courier New
  1. Close Registry Editor and restart git bash.
  2. Go back to the Font tab and select your font!

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.
  • dev: origin/dev is the main branch where HEAD always reflects a state with the latest delivered development changes for integration.
  • 0.XX.X: origin/0.XX.X 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. This 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. dev).

Developers should not make changes on master branches

OSEE GIT Repository

Create a repository to clone the following branches so they can be imported into OSEE. (ex: /C/UserData/GIT/)

Committer (write-access)

In the GIT shell, navigate to the repository you created above and run the following commands. This will clone the branches you need into your repository.

git clone https://git.eclipse.org/r/osee/org.eclipse.osee.git
git clone https://git.msc.az.boeing.com/r/osee/lba.osee.git
git clone https://git.msc.az.boeing.com/r/osee/org.eclipse.ip.git
OSEE GIT Web Portal

NOTE: If you are having permission issues cloning these locations, please see your system administrator to get you access to these repositories, an LDAP account as well as a GERRIT password.

Setting up a workspace

Option 1

  1. Create a new Eclipse workspace.
  2. File->Import...->Git->Projects from Git this opens the Import Projects from Git dialog
  3. Double Click Existing local repository
  4. Click on Add to add a git repository path
  5. Browse to the location of the local cloned git repositories (ex: /c/UserData/GIT)
  6. Select the repositories to import projects from
  7. Click Finish
  8. From the Select a Git Repository page, click the project you wish to import and click Next
  9. From the Select a wizard to use for importing projects page, click Next again
  10. From the Import Projects page
  11. Click Finish to finish the import

NOTE: repeat these steps for each project you wish to import.

Option 2

  1. Create a new Eclipse workspace.
  2. Open the "Git Repository Exploring" perspective
  3. Click on the "Clone a Git Repository and add the clone to this view" button
  4. Put "http://git.eclipse.org/gitroot/osee/org.eclipse.osee.git" (read-only example) in the URL
  5. Click Next
  6. Pick the branch(es) you want to import (e.g. "master")
  7. Click Next
  8. Click Finish
  9. Wait for the repository to import
  10. Right-click on the repository and select Import Projects...
  11. 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
  12. Click Next
  13. From the Import Projects page, click the Select All button to check all the projects
  14. Click Next
  15. From the Share Projects with Git page
  16. Click Finish to finish the import

Option 3

Acquiring OSEE source code without a GIT repository. This is the 'simplest' but also least flexible since it does not prepare you to push your changes. This is a great method for quick debugging at a user's workstation (i.e.: a non-development workstation).

  1. Install OSEE locally
  2. Open OSEE with a brand new workspace
  3. Window-->Open Perspective-->Java
  4. Right-click in the Package Explorer
  5. Select Import...
  6. Select Plug-in Development-->Plug-ins and Fragments
  7. In the "Import As" frame select "Projects with source folders" and click Next
  8. In the "Plug-ins and Fragments Found:" list box select "org.eclipse.osee.framework.plugin.core(...)"
  9. Click "Add->"
  10. Click "Required Plug-ins->"
  11. Click Finish

Running:

  1. Wait for "Building workspace" to complete
  2. Select Run-->Debug Configurations...
  3. Select "Ecplipse Application" from the list on the left side of the dialog
  4. Click the "New launch configuration" button in the upper left corner of the dialog (see screenshot below)
  5. Click Debug (if you get an error "Errors exist in require project(s)" try clicking Proceed)

OseeDebugConfigSShot.png The preceding instructions for running will not display the OSEE logo splash screen. Instead the default Eclipse splash screen will be displayed.

Local Development

Development should only be performed on a development branch (never commit to master)

Local Development

Development should only be performed on a development branch (never commit to a master branch)

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 and when you are first cloning your branches.

To create a tracking development branch: git checkout -b <branch> origin/<branch>

Make Change

  1. Keep development branch up-to-date
    1. Switch to the target build development branch: git checkout <branch>
    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 <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 - See comment conventions below: git commit -a -m "Comment" or git commit -a to open editor for comment editting
    • Rebase against the remote branch frequently to prevent branch from diverging:
    1. git pull --rebase <branch>
    Tip: By default git pull performs a merge, you can skip --rebase option by running git config branch.<branch>.rebase true to persist the rebase setting.
    1. git checkout <Bug|Feature|Refactor Branch>
    2. git rebase <branch>
Creating a local working branch allows for better grouping of related changes and easier task switching
Always follow comment and branch naming conventions

Incorporate a Finished Working Branch Into Development Branch

  1. Rebase the development branch to ensure it has the latest changes: git pull --rebase origin 0.9.6_dev
  2. Switch to development branch: git checkout 0.9.6_dev
  3. Merge work branch into development: git merge <working_branch_name> --no-ff (--ff is usually the default)
  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 origin 0.9.6_dev
  2. Push Changes to Remote: git push origin 0.9.6_dev

Comment Conventions

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

  • a summary line short (60 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).

A useful command for testing for commits that may not follow these conventions:

 git log --format="%h|%cd|%s" | awk --posix 'BEGIN {FS = "|"} ; {if(!/(bug|refactor|refinement|feature)(\[(ats|bgz)_.{5,6}\])?: [A-Z]/ || /  / || /: [A-z]+ed / || /\.$/){print $1"|"$2"|"$3}}'

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

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

Change Type Examples

Comment Prefix Branch Name Prefix Description
feature: Feature_
New functionality, Non-Trivial, change in code behavior
e.g.: comment - feature[bgz_12345]: Add ability to import open office docs 
      branch - Feature_bgz_12345_open_office_doc_import
refinement: Refinement_
Small change in code behavior
Encompasses: performance improvements, memory usage, code robustness, test coverage increase 
e.g.: comment - refinement: Improve artifact loading performance
      comment - refinement: Add test case for presentation type RenderAttribute
      branch - Refinement_new_RendererAttribute_test
refactor: Refactor_
Non-functional changes to improve code design/quality.
e.g.: comment - refactor: remove unnecessary exception OseeInvalidSessionException
      branch - Refactor_remove_unused_exceptions
bug: Bug_
Change that fixes problems with the existing code.
e.g.: comment -  bug: stop export change report from including multiples of the same artifact
      comment -  bug[ats_UNJKK]: Implement client-side change to use search request/response messages
      branch - Bug_ats_UNJKK_fix_quick_search  


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
Selective Push Push only commits from a certain point (HASH) and prior
git push origin HASH:remoate_branch_name
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
Find common ancestor finds best common ancestor(s) between two commits
git merge-base branch1..branch2
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 your_branch_name_here and switches working tree
git checkout -b your_branch_name_here origin/0.9.7_dev 
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>
Merging Again What to do if you are in the middle of a rebase and don't want the previous merge resolution
git checkout --conflict=merge -- <file you want to remerge>
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
Patches Create a patch with the top n number of commits
git format-patch -n
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
Tagging a Build Create, and Push a Tag
git tag -a -m "0.9.6.v201009271203 Release Candidate" 0.9.6.v201009271203_RC <COMMIT_ID TO TAG>
git push origin 0.9.6.v201009271203_RC
Deleting a Tag Delete a Tag locally and push change to remote
git tag -d 0.9.6.v201009271203_RC
git push origin :refs/tags/0.9.6.v201009271203_RC
delete remote branch different than just deleting a local branch
git push origin --delete branchName
List all Tags List tags
git tag -l
Create empty branch Create an empty branch for disjoint histories
git symbolic-ref HEAD refs/heads/newbranch 
rm .git/index 
git clean -fdx 
<do work> 
git add your files 
git commit -m 'Initial commit'
Create Mapped Drive Git Repo Use mapped drive to host remote Repo for personal use

Note: in this example i is mapped to a remote disk share

git init --bare --shared=0600 /i/git/user.git
cd /c/UserData/git
git clone /i/git/user.git/
cd user
copy your files in
git add -A
git commit -m "initial commit"
git push origin master
Create Git Repo using SSH Use SSH to host remote Repo for personal use
on the remote host:
git init --bare --shared=0600 /<path>/user.git
chmod 700 /<path>/user.git
on local machine:
cd /c/UserData/git
git clone ssh://<user_name>@<host>/<path>/user.git
cd user
copy your files in
git add -A
git commit -m "initial commit"
git push origin master
Remove stale remote branches Use Prune to remove stale remote branches (add --dry-run to preview what will be changed)
git remote prune origin
Find dangling Commits Find dangling commits
git fsck --full --no-reflogs | grep commit
-- or to show the names of each run:
for i in `git fsck --full --no-reflogs | grep commit | awk '{print $3}'`; 
   do git show $i --name-only; done
Fast Export/Fast Import Use to move a project from one repo to another repo preserving history
git fast-export branchToExport pathOfSourceProject(s) | (cd destinationRepo && git fast-import)
-- done from source repo
Remove all instances of a file from history Run through all commits in history and remove the named file/s. Also delete commits that would be empty once the file is deleted. Useful for things like large binary files that are taking up too much space and shouldn't have been committed.
git filter-branch --index-filter 'git ls-tree --name-only --full-tree $GIT_COMMIT | 
   grep "folder/my.file" | 
   xargs git rm --cached -r --ignore-unmatch test.txt ' --prune-empty -f -- --all


Git Scenarios

Merge Release development branch into master

git checkout 0.9.7_dev
git pull --rebase
git rebase -i <commit id of masters head>
open git-rebase-todo in text editor
git rebase --committer-date-is-author-date 148d414
git checkout master
git pull --rebase
git merge 0.9.7_dev
git push
git branch -D 0.9.7_dev
git push origin :0.9.7_dev
git checkout -b 0.9.8_dev master
git push origin 0.9.8_dev:refs/heads/0.9.8_dev

End-of-line Normalization

echo "* text=auto\n*.pdf -text" >>.gitattributes
rm .git/index     # Remove the index to force git to
git reset         # re-scan the working directory
git status        # Show files that will be normalized
git add -u
git add .gitattributes
git commit -m "Introduce end-of-line normalization"

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



Configure a Development Runtime

  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