git/list[1] front-page[2] threads[3] people[4] search[5] about
 

git "manifest" command

From
CHCsaba Henk <csaba-ml@creo.hu>
Date
Jun 5, 2007, 10:03 UTC
Message-ID
<slrnf6ad74.4vk.csaba-ml@beastie.creo.hu>
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"
Next: Martin Waitz
Message 1 of 4 in “git "manifest" command”
  1. Csaba HenkJun 5, 2007
  2. Martin WaitzJun 5, 2007
  3. Csaba HenkJun 5, 2007
  4. Matthias LederhoferJun 5, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.