* git "manifest" command
@ 2007-06-05 10:03 Csaba Henk
2007-06-05 11:44 ` Martin Waitz
0 siblings, 1 reply; 4+ messages in thread
From: Csaba Henk @ 2007-06-05 10:03 UTC (permalink / raw)
To: git
Hi,
I was lacking a "manifest" like command, one which operates like
git-ls-files just you can use it with arbitrary tree-ish (or, put it
otherwise, one which opererates like git-ls-tree just acts recursively).
Maybe it's there already and I just didn't find my way through git
glossary?
Anyway, I rolled my own. Chanches are you find it an useful addition.
Csaba
------[git-manifest.sh]---8<---------------------------------------
#!/bin/sh
#
# Copyright (c) 2007 Csaba Henk
display() {
if [ $verbose ]
then
echo -n $1 $2 $3" "
fi
echo "$4"
}
walk() {
git-ls-tree "$1" | while read -r mode type sha name
do
if [ "$type" = tree ]
then
display $mode $type $sha "$2$name/"
walk $sha "$2$name/"
else
display $mode $type $sha "$2$name"
fi
done
}
help() {
echo \
"List content of tree-ish recursively. Usage:
`basename "$0"` [-v] <tree-ish>
" >&2
exit
}
case $# in
1|2) ;;
*)
help
esac
verbose=
if [ $# -eq 2 ]
then
if [ "$1" = -v ]
then
verbose=1
else
help
fi
shift
else
case "$1" in
-h|--help) help
esac
fi
walk "$1"
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: git "manifest" command 2007-06-05 10:03 git "manifest" command Csaba Henk @ 2007-06-05 11:44 ` Martin Waitz 2007-06-05 12:18 ` Csaba Henk 0 siblings, 1 reply; 4+ messages in thread From: Martin Waitz @ 2007-06-05 11:44 UTC (permalink / raw) To: Csaba Henk; +Cc: git [-- Attachment #1: Type: text/plain, Size: 332 bytes --] hoi :) On Tue, Jun 05, 2007 at 10:03:18AM +0000, Csaba Henk wrote: > I was lacking a "manifest" like command, one which operates like > git-ls-files just you can use it with arbitrary tree-ish (or, put it > otherwise, one which opererates like git-ls-tree just acts recursively). like git ls-tree -r? -- Martin Waitz [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: git "manifest" command 2007-06-05 11:44 ` Martin Waitz @ 2007-06-05 12:18 ` Csaba Henk 2007-06-05 17:11 ` Matthias Lederhofer 0 siblings, 1 reply; 4+ messages in thread From: Csaba Henk @ 2007-06-05 12:18 UTC (permalink / raw) To: git On 2007-06-05, Martin Waitz <tali@admingilde.org> wrote: > like git ls-tree -r? Yes. I knew this functionality must be there somewehere... Thanks. Csaba ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: git "manifest" command 2007-06-05 12:18 ` Csaba Henk @ 2007-06-05 17:11 ` Matthias Lederhofer 0 siblings, 0 replies; 4+ messages in thread From: Matthias Lederhofer @ 2007-06-05 17:11 UTC (permalink / raw) To: Csaba Henk; +Cc: git Csaba Henk <csaba-ml@creo.hu> wrote: > On 2007-06-05, Martin Waitz <tali@admingilde.org> wrote: > > like git ls-tree -r? > > Yes. I knew this functionality must be there somewehere... If you use this from a script note that ls-tree shows the subdirectory of a tree that corresponds to the current directory in the repository. This one should always show the full tree: $ git ls-tree --full-name -r HEAD $(git rev-parse --show-cdup) ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-06-05 17:11 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2007-06-05 10:03 git "manifest" command Csaba Henk 2007-06-05 11:44 ` Martin Waitz 2007-06-05 12:18 ` Csaba Henk 2007-06-05 17:11 ` Matthias Lederhofer
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.