elasticdog / transcrypt

transparently encrypt files within a git repository
MIT License
1.44k stars 102 forks source link

Use transcrypt on submodules #88

Open rjcoelho opened 4 years ago

rjcoelho commented 4 years ago

My use case is to have a repo with shared secrets across multiple repos. Currently it simply doesn't apply the clean/smudge filters. Changing into the submodule repo and calling transcrypt works. Can I do it automatically on a post submodule checkout action ?

jmurty commented 4 years ago

I am not familiar with submodules and I didn't find much info from a quick look around, but from what little I have found there doesn't seem to be an easy way to apply smudge filters etc in the "parent" repo and have them applied in "child" submodule repos.

This Stack Overflow answer has a work-around, though it doesn't seem like it would be much better or cleaner than writing a script to automate running transcript in submodule directories: https://stackoverflow.com/a/23671157/4970

rjcoelho commented 4 years ago

What I did was cd into the submodule path and run transcrypt from there .. it works What I would like is a git submodule foreach transcrypt be done automatically 🙂

andreineculau commented 4 years ago

@rjcoelho your case is a special case, as it sounds you have a parent repo with submodules that all share the same master password. What happens when you add a submodule that has another master password?

I don't see why transcrypt would take care of something that 1. is special 2. has a super simple solution already GIVEN your special circumstances.

All you need is really to share a bash script with your teammates transcrypt-all, along the lines of

#!/usr/bin/env bash

transcrypt $@
git submodule foreach "transcrypt $@"