Skip to content

Commit

Permalink
Git - store version number and session id in commit log
Browse files Browse the repository at this point in the history
  • Loading branch information
samaaron committed Jul 30, 2015
1 parent 61a2261 commit 8f15697
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/server/sonicpi/lib/sonicpi/gitsave.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def initialize(path)
end
end

def save!(filename, content)
def save!(filename, content, msgpre="")
puts "saving: #{filename}"
oid = @repo.write(content, :blob)
index = @repo.index
Expand All @@ -38,7 +38,7 @@ def save!(filename, content)

options[:author] = { :email => "autosave@sonic-pi.net", :name => 'Sonic Pi Autosave', :time => Time.now }
options[:committer] = { :email => "autosave@sonic-pi.net", :name => 'Sonic Pi Autosave', :time => Time.now }
options[:message] ||= "Autosave Workspace #{filename}"
options[:message] ||= "#{msgpre} :~: Autosave Workspace #{filename}"
options[:parents] = @repo.empty? ? [] : [ @repo.head.target ].compact
options[:update_ref] = 'HEAD'

Expand Down
2 changes: 1 addition & 1 deletion app/server/sonicpi/lib/sonicpi/spider.rb
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ def __save_buffer(id, content)
content = filter_for_save(content)
File.open(path, 'w') {|f| f.write(content) }
begin
@gitsave.save!(filename, content)
@gitsave.save!(filename, content, "#{@version} -- #{@session_id} -- ")
rescue Exception => e
##TODO: remove this and ensure that git saving actually works
##instead of cowardly hiding the issue!
Expand Down

0 comments on commit 8f15697

Please sign in to comment.