MCPcopy Create free account
hub / github.com/douglance/devsql / extract_action

Function extract_action

crates/vcsql/src/providers/reflog.rs:96–126  ·  view source on GitHub ↗
(message: &str)

Source from the content-addressed store, hash-verified

94}
95
96fn extract_action(message: &str) -> String {
97 let msg_lower = message.to_lowercase();
98 if msg_lower.starts_with("commit:")
99 || msg_lower.starts_with("commit (initial):")
100 || msg_lower.starts_with("commit (amend):")
101 {
102 "commit".to_string()
103 } else if msg_lower.starts_with("checkout:") {
104 "checkout".to_string()
105 } else if msg_lower.starts_with("merge") {
106 "merge".to_string()
107 } else if msg_lower.starts_with("rebase") {
108 "rebase".to_string()
109 } else if msg_lower.starts_with("reset:") {
110 "reset".to_string()
111 } else if msg_lower.starts_with("pull:") {
112 "pull".to_string()
113 } else if msg_lower.starts_with("push") {
114 "push".to_string()
115 } else if msg_lower.starts_with("branch:") {
116 "branch".to_string()
117 } else if msg_lower.starts_with("clone:") {
118 "clone".to_string()
119 } else if msg_lower.starts_with("cherry-pick:") {
120 "cherry-pick".to_string()
121 } else if msg_lower.starts_with("revert:") {
122 "revert".to_string()
123 } else {
124 "other".to_string()
125 }
126}
127
128fn format_git_time(time: git2::Time) -> String {
129 let timestamp = time.seconds();

Callers 1

populateMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected