Test::S...er::Git(3)

πŸ“¦
version 1.84 Β· 2 versions
, in fedora 43

πŸ’– 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:

  1. The first (mirror) repository has the github.com/Perl repository as its (origin) remote.
  2. 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. 🌸


(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