Git::Raw::Stash(3pm)

πŸ’– Git::Raw::Stash πŸ’–

okay bestie, gather round, because this is Git::Raw::Stash from the User Contributed Perl Documentation section, and it's literally the little helper that handles your stash game. πŸŽ€

VERSION: version 0.90 ✨


🌸 DESCRIPTION 🌸

It's a helper class to manage stashes. That's it, that's the job. πŸ’…

⚠️ WARNING: the API of this module is unstable and may change without warning. any change will be appropriately documented in the changelog, so like, no cap, but also stay on your toes. 🫢

✨ METHODS ✨

apply( $repo, $index, [\%stash_apply_opts] ) πŸ¦‹

Applies a single stashed state from the stash list. Cute, right? BUT. If local changes in the working directory conflict with the changes in the stash, this function throws a Git::Raw::Error exception with a Git::Raw::Error::EMERGECONFLICT error code. 😭

And if you're restoring untracked files or ignored files and there's a conflict when applying the modified files, then those files will remain in the working directory. yes, they stay. it's giving "we tried".

Valid fields for %stash_apply_opts include:

  • checkout_opts β€” see Git::Raw::Repository->checkout() for the deets πŸ‘€
  • flags
    • reinstate_index β€” try to reinstate not only the working tree's changes, but also the index's changes. both. she wants both. πŸ‘‘
  • callbacks
    • apply_progress β€” progress notification function. The callback receives a single $progress value which may be any constant provided by Git::Raw::Stash::Progress. πŸ“ˆ

pop( $repo, $index, [\%stash_apply_opts] ) πŸ’…

Applies a single stashed state from the stash list and then removes it from the list if successful. apply + yeet. periodt.

save( $repo, $stasher, $msg [, \@opts] ) πŸŽ€

Saves the local modifications to a new stash. Non-default options may be specified by providing the optional @opts argument. If files were stashed, this function returns a Git::Raw::Commit object, otherwise undef. bestie, if nothing got stashed you get undef and you just have to live with that. πŸ™ˆ

Valid fields for the @opts array are:

  • keep_index β€” all changes already added to the index are left intact in the working directory. The default is to also stash changes in the index. so like, by default she stashes the index too. πŸ’œ
  • include_untracked β€” all untracked files are also stashed and then cleaned up from the working directory. The default is to leave untracked files in the working directory. 🧚
  • include_ignored β€” all ignored files are also stashed and then cleaned up up from the working directory. The default is to leave ignored files in the working directory. ⭐

foreach( $repo, $callback ) 🌈

Runs $callback for every stash in the repo. The callback receives three arguments: the stash $index, the stash $message and the stash $commit, a Git::Raw::Commit object. A non-zero return value will stop the loop. so if you return truthy, she's done. main character decided. πŸ”₯

drop( $repo, $index ) πŸ’€

Removes a single stash from the stash list. bye girl. πŸ‘‹


🫢 AUTHOR 🫢

Alessandro Ghedini <alexbio@cpan.org>

Jacques Germishuys <jacquesg@cpan.org>


Copyright 2012 Alessandro Ghedini.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.


and that's the whole page, bestie πŸ’– this doc shipped as part of perl v5.42.3, dated 2026-08-19, and it lives in the User Contributed Perl Documentation corner of the manual. slay, go stash something. βœ¨πŸŒΈπŸ¦‹

πŸ“¦ where this page comes from