I don't understand what the following line (currently at https://github.com/fabacab/git-archive-all.sh/blob/master/git-archive-all.sh#L242 ) attempted to achieve:
TREEISH=$(git submodule | grep "^ .*${path%/} " | cut -d ' ' -f 2)
This is completely
First of all, git submodule only lists the "direct" submodules, not the "transitive" ones. This may be related to #2. Consider using something like git submodule foreach --recursive pwd.
The grep part assumes that the current state of the submodule is clean (the first char is for "clean",+for "changes made", etc.). That's not guaranteed. Indeed,git-archive-all.sh --tree-ish only really makes sense when the given tree-ish is different from HEAD.
The cut part tries to finish the regex matching that should have been done in grep; see grep -o.
It doesn't care anywhere about the original --tree-ish argument at all.
I don't understand what the following line (currently at https://github.com/fabacab/git-archive-all.sh/blob/master/git-archive-all.sh#L242 ) attempted to achieve:
This is completely
First of all,
git submoduleonly lists the "direct" submodules, not the "transitive" ones. This may be related to #2. Consider using something likegit submodule foreach --recursive pwd.The
greppart assumes that the current state of the submodule is clean (the first char isfor "clean",+for "changes made", etc.). That's not guaranteed. Indeed,git-archive-all.sh --tree-ishonly really makes sense when the given tree-ish is different from HEAD.The
cutpart tries to finish the regex matching that should have been done in grep; seegrep -o.It doesn't care anywhere about the original
--tree-ishargument at all.