this post was submitted on 06 Dec 2024
82 points (97.7% liked)

Programming

17661 readers
232 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities [email protected]



founded 2 years ago
MODERATORS
top 14 comments
sorted by: hot top controversial new old
[–] [email protected] 21 points 1 week ago

Presumably they picked the repo because it will auto-merge MRs if they pass testing even without human approvals. Glad they caught it and good work to everyone involved, but I'm gonna file this one under my "fuck around, find out" folder.

[–] snaggen 16 points 2 weeks ago (1 children)

This is why Bobby Tables mom needs her Github account suspended.....

[–] snaggen 9 points 2 weeks ago

On an unrelated note, don't forget to sanitize your input.

[–] FizzyOrange 16 points 2 weeks ago (1 children)

Where's the code that doesn't quote this properly? I'm guessing it's Bash.

[–] [email protected] 19 points 1 week ago

Ding ding ding! We have a winner!

It's a third-party GitHub Action that is passing the branch name directly to Bash. So to be clear, not GitHub's fault.

[–] BehindTheBarrier 12 points 2 weeks ago (1 children)

I never considered branch names to be a vector, but in hindsight it makes total sense when put into a workflow like that. What possibly surprised me even more, was that branch names weren't limited to basic characters or at least no special signs. I obviously see the case for all the extended characters outside the latin alphabet, such as Chinese characters, but I totally expected restrictions on special symbols like ", ', /, \, ;, etc.

[–] [email protected] 1 points 2 weeks ago (2 children)

/ is used to separate the same branch in different repos. For example origin/main and remote/main. Surprising that the other stuff is legal though

[–] [email protected] 3 points 1 week ago (1 children)

You can still freely use / in branch names. Having remote branches available as remote/branch is just a convenience, and you can delete or modify them locally. It’s common to use / in branch names, too.

[–] [email protected] 0 points 1 week ago

Okay? I'm well aware. I do so all the time

[–] BehindTheBarrier 1 points 1 week ago

That's true, i didn't think about that when I wrote it.

I'm used to the world being pretty simple though, so for me that slash has always just been a visual representation of the location of the branch if that makes sense. We don't have to have a slash in the branch name, only to use it to represent where that branch is located. It could have been something git only used for presentation.

[–] [email protected] -4 points 2 weeks ago (1 children)

Terrible title, I thought it was a vulnerability in git.

[–] [email protected] 7 points 1 week ago (1 children)

Pull requests are not a feature of git, you probably thought they were?

[–] Zykino 4 points 1 week ago (1 children)

Yup, pull requests are an invention from git's servers (I think github came up with that first). The built in way (famously used by the linux kernel) is git-send-email.

[–] [email protected] 3 points 1 week ago* (last edited 1 week ago)

GitHub is completely unrelated to git.

git-send-email is not even very similar to a pull request, just tangentially related but very different conceptually.