Test::S...er::Git(3)
π Test::Smoke::Syncer::Git π
okay bestie, so this whole thing β Test::Smoke::Syncer::Git β handles syncing with git repositories. That's the job. That's the vibe. She syncs, she fetches, she resets, she serves. π¦
No cap, she's the little module that keeps your smoker's git checkouts from going feral. Let's get into it. π
πΈ Test::Smoke::Syncer::Git->new( %args ) πΈ
Constructor energy. You hand her a hash of args and she's like "say less." π
Keys for %args:
gitoriginβ where the origin lives, bestie.gitdirβ the git directory.gitbinβ the git binary, because sometimes git isn't just chillin' on your PATH.gitbranchfileβ the file she reads to figure out which branch we're on.gitdfbranchβ yeah, she takes this one too.
π₯ $syncer->sync() π₯
Do the actual syncing. The main character moment. β¨
There are 2 repositories, and they both need to be updated:
- The first (mirror) repository has the
github.com/Perlrepository as its (origin) remote. - The second repository is used to run the smoker from.
Two girlies, two glow-ups, one method. Periodt. π
π _sync_full_checkout() π
The private one. The behind-the-scenes queen. For the proxy-repository we do:
git fetch --all
git remote prune origin
git reset --hard origin/$gitbranch
For the working-repository we do:
git clean -dfx
git fetch --all
git reset --hard origin/$gitbranch
ngl --hard is not playing around. She said commit to it. π
π§ _sync_bare() π§
For the mirror-repository we do:
git clone --mirror $gitorigin $gitdir # if not set up
git remote update --prune
For the working-repository we do:
git clone --local $gitdir $ddir # if not set up
git reset --hard HEAD
git clean -dfx
git fetch --all
git reset --hard origin/$gitbranch
See those little # if not set up comments? Yeah β the clone only happens if it's not set up yet. iykyk. π
π¦ $git->get_git_branch() π¦
Reads the first line of the file set in gitbranchfile and returns its value.
That's it. That's the whole method. Lowkey iconic for how unbothered it is. πΈ
π COPYRIGHT π
(c) 2002-2013, All rights reserved.
- Abe Timmerman
<abeltje@cpan.org>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See:
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. π (she's free, she's honest, she's not making promises, and honestly? respect.)
perl v5.42.0 β¨ 2025-07-25 β¨ and yeah the header calls her Test::S...er::Git(3) because terminals truncate, but you and me both know the full name. π Byeeee, go sync something. π«Ά
π¦ where this page comes from
- fedora 43: perl-Test-Smoke 1.84-2.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms