Skip to content

Commit 8f15697

Browse files
committed
Git - store version number and session id in commit log
1 parent 61a2261 commit 8f15697

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

app/server/sonicpi/lib/sonicpi/gitsave.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def initialize(path)
2626
end
2727
end
2828

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

3939
options[:author] = { :email => "[email protected]", :name => 'Sonic Pi Autosave', :time => Time.now }
4040
options[:committer] = { :email => "[email protected]", :name => 'Sonic Pi Autosave', :time => Time.now }
41-
options[:message] ||= "Autosave Workspace #{filename}"
41+
options[:message] ||= "#{msgpre} :~: Autosave Workspace #{filename}"
4242
options[:parents] = @repo.empty? ? [] : [ @repo.head.target ].compact
4343
options[:update_ref] = 'HEAD'
4444

app/server/sonicpi/lib/sonicpi/spider.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ def __save_buffer(id, content)
599599
content = filter_for_save(content)
600600
File.open(path, 'w') {|f| f.write(content) }
601601
begin
602-
@gitsave.save!(filename, content)
602+
@gitsave.save!(filename, content, "#{@version} -- #{@session_id} -- ")
603603
rescue Exception => e
604604
##TODO: remove this and ensure that git saving actually works
605605
##instead of cowardly hiding the issue!

0 commit comments

Comments
 (0)