The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
rake_commit_tasks now supports git

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Paul Gross

Posts: 152
Nickname: pgross
Registered: Sep, 2007

Paul Gross is a software developer for ThoughtWorks.
rake_commit_tasks now supports git Posted: Jan 14, 2010 11:21 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Paul Gross.
Original Post: rake_commit_tasks now supports git
Feed Title: Paul Gross's Blog - Home
Feed URL: http://feeds.feedburner.com/pgrs
Feed Description: Posts mainly about ruby on rails.
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Paul Gross
Latest Posts From Paul Gross's Blog - Home

Advertisement

The rake_commit_tasks plugin now has preliminary support for git. rake_commit_tasks is a rails plugin which contains a set of rake tasks for checking your project into source control (git or subversion).

The workflow for committing and pushing with git is slightly different from subversion. The current steps of “rake commit” with git are roughly:

  1. Resets soft back to origin/branch_name (git reset—soft origin/branch_name)
  2. Adds new files to git and removes deleted files (git add -A .)
  3. Prompts for a commit message
  4. Commits to git (git commit -m ’...’)
  5. Pulls changes from origin and does a rebase to keep a linear history (git pull—rebase)
  6. Runs the default rake task (rake default)
  7. Checks cruisecontrol.rb to see if the build is passing
  8. Pushes the commit to origin (git push origin branch_name)

The “git reset—soft” in #1 is used to collapse unpushed commits. Each time “rake commit” is run, any commits that have not been pushed are undone and the changes are put into the index. Then, the “git add -A .” adds the new changes. Now, the “git commit” command will create one commit with all of the unpushed changes.

This collapsing comes in handy when “rake commit” fails (for example, a broken test). Once the test is fixed, the fix should go into the same commit as the original work. Without the “git reset” command, there will be two commits (the original, and the one with the fix).

The “—rebase” flag is used in #5 when running “git pull” to keep a linear history without merge commits. If someone else has committed and pushed, a normal “git pull” will create a merge commit merging the other person’s work with your own. The “git pull—rebase” undoes the local commit, does a “git pull” and then replays the local commit on top. Merge commits are useful when there are multiple streams of work, such as a release branch. However, when everyone is working in master, they merely clutter the history.

Comments and patches are welcome.

Read: rake_commit_tasks now supports git

Topic: 2010: The year Ext JS takes over Previous Topic   Next Topic Topic: Releasing the SonicIQ Gems

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use