lib/caretaker.rb in caretaker-0.8.4 vs lib/caretaker.rb in caretaker-0.8.5
- old
+ new
@@ -381,28 +381,23 @@
# Convert the commit messages (git log) into a hash
#
def log_to_hash
docs = {}
tag = '0'
- old_parent = ''
- res = execute_command("git --no-pager log --oneline --pretty=format:'%h|%H|%P|%d|%s|%cd'")
+ res = execute_command("git --no-pager log --first-parent --oneline --pretty=format:'%h|%H|%d|%s|%cd'")
unless res.nil?
res.each_line do |line|
- hash, hash_full, parent, refs, subject, date = line.split('|')
- parent = parent.split(' ')[0]
+ hash, hash_full, refs, subject, date = line.split('|')
tag = extract_tag(refs, tag).to_s
@last_tag = tag if @last_tag == '0' && tag != '0'
- if parent != old_parent
- (docs[tag.to_s] ||= []) << { :hash => hash, :hash_full => hash_full, :parent => parent, :subject => subject }
+ (docs[tag.to_s] ||= []) << { :hash => hash, :hash_full => hash_full, :subject => subject }
- if tag != '0'
- @tags << { tag => format_date(date) } unless @tags.any? { |h| h[tag] }
- end
+ if tag != '0'
+ @tags << { tag => format_date(date) } unless @tags.any? { |h| h[tag] }
end
- old_parent = parent
end
@tags = @tags.uniq
end
return docs
end