Skip to content

Conversation

dannykopping
Copy link
Contributor

@dannykopping dannykopping commented Mar 6, 2025

This fixes a slight regex bug on Bash 5, where [:/] would only match : but not both :/.

$ git remote -v | grep "github.com[:/]coder/coder.*(fetch)" | cut -f1

$ git remote -v | grep "github.com[:/]*coder/coder.*(fetch)" | cut -f1
origin

The former will actually cause the whole script to bork because of pipefail, since grep exits 1.

@dannykopping dannykopping marked this pull request as draft March 6, 2025 07:01
@dannykopping dannykopping force-pushed the dk/migration-merge branch 2 times, most recently from fcb516a to 1208852 Compare March 6, 2025 07:03
@dannykopping dannykopping marked this pull request as ready for review March 6, 2025 07:06
Signed-off-by: Danny Kopping <dannykopping@gmail.com>
@dannykopping dannykopping changed the title chore: prevent duplicate migration numbers in main chore: fix regex bug in migration number fixer Mar 6, 2025
@dannykopping dannykopping requested a review from mafredri March 6, 2025 07:24
Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked both the grep on macOS (2.6.0-FreeBSD) as well as GNU grep (3.11) and I can't figure out why this would produce different results on any version of grep. The only difference I see here is that we now allow :: and //, etc.

Or are you suggesting that a remote may be named github.com:/coder/coder and you wanted to add support for that? Edit: I re-read your description and that was indeed what you were going for. I thought ^this is an illegal format on GitHub but if not, have at it 👍🏻

Approving to unblock though since it's not a harmful change.

@dannykopping dannykopping merged commit b16275b into main Mar 6, 2025
32 checks passed
@dannykopping dannykopping deleted the dk/migration-merge branch March 6, 2025 10:21
@github-actions github-actions bot locked and limited conversation to collaborators Mar 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy