Add an isMerge attribute to commits

f0856f6c06cb76569ce3961f775ce4daf431ab82

Tucker McKnight <tucker@pangolin.lan> | Sun Feb 01 2026

Add an isMerge attribute to commits

Also fix bug where the commit message wasn't being snipped correctly
on merge commits. This was because they have the extra metadata line
at the top, "Merge," which means the commit message is now five lines
down instead of four.
js_templates/commits.ts:51
Before
51
After
51
        commit.isMerge ? m('span', {class: 'badge rounded-pill bg-primary me-1'}, 'merge') : null,
src/dataTypes.ts:20
Before
20
After
20
    isMerge: boolean,
src/repos.ts:126
Before
126
127
      const compareToBranchCommits = new Set()
      const thisBranchCommits = new Set()
After
126
127
      const compareToBranchCommits = new Set<string>()
      const thisBranchCommits = new Set<string>()
src/repos.ts:142
Before
142
143
      const onlyInThisBranch = Array.from(thisBranchCommits).filter(thisBranchCommit => !compareToBranchCommits.has(thisBranchCommit)).length
      const onlyInCompareToBranch = Array.from(compareToBranchCommits).filter(compareToBranchCommit => !thisBranchCommits.has(compareToBranchCommit)).length
After
142
143
      const onlyInThisBranch = Array.from(thisBranchCommits).filter((thisBranchCommit) => {
        return !commits.get(thisBranchCommit).isMerge && !compareToBranchCommits.has(thisBranchCommit)
      }).length
      const onlyInCompareToBranch = Array.from(compareToBranchCommits).filter((compareToBranchCommit) => {
        return !commits.get(compareToBranchCommit).isMerge && !thisBranchCommits.has(compareToBranchCommit)
      }).length
src/vcses/git/operations.ts:66
Before
66
      let author: string, date: string
After
66
      let author: string, date: string, isMerge: boolean
src/vcses/git/operations.ts:74
Before
74
75
      const diffStart = currentPatch.findIndex((line) => {
      const commitMessage = currentPatch.slice(4, diffStart).map(str => str.replace("    ", "")).filter((line) => {
After
74
75
        else if (currentPatch[lineNumber].startsWith("Merge")) {
          isMerge = true
        }
      let diffStart = currentPatch.findIndex((line) => {
      // If no line starts with "diff", this
      // is probably a mege commit. Use the last
      // line of the patch + 1, in that case, to just get the full
      // text of the commit
      let messageStart = 4
      if (diffStart === -1) {
        messageStart = 5
        diffStart = currentPatch.length
      }
      const commitMessage = currentPatch.slice(messageStart, diffStart).map(str => str.replace("    ", "")).filter((line) => {
src/vcses/git/operations.ts:88
Before
88
After
88
        isMerge: isMerge || false,