Skip to content

Commit 7388386

Browse files
committed
* Implemented 'ti sync'
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
1 parent 646891f commit 7388386

1 file changed

Lines changed: 5 additions & 23 deletions

File tree

lib/ticgit/base.rb

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ def ticket_recent(ticket_id = nil)
195195
def ticket_revparse(ticket_id)
196196
if ticket_id
197197
ticket_id = ticket_id.strip
198-
198+
199199
if /^[0-9]*$/ =~ ticket_id
200200
if t = @last_tickets[ticket_id.to_i - 1]
201201
return t
@@ -267,30 +267,12 @@ def tic_states
267267
['open', 'resolved', 'invalid', 'hold']
268268
end
269269

270-
def sync_tickets
271-
#Dir.chdir "../tidyapp_bugs"
272-
bs = git.lib.branches_all.map{|b| b.first }
273-
274-
#unless bs.include?('ticgit') && File.directory?(@tic_working)
275-
# init_ticgit_branch(bs.include?('ticgit'))
276-
#end
277-
278-
puts "checking out ticgit"
279-
#in_branch(bs.include?('ticgit')) do
280-
#puts git.branch('ticgit').checkout()
281-
# puts git.pull('origin','origin/ticgit')
282-
#puts git.branch('master').checkout()
283-
#end
284-
285-
in_branch(bs.include?('ticgit')) do
286-
#puts git.add('.')
287-
#puts git.commit('tickets update')
288-
puts git.pull('origin','origin/ticgit')
289-
puts git.push('origin','ticgit')
290-
puts
270+
def sync_tickets
271+
in_branch(false) do
272+
git.pull('origin','origin/ticgit')
273+
git.push('origin', 'ticgit:ticgit')
291274
puts "Tickets synchronized."
292275
end
293-
294276
end
295277

296278
def load_tickets

0 commit comments

Comments
 (0)