Skip to content

Commit 3addc7c

Browse files
committed
/add relnote: respect MinTTY's "epoch"
In the Pacman universe, there is the concept of an "epoch", which is part of the versioning scheme and which has more weight than the `pkgver` value. This concept allows following projects which "re-set" their version, for example (e.g. switching from a date-based "version" to an actual version that would naturally sort way below the previous date-based one). In the Git for Windows project, we incremented the epoch of the `mintty` package, originally simply to override MSYS2's `mintty`, even if that was technically not even necessary. Yet it is part of Git for Windows' legacy that the `/add release note` command needs to keep in mind when trying to verify that the `mintty` packages have been deployed properly. Thankfully, `mintty` is the only package built by Git for Windows that has an epoch set, and hence it is the only package that needs to be treated specially in this way. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 0a37279 commit 3addc7c

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

GitForWindowsHelper/component-updates.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ const pacmanRepositoryURLs = (package_name, version) =>
120120
]
121121

122122
const getMissingDeployments = async (package_name, version) => {
123+
// MinTTY is at epoch 1, which is part of Pacman's versioning scheme
124+
if (package_name === 'mintty') version = `1~${version}`
125+
123126
const urls = []
124127
const msysName = package_name.replace(/^mingw-w64-/, '')
125128
if (packageNeedsBothMSYSAndMINGW(msysName)) {

__tests__/component-updates.test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,12 @@ http://www.gnutls.org/news.html#2023-02-10`
131131

132132
test('getMissingDeployments()', async () => {
133133
const missingURL = 'https://wingit.blob.core.windows.net/x86-64/curl-8.1.2-1-x86_64.pkg.tar.xz'
134-
const mockDoesURLReturn404 = jest.fn(url => url === missingURL)
134+
const missingMinTTYURL = 'https://wingit.blob.core.windows.net/i686/mintty-1~3.6.5-1-i686.pkg.tar.xz'
135+
const mockDoesURLReturn404 = jest.fn(url => url === missingURL || url === missingMinTTYURL)
135136
jest.mock('../GitForWindowsHelper/https-request', () => {
136137
return { doesURLReturn404: mockDoesURLReturn404 }
137138
})
138139

139140
expect(await getMissingDeployments('curl', '8.1.2')).toEqual([missingURL])
141+
expect(await getMissingDeployments('mintty', '3.6.5')).toEqual([missingMinTTYURL])
140142
})

0 commit comments

Comments
 (0)