Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: fix up migration number fixer#14266

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
dannykopping merged 2 commits intomainfromdk/fixup-mig-fix
Aug 14, 2024
Merged

Conversation

dannykopping
Copy link
Contributor

@dannykoppingdannykopping commentedAug 14, 2024
edited
Loading

Fixes:

  • more portable shebang
  • usesgit mv which is more idiomatic for renames

This script still relies on folks needing a version of Bash not shipped with MacOS by default.

I'm using this version, so it works, but it doesn't work natively for folks running the default.

$ which bash/opt/homebrew/bin/bash$ bash --versionGNU bash, version 5.2.26(1)-release (aarch64-apple-darwin23.2.0)# Default version$ /bin/bash --versionGNU bash, version 3.2.57(1)-release (arm64-apple-darwin23)

I created a Go equivalent inhttps://github.com/coder/coder/compare/dk/fix-migs which we could consider moving to.
It's a bit simpler (doesn't pull the given branch - trying to be more UNIXy), and requires a regex to match a file needing a rename, so it's more dumb but more explicit.

Signed-off-by: Danny Kopping <danny@coder.com>
Copy link
Member

@mafredrimafredri left a comment

Choose a reason for hiding this comment

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

We could consider importinglib.sh and verify Bash that way. This is not the only script that requires a more modern Bash I believe.

I'm a bit conflicted re:git mv, I agree it's not elegant but the file being renamed is not guaranteed to be staged, wouldn't that cause issues?

@mafredri
Copy link
Member

I created a Go equivalent inhttps://github.com/coder/coder/compare/dk/fix-migs which we could consider moving to.

Cool, I'm not particularly for out against so feel free to PR that work if you want to. Might be best to have a script or make target to shoot having to "go run".

It's a bit simpler (doesn't pull the given branch - trying to be more UNIXy),

We don't pull, just fetch. The fetch has a purpose in that it allows checking the remote, not just your local files. For me that was a big reason to write the script, when I had conflicts I could just run the script and enjoy the magic.

and requires a regex to match a file needing a rename, so it's more dumb but more explicit.

Why dumb it down? When I had conflicts I didn't really want to figure out what I need to do, just wanted the problem solved 😂

dannykopping reacted with laugh emoji

@dannykopping
Copy link
ContributorAuthor

We could consider importinglib.sh and verify Bash that way. This is not the only script that requires a more modern Bash I believe.

Hhmm interesting idea. You thinking of usinglib.sh to replace the process with a call to/usr/bin/env bash so that regardless of the shebang we'll get the PATH bash, and on top of that validate a minimum version? Or just the latter?

I'm a bit conflicted re:git mv, I agree it's not elegant but the file being renamed is not guaranteed to be staged, wouldn't that cause issues?

Oof, good point.

We don't pull, just fetch. The fetch has a purpose in that it allows checking the remote, not just your local files. For me that was a big reason to write the script, when I had conflicts I could just run the script and enjoy the magic.

Fair point! I misspoke.


I think let's keep this script instead of the Go one (that took me like 10m with ChatGPT, Mr Snippet himself, doing most of the work 😄). Let's keep thelib.sh changes for a subsequent PR?

mafredri reacted with thumbs up emoji

Signed-off-by: Danny Kopping <danny@coder.com>
Copy link
Member

@mafredrimafredri left a comment

Choose a reason for hiding this comment

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

Or just the latter?

Just the latter 👍.

@dannykoppingdannykopping merged commitc90e6d7 intomainAug 14, 2024
30 checks passed
@dannykoppingdannykopping deleted the dk/fixup-mig-fix branchAugust 14, 2024 09:05
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsAug 14, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@mafredrimafredrimafredri approved these changes

Assignees

@dannykoppingdannykopping

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@dannykopping@mafredri

[8]ページ先頭

©2009-2025 Movatter.jp