Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 42 additions & 3 deletions add-entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,56 @@ const main = async (...args) => {
const addURL = url => {
const fileName = url.replace(/.*\//, '')
const match = fileName.match(fileNameRegex)
if (!match) throw new Error(`Cannot parse URL: ${url}`)
if (!match) throw new Error(`Cannot parse URL: ${url} (fileName: ${fileName})`)
else if (match[1]) urls.installers.push({ url, cpu: cpus[match[2]] })
else if (match[3]) urls.portableGits.push({ url, cpu: cpus[match[4]] })
else if (match[5]) urls.busyBoxMinGits.push({ url, cpu: cpus[match[6]] })
else if (match[7]) urls.minGits.push({ url, cpu: cpus[match[8]] })
else throw new Error(`Cannot parse URL: ${url}`)
}

let mode = 'append-to-top'
let date
let commit
while (args.length > 0) {
const arg = args.shift()
if (arg.startsWith('--date=')) date = arg.replace(/.*?=/, '')
else if (arg.startsWith('--commit=')) commit = arg.replace(/.*?=/, '')
else if (arg.startsWith('https://')) addURL(arg)
else {
else if (arg.startsWith('--backfill-release=')) {
if (args.length) throw new Error(`--backfill-release cannot be combined with other arguments!`)
const tagName = arg.replace(/.*?=/, '')
.replace(/^https:\/\/github\.com\/git-for-windows\/git\/releases\/tag\//, '')
if (!tagName.match(/^v[1-9][0-9]*(\.\d+){2}(-rc\d+)?\.windows\.\d+$/)) {
throw new Error(`Unexpected tag format: '${tagName}'!`)
}

const gh = async (path) =>
(await fetch(`https://api.github.com/repos/git-for-windows/git/${path}`)).json()
const { object: { sha: tagSHA } } = await gh(`git/ref/tags/${tagName}`)
const { object: { sha: commitSHA } } = await gh(`git/tags/${tagSHA}`)
commit = commitSHA
const { committer: { date: commitDate } } = await gh(`git/commits/${commitSHA}`)
date = (new Date(commitDate)).toLocaleString('en-US', {
weekday: 'short',
month: 'short',
day: 'numeric',
year: 'numeric',
hour: '2-digit',
hourCycle: "h24",
minute: '2-digit',
second: '2-digit',
timeZoneName: 'longOffset',
timeZone: "Etc/UTC"
})

const { assets } = await gh(`releases/tags/${tagName}`)
assets.forEach(asset => {
if (!asset.name.endsWith('.tar.bz2') && !asset.name.startsWith('pdbs')) addURL(asset.browser_download_url)
})

mode = 'insert-by-date'
} else {
throw new Error(`Unhandled argument '${arg}`)
}
}
Expand Down Expand Up @@ -87,7 +121,12 @@ const main = async (...args) => {
'</ul>'
].join('')

sections[1] = `${insert}\n\n${sections[1]}`
let index = 1
if (mode === 'insert-by-date') {
while (index + 2 < sections.length && insert.localeCompare(sections[index]) < 0) index += 2
} else if (mode !== 'append-to-top') throw new Error(`Unhandled mode: '${mode}'`)
sections[index] = `${insert}\n\n${sections[index]}`

fs.writeFileSync('index.html', sections.join(''))
}

Expand Down
18 changes: 18 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ <h2 id="2025-03-10T14:05:13.000Z"><a class="anchor" href="#2025-03-10T14:05:13.0
<li>MinGit (BusyBox): <a href="https://github.com/git-for-windows/git-snapshots/releases/download/prerelease-2.49.0-rc1.windows.1-2-g511a07b339-20250310140624/MinGit-prerelease-2.49.0-rc1.windows.1-2-g511a07b339-20250310140624-busybox-64-bit.zip">x64 (64-bit)</a> and <a href="https://github.com/git-for-windows/git-snapshots/releases/download/prerelease-2.49.0-rc1.windows.1-2-g511a07b339-20250310140624/MinGit-prerelease-2.49.0-rc1.windows.1-2-g511a07b339-20250310140624-busybox-32-bit.zip">x86 (32-bit)</a>.</li>
</ul>

<h2 id="2025-03-05T12:01:38.000Z"><a class="anchor" href="#2025-03-05T12:01:38.000Z">&#128279;</a>Wed, Mar 5, 2025, 12:01:38 GMT<br />(commit <a href="https://github.com/git-for-windows/git/commit/31963038164d1a2d78dc46225f8441e8c0fb07a8">31963038164d1a2d78dc46225f8441e8c0fb07a8</a>)</h2>

<ul>
<li>Git for Windows installer: <a href="https://github.com/git-for-windows/git/releases/download/v2.49.0-rc1.windows.1/Git-2.49.0-rc1-64-bit.exe">x64 (64-bit)</a> and <a href="https://github.com/git-for-windows/git/releases/download/v2.49.0-rc1.windows.1/Git-2.49.0-rc1-arm64.exe">ARM64</a>.</li>
<li>Portable Git (self-extracting <tt>.7z</tt> archive): <a href="https://github.com/git-for-windows/git/releases/download/v2.49.0-rc1.windows.1/PortableGit-2.49.0-rc1-64-bit.7z.exe">x64 (64-bit)</a> and <a href="https://github.com/git-for-windows/git/releases/download/v2.49.0-rc1.windows.1/PortableGit-2.49.0-rc1-arm64.7z.exe">ARM64</a>.</li>
<li>MinGit: <a href="https://github.com/git-for-windows/git/releases/download/v2.49.0-rc1.windows.1/MinGit-2.49.0-rc1-64-bit.zip">x64 (64-bit)</a>, <a href="https://github.com/git-for-windows/git/releases/download/v2.49.0-rc1.windows.1/MinGit-2.49.0-rc1-arm64.zip">ARM64</a> and <a href="https://github.com/git-for-windows/git/releases/download/v2.49.0-rc1.windows.1/MinGit-2.49.0-rc1-32-bit.zip">x86 (32-bit)</a>.</li>
<li>MinGit (BusyBox): <a href="https://github.com/git-for-windows/git/releases/download/v2.49.0-rc1.windows.1/MinGit-2.49.0-rc1-busybox-64-bit.zip">x64 (64-bit)</a> and <a href="https://github.com/git-for-windows/git/releases/download/v2.49.0-rc1.windows.1/MinGit-2.49.0-rc1-busybox-32-bit.zip">x86 (32-bit)</a>.</li>
</ul>

<h2 id="2025-03-04T18:54:35.000Z"><a class="anchor" href="#2025-03-04T18:54:35.000Z">&#128279;</a>Tue, Mar 4, 2025, 06:54:35 PM GMT<br />(commit <a href="https://github.com/git-for-windows/git/commit/1424e2777e22d3195d9c9926ec3d1909bc0dc1e1">1424e2777e22d3195d9c9926ec3d1909bc0dc1e1</a>)</h2>

<ul>
Expand All @@ -55,6 +64,15 @@ <h2 id="2025-03-04T18:54:35.000Z"><a class="anchor" href="#2025-03-04T18:54:35.0
<li>MinGit (BusyBox): <a href="https://github.com/git-for-windows/git-snapshots/releases/download/prerelease-2.49.0-rc0.windows.1-2-g1424e2777e-20250304185532/MinGit-prerelease-2.49.0-rc0.windows.1-2-g1424e2777e-20250304185532-busybox-64-bit.zip">x64 (64-bit)</a> and <a href="https://github.com/git-for-windows/git-snapshots/releases/download/prerelease-2.49.0-rc0.windows.1-2-g1424e2777e-20250304185532/MinGit-prerelease-2.49.0-rc0.windows.1-2-g1424e2777e-20250304185532-busybox-32-bit.zip">x86 (32-bit)</a>.</li>
</ul>

<h2 id="2025-02-26T20:19:31.000Z"><a class="anchor" href="#2025-02-26T20:19:31.000Z">&#128279;</a>Wed, Feb 26, 2025, 20:19:31 GMT<br />(commit <a href="https://github.com/git-for-windows/git/commit/d20d8cdf84017e3fcf0081f4c2f9ef49647afb08">d20d8cdf84017e3fcf0081f4c2f9ef49647afb08</a>)</h2>

<ul>
<li>Git for Windows installer: <a href="https://github.com/git-for-windows/git/releases/download/v2.49.0-rc0.windows.1/Git-2.49.0-rc0-64-bit.exe">x64 (64-bit)</a> and <a href="https://github.com/git-for-windows/git/releases/download/v2.49.0-rc0.windows.1/Git-2.49.0-rc0-arm64.exe">ARM64</a>.</li>
<li>Portable Git (self-extracting <tt>.7z</tt> archive): <a href="https://github.com/git-for-windows/git/releases/download/v2.49.0-rc0.windows.1/PortableGit-2.49.0-rc0-64-bit.7z.exe">x64 (64-bit)</a> and <a href="https://github.com/git-for-windows/git/releases/download/v2.49.0-rc0.windows.1/PortableGit-2.49.0-rc0-arm64.7z.exe">ARM64</a>.</li>
<li>MinGit: <a href="https://github.com/git-for-windows/git/releases/download/v2.49.0-rc0.windows.1/MinGit-2.49.0-rc0-64-bit.zip">x64 (64-bit)</a>, <a href="https://github.com/git-for-windows/git/releases/download/v2.49.0-rc0.windows.1/MinGit-2.49.0-rc0-arm64.zip">ARM64</a> and <a href="https://github.com/git-for-windows/git/releases/download/v2.49.0-rc0.windows.1/MinGit-2.49.0-rc0-32-bit.zip">x86 (32-bit)</a>.</li>
<li>MinGit (BusyBox): <a href="https://github.com/git-for-windows/git/releases/download/v2.49.0-rc0.windows.1/MinGit-2.49.0-rc0-busybox-64-bit.zip">x64 (64-bit)</a> and <a href="https://github.com/git-for-windows/git/releases/download/v2.49.0-rc0.windows.1/MinGit-2.49.0-rc0-busybox-32-bit.zip">x86 (32-bit)</a>.</li>
</ul>

<h2 id="2025-02-26T18:35:33.000Z"><a class="anchor" href="#2025-02-26T18:35:33.000Z">&#128279;</a>Wed, Feb 26, 2025, 06:35:33 PM GMT<br />(commit <a href="https://github.com/git-for-windows/git/commit/ba6e4aaec47e8695bd59117967d9b18b1e477686">ba6e4aaec47e8695bd59117967d9b18b1e477686</a>)</h2>

<ul>
Expand Down