MCPcopy Create free account
hub / github.com/GongShichen/LuminaCode / GetCommit

Method GetCommit

sessionmemory/store.go:490–510  ·  view source on GitHub ↗
(ctx context.Context, commitNo int, includeMessages bool)

Source from the content-addressed store, hash-verified

488 if err != nil {
489 return err
490 }
491 now := unixNow()
492 commitNo := s.metaInt(ctx, "next_commit_no")
493 if commitNo <= 0 {
494 commitNo = 1
495 }
496 ftsAvailable := s.ftsAvailable(ctx)
497 tx, err := s.db.BeginTx(ctx, nil)
498 if err != nil {
499 return err
500 }
501 defer tx.Rollback()
502 tagJSON, _ := json.Marshal(tags)
503 res, err := tx.ExecContext(ctx, `INSERT INTO commits(commit_no, start_message_id, end_message_id, start_turn_count, end_turn_count, summary, title, tags_json, model, input_tokens, output_tokens, created_at, last_accessed_at)
504 VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, 0, 0, ?, ?)`, commitNo, startID, endID, startTurn, endTurn, summary, title, string(tagJSON), s.summaryModel(), now, now)
505 if err != nil {
506 return err
507 }
508 commitID, err := res.LastInsertId()
509 if err != nil {
510 return err
511 }
512 for _, id := range ids {
513 if _, err := tx.ExecContext(ctx, `INSERT OR IGNORE INTO commit_messages(commit_id, message_id) VALUES(?, ?)`, commitID, id); err != nil {

Callers 3

ExecuteMethod · 0.80

Calls 2

touchCommitsMethod · 0.95
commitMessagesMethod · 0.95