8000 Updating rmbackup's git check to allow for multiple backups in one repo by john-osullivan · Pull Request #9 · kg4zow/rm2-scripts · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Updating rmbackup's git check to allow for multiple backups in one repo #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

john-osullivan
Copy link

The existing check validates that the repo is in git by directly looking for .git directory. This fails if the backup directory is within a repo, though. My expectation is that all of the commands would still work fine if we didn't run this from the root of the repo, though.

Having the command go in one repo I figured out this command which uses a subshell to validate that the out_dir is within a git working tree, seems like a drop-in replacement!

Also, this is my first time seeing your work -- killer stuff. Thanks for the countless hours working on this stuff and sharing it for free.

By checking to see if we're in a work tree, rather than just looking for a `.git` directory, we can have one repo store the backups for all devices
@kg4zow
Copy link
Owner
kg4zow commented Jun 5, 2025

I have separate git repos for each of my tablets ... I guess it never occurred to me that somebody would want to use a directory within a repo, as their backup directory.

I like the idea, but I'm actually in the middle of adding a different feature (adding an option which will read the serial number and cd into the appropriate directory first, before doing anything else) and I don't want to have two different changes in flight at the same time. Let me finish with that first (hopefully later today or tomorrow), and I'll add the git rev-parse --is-inside-work-tree thing after that.

I also need to figure out how to handle creating the backup directory structure. I think it will just be a documentation update, but I want to "walk through" it a few times, both in my head and in a work directory on my workstation.

Thanks for this - it's not something I personally need, but it does make the script more flexible for others, which is always a good thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0