{"thread":{"id":"8439","subject":"git \"manifest\" command","startedAt":"2007-06-05T10:03:18Z","lastAt":"2007-06-05T17:11:08Z","messageCount":4,"participants":["Csaba Henk","Martin Waitz","Matthias Lederhofer"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"44053","messageId":"slrnf6ad74.4vk.csaba-ml@beastie.creo.hu","threadId":"8439","inReplyTo":null,"subject":"git \"manifest\" command","fromName":"Csaba Henk","fromEmail":"csaba-ml@creo.hu","sentAt":"2007-06-05T10:03:18Z","receivedAt":"2007-06-05T10:03:18Z","isPatch":false,"sender":{"key":"csaba-ml@creo.hu","avatar":null},"body":"Hi,\n\nI was lacking a \"manifest\" like command, one which operates like\ngit-ls-files just you can use it with arbitrary tree-ish (or, put it\notherwise, one which opererates like git-ls-tree just acts recursively).\nMaybe it's there already and I just didn't find my way through git\nglossary?\n\nAnyway, I rolled my own. Chanches are you find it an useful addition.\n\nCsaba\n\n------[git-manifest.sh]---8<---------------------------------------\n#!/bin/sh\n#\n# Copyright (c) 2007 Csaba Henk \n\ndisplay() {\n\tif [ $verbose ]\n\tthen\n\t\techo -n $1 $2 $3\" \"\n        fi\n        echo \"$4\"\n}\n\nwalk() {\n\tgit-ls-tree \"$1\" | while read -r mode type sha name\n\tdo\n\t\tif [ \"$type\" = tree ]\n\t\tthen\n\t\t\tdisplay $mode $type $sha \"$2$name/\"\n\t\t\twalk $sha \"$2$name/\"\n\t\telse\n\t\t\tdisplay $mode $type $sha \"$2$name\"\n\t\tfi\n\tdone\n}\n\nhelp() {\n    echo \\\n\"List content of tree-ish recursively. Usage:\n\n`basename \"$0\"` [-v] <tree-ish>\n\" >&2\n    exit\n}\n\ncase $# in\n    1|2) ;;\n    *)\n       help \nesac\n\nverbose=\nif [ $# -eq 2 ]\nthen\n\tif [ \"$1\" = -v ]\n\tthen\n\t\tverbose=1\n\telse\n\t\thelp\n\tfi\n\tshift\nelse\n\tcase \"$1\" in\n\t\t-h|--help) help\n\tesac\nfi\n\nwalk \"$1\"\n"},{"id":"44070","messageId":"20070605114454.GI16637@admingilde.org","threadId":"8439","inReplyTo":"slrnf6ad74.4vk.csaba-ml@beastie.creo.hu","subject":"Re: git \"manifest\" command","fromName":"Martin Waitz","fromEmail":"tali@admingilde.org","sentAt":"2007-06-05T11:44:54Z","receivedAt":"2007-06-05T11:44:54Z","isPatch":false,"sender":{"key":"tali@admingilde.org","avatar":"https://gravatar.com/avatar/3f89b03eee362187effabe257898735b475673a12265c398ea9161259ae91553?d=mp&s=160"},"body":"hoi :)\n\nOn Tue, Jun 05, 2007 at 10:03:18AM +0000, Csaba Henk wrote:\n> I was lacking a \"manifest\" like command, one which operates like\n> git-ls-files just you can use it with arbitrary tree-ish (or, put it\n> otherwise, one which opererates like git-ls-tree just acts recursively).\n\nlike git ls-tree -r?\n\n-- \nMartin Waitz\n"},{"id":"44071","messageId":"slrnf6al3s.4vk.csaba-ml@beastie.creo.hu","threadId":"8439","inReplyTo":"20070605114454.GI16637@admingilde.org","subject":"Re: git \"manifest\" command","fromName":"Csaba Henk","fromEmail":"csaba-ml@creo.hu","sentAt":"2007-06-05T12:18:05Z","receivedAt":"2007-06-05T12:18:05Z","isPatch":false,"sender":{"key":"csaba-ml@creo.hu","avatar":null},"body":"On 2007-06-05, Martin Waitz <tali@admingilde.org> wrote:\n> like git ls-tree -r?\n\nYes. I knew this functionality must be there somewehere...\n\nThanks.\n\nCsaba\n"},{"id":"44085","messageId":"20070605171108.GB21708@moooo.ath.cx","threadId":"8439","inReplyTo":"slrnf6al3s.4vk.csaba-ml@beastie.creo.hu","subject":"Re: git \"manifest\" command","fromName":"Matthias Lederhofer","fromEmail":"matled@gmx.net","sentAt":"2007-06-05T17:11:08Z","receivedAt":"2007-06-05T17:11:08Z","isPatch":false,"sender":{"key":"matled@gmx.net","avatar":null},"body":"Csaba Henk <csaba-ml@creo.hu> wrote:\n> On 2007-06-05, Martin Waitz <tali@admingilde.org> wrote:\n> > like git ls-tree -r?\n> \n> Yes. I knew this functionality must be there somewehere...\n\nIf you use this from a script note that ls-tree shows the subdirectory\nof a tree that corresponds to the current directory in the repository.\nThis one should always show the full tree:\n    $ git ls-tree --full-name -r HEAD $(git rev-parse --show-cdup)\n"}]}