techhub.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
A hub primarily for passionate technologists, but everyone is welcome

Administered by:

Server stats:

5.4K
active users

#git

89 posts87 participants11 posts today

#git

i somehow know how to do this manually (editing files), but what is canonical way of re-applying a commit, that was reverted?

So:

* commit A
* revert A
... other development ...
* do commit A in the same way as above

Managed to get unit tests working in a pre-commit hook today - no more commits unless they pass the tests! Although every developer has to setup the hook manually because you can't easily put hooks into Git itself (there are hacky ways around this, e.g. by using post-install-cmd in Composer).

Nearly everything I work on is bespoke and legacy, so getting tests setup is a lot harder than with a new or modern project based on a framework.

Check out our new video on the AI integration in SmartGit 25.1 Preview (work in progress, still evolving):

buff.ly/fOZut4P

Commit faster and write better messages — with your choice of AI:

- GitHub's free and pro models
- OpenAI
- Anthropic (Claude)
- Ollama (on-premise)

We'd love to hear which model you prefer — let us know!

buff.ly- YouTubeEnjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube.
#SmartGit#AI#Git

deno-task-hooks: Git 훅을 Deno 태스크로 쉽게 관리하기

hackers.pub/@hongminhee/2025/d

Hackers' Pub · deno-task-hooks: Git 훅을 Deno 태스크로 쉽게 관리하기안녕하세요! 오늘은 제가 개발한 deno-task-hooks 패키지를 소개해 드리려고 합니다. 이 도구는 Deno 태스크를 Git 훅으로 사용할 수 있게 해주는 간단하면서도 유용한 패키지입니다.어떤 문제를 해결하나요? Git을 사용하는 개발 팀에서는 코드 품질 유지를 위해 커밋이나 푸시 전에 린트, 테스트 등의 검증 작업을 실행하는 것이 일반적입니다. 이러한 작업은 Git 훅을 통해 자동화할 수 있지만, 기존 방식에는 몇 가지 문제가 있었습니다:Git 훅 스크립트를 팀원들과 공유하기 어려움 (.git 디렉토리는 보통 버전 관리에서 제외됨)각 개발자가 로컬에서 훅을 직접 설정해야 하는 번거로움훅 스크립트의 일관성 유지가 어려움<deno-task-hooks는 이러한 문제를 해결하기 위해 Deno의 태스크 러너를 활용합니다. Deno 태스크는 deno.json 파일에 정의되어 버전 관리가 가능하므로, 팀 전체가 동일한 Git 훅을 쉽게 공유할 수 있습니다.어떻게 작동하나요? deno-task-hooks의 작동 방식은 간단합니다:deno.json 파일에 Git 훅으로 사용할 Deno 태스크를 정의합니다.hooks:install 태스크를 실행하면, 정의된 태스크들이 자동으로 .git/hooks/ 디렉토리에 설치됩니다.이후 Git 작업 시 해당 훅이 트리거되면 연결된 Deno 태스크가 실행됩니다.<설치 및 사용 방법 1. hooks:install 태스크 추가하기 먼저 deno.json 파일에 hooks:install 태스크를 추가합니다:{ "tasks": { "hooks:install": "deno run --allow-read=deno.json,.git/hooks/ --allow-write=.git/hooks/ jsr:@hongminhee/deno-task-hooks" }}<2. Git 훅 정의하기 Git 훅은 hooks: 접두사 다음에 훅 이름(케밥 케이스)을 붙여 정의합니다. 예를 들어, pre-commit 훅을 정의하려면:{ "tasks": { "hooks:pre-commit": "deno check *.ts && deno lint" }}<3. 훅 설치하기 다음 명령어를 실행하여 정의된 훅을 설치합니다:deno task hooks:install<이제 Git 커밋을 실행할 때마다 pre-commit 훅이 자동으로 실행되어 TypeScript 파일을 검사하고 린트 검사를 수행합니다.지원되는 Git 훅 종류 deno-task-hooks는 다음과 같은 모든 Git 훅 타입을 지원합니다:applypatch-msgcommit-msgfsmonitor-watchmanpost-updatepre-applypatchpre-commitpre-merge-commitpre-pushpre-rebasepre-receiveprepare-commit-msgpush-to-checkoutsendemail-validateupdate<이점 deno-task-hooks를 사용하면 다음과 같은 이점이 있습니다:간편한 공유: Git 훅을 deno.json 파일에 정의하여 팀 전체가 동일한 훅을 사용할 수 있습니다.설정 용이성: 새 팀원은 저장소를 클론한 후 한 번의 명령어로 모든 훅을 설치할 수 있습니다.유지 관리 용이성: 훅 스크립트를 중앙에서 관리하므로 변경 사항을 쉽게 추적하고 적용할 수 있습니다.Deno의 안전성: Deno의 권한 모델을 활용하여 훅 스크립트의 보안을 강화할 수 있습니다.<마치며 deno-task-hooks는 작은 패키지이지만, Git과 Deno를 함께 사용하는 팀의 개발 경험을 크게 향상시킬 수 있습니다. 코드 품질 유지와 개발 워크플로우 자동화를 위해 한번 사용해 보세요! 패키지는 JSR에서 다운로드할 수 있으며, GitHub에서 소스 코드를 확인할 수 있습니다. 피드백과 기여는 언제나 환영합니다! 😊

Hay #webdev people, #sysadmin person here. I'm in an #academic #science setting. We want people to make #web sites to support papers. A few years ago I was told #Djangeo was good. We are now linking there sites to there #git repos.

However, some sites made long ago, that where just a few #CGI scripts still work are still up. Yes, they where easy to review & confirm security. Django sites need porting.

So, I'm going shitty CGI scripts?

The way Gitlab, Forgejo, Gitea etc. use the server-side SSH server to accept pushed data over SSH relies on a system user called git having SSH access. (or forgejo in their case).

Access is granted by the standard
authorized_keys inside ~/.ssh, which for forgejo means /var/lib/forgejo/.ssh/authorized_keys. When a user adds an SSH key to their account, it's added to this authorized_keys file.

I really hate this, this means that any user of Forgejo is only inches away from having full shell access. The default shell of the
forgejo user is /bin/bash, it exists inside of /etc/passwd:

forgejo:x:122:130:Forgejo (Beyond coding. We forge.):/var/lib/forgejo:/bin/bash
I really really hate this. The only thing preventing random users of Forgejo having shell access is the default command of the SSH session as stipulated by the authorized_keys entry, this is what it looks like:
command="/usr/bin/forgejo --config=/etc/forgejo/app.ini serv key-1",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty,no-user-rc,restrict ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOgnZeNC4fMCXYuWxir7NlKts9Zj4sYZZJzzHh4IyTm2 Baa-New

This is technically
secure, there is no publicly known way of bypassing this and gaining shell access by adding your own SSH key to forge and SSHing into the server as the forgejo user. It will immediately disconnect you, and if you try submitting any specific command you'll receive Disallowed command.

But still, I really really really hate this. We're just one tiny misconfiguration, one minuscule exploit away from granting all forgejo users shell access into the server
:akko_sob:

Imagine for example, you were hosting a Minecraft server on Windows. And to grant a user access to it, you had to create them a Windows User inside
control userpasswords2 and then explicitly disallow them RDP access. That RDP config is the only thing preventing them for remoting straight into your server. This si what it feels like, I can't help but wish SSH was entirely separate from everything else going on here.

Which is exactly what Forgejo's own built-in SSH server does, I'll enable that and move it to a different port, because I'm too scared otherwise, and my server's not even public, and I haven't even started with Runners yet, those scare me even more
:02notlikethis:

Feel free to correct me if I'm wrong, or add your own insights I'd like to know more about this mentality
#ssh #git #forgejo #linux #security #gitlab

🌘 util/sortashuffle - 有序地隨機化項目
➤ 持續整合與程式碼品質提升
git.tgwil.net/util/sortashuffl
這份紀錄追蹤了 `util/sortashuffle` 專案的程式碼變更,顯示了開發者 Tristan Williams 在過去兩週內進行的多項更新。這些更新包括程式碼風格調整、錯誤修正、文件更新、以及確保 UTF-8 編碼等。開發者也反思了在提交程式碼前進行測試的重要性。
+ 感覺開發者在不斷地完善這個工具,雖然每次改動不大,但累積起來效果應該不錯。
+ 看到 commit message 有「I should test things before I commit」真是太有趣了,開發者也很有自知之明。
#版本控制 #程式碼更新 #Git

git.tgwil.netutil/sortashuffle - Shuffle things in order

alguien quiere ser mi colega de #git ? #python

estoy trabajando en una solucion para importar contenido de #youtube a #peertube

No es nada revolucionario... estoy aprendiendo :]
pero trato de hacerlo de la forma mas "profesional" posible.

tengo changelog:
codeberg.org/audricd/yt_2_pt/w

requisitos:
codeberg.org/audricd/yt_2_pt/w

kanban, con desarrollo / bugs:
codeberg.org/audricd/yt_2_pt/p

o sea que es bastante facil de incorporarse. aparte que el responsable (yo) es super majo, pese la apariencias

@kyva_dev @dotoscat @trankten @sam

se agradece #boost

Summary card of repository audricd/yt_2_pt
Codeberg.orgChangelogYoutube to Peertube migration tool

If I have a #codeberg account set up, with a verified #ssh key on my account and the corresponding public and private keys in `~/.ssh/`, is there a way that I can make it so that it doesn't ask me for my keyphrase every time I push? I'm sure VSCode could do this, but since I've switched to #Helix, which doesn't have git built-in I've been manually doing the git stuff.
My knowledge of #cryptography and #git are well and truly at the 'barely enough to get myself into trouble' level.
#AskFedi