Skip to content

Commit

Permalink
* Implemented 'ti sync'
Browse files Browse the repository at this point in the history
The ticgit repository needs to be remote and tracked.
In the original repository do something like:
1) ti  # to create the ticgit branch
2) git push origin ticgit # to push it to remote
3) git branch -D ticgit
4) git checkout --track -b ticgit origin/ticgit
5) git checkout master # in my case is branch I usually work on
6) use ticgit normally and call 'ti sync' when you want to sync with the remote repository

When you colaborate you do something like:
1) git clone git://(...)  # clone the repository you want
2) git checkout --trac -b ticgit origin/ticgit
3) git checkout master # in my case is branch I usually work on
4) use ticgit normally and call 'ti sync' when you want to sync with the remote
repository
  • Loading branch information
bmfs committed Mar 13, 2010
1 parent 646891f commit 7388386
Showing 1 changed file with 5 additions and 23 deletions.
28 changes: 5 additions & 23 deletions lib/ticgit/base.rb
Expand Up @@ -195,7 +195,7 @@ def ticket_recent(ticket_id = nil)
def ticket_revparse(ticket_id)
if ticket_id
ticket_id = ticket_id.strip

if /^[0-9]*$/ =~ ticket_id
if t = @last_tickets[ticket_id.to_i - 1]
return t
Expand Down Expand Up @@ -267,30 +267,12 @@ def tic_states
['open', 'resolved', 'invalid', 'hold']
end

def sync_tickets
#Dir.chdir "../tidyapp_bugs"
bs = git.lib.branches_all.map{|b| b.first }

#unless bs.include?('ticgit') && File.directory?(@tic_working)
# init_ticgit_branch(bs.include?('ticgit'))
#end

puts "checking out ticgit"
#in_branch(bs.include?('ticgit')) do
#puts git.branch('ticgit').checkout()
# puts git.pull('origin','origin/ticgit')
#puts git.branch('master').checkout()
#end

in_branch(bs.include?('ticgit')) do
#puts git.add('.')
#puts git.commit('tickets update')
puts git.pull('origin','origin/ticgit')
puts git.push('origin','ticgit')
puts
def sync_tickets
in_branch(false) do
git.pull('origin','origin/ticgit')
git.push('origin', 'ticgit:ticgit')
puts "Tickets synchronized."
end

end

def load_tickets
Expand Down

0 comments on commit 7388386

Please sign in to comment.