{"thread":{"id":"43167","subject":"Re: index manipulation quickref","startedAt":"2006-12-12T10:57:17Z","lastAt":"2006-12-12T21:32:15Z","messageCount":5,"participants":["Nguyen Thai Ngoc Duy","Junio C Hamano","Santi Béjar","Jakub Narebski"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"294336","messageId":"fcaeb9bf0612120257p35dc9483ob65eea9ae21b5f7b@mail.gmail.com","threadId":"43167","inReplyTo":null,"subject":"index manipulation quickref","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2006-12-12T10:57:17Z","receivedAt":"2006-12-12T10:57:17Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Hi,\n\nI'm trying to collect all operations related to index from user\nperspective and corresponding commands. The list may be put to git\nwiki if people think it can help newbies:\n\nupdate file content to index: git update-index file\nadd a file to index: git add file\ndelete a file from index: git update-index --remove --force-remove (or\nremove that file in workdir and do git update-index --remove)\nread a tree to index: git read-tree treeish, git reset treeish\nread a file from a tree to index: git ls-tree treeish file|git\nupdate-index --index-info --stdin\ncopy a file from index to workdir: git checkout-index file\nrefresh index: git update-index --refresh\ncopy entire index to workdir: git checkout-index\noutput a file from index to stdout: ?? (is there a command for this?)\nlist files in index: git ls-files\ncompare index and workdir file listing: git ls-files (with lots of options here)\ndiff between workdir and index: git diff\ndiff between index and a tree: git diff --cached treeish\n\nAm I missing any operation here?\n-- \n"},{"id":"296686","messageId":"elm2ur$3ib$1@sea.gmane.org","threadId":"43167","inReplyTo":"fcaeb9bf0612120257p35dc9483ob65eea9ae21b5f7b@mail.gmail.com","subject":"Re: index manipulation quickref","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-12-12T11:16:58Z","receivedAt":"2006-12-12T11:16:58Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Nguyen Thai Ngoc Duy wrote:\n\n> I'm trying to collect all operations related to index from user\n> perspective and corresponding commands. The list may be put to git\n> wiki if people think it can help newbies:\n> \n> update file content to index: git update-index file\nOr \"git add file\" woth new git.\n\n> add a file to index: git add file\n> delete a file from index: git update-index --remove --force-remove\n> (or remove that file in workdir and do git update-index --remove)\nOr \"git rm file\" (old version did remove only from index, new version\nis to remove also from working directory if it matches HEAD)\n\n> read a tree to index: git read-tree treeish, git reset treeish\n> read a file from a tree to index: git ls-tree <tree-ish> file|git\n> update-index --index-info --stdin\n> copy a file from index to workdir: git checkout-index file\nOr just \"git checkout -- file\"\n\n> refresh index: git update-index --refresh\n> copy entire index to workdir: git checkout-index\nOr just \"git checkout\"\n\n> output a file from index to stdout: ?? (is there a command for this?)\n\"git cat-file -p ::<filename>\"\n\n> list files in index: git ls-files\n> compare index and workdir file listing: \n>    git ls-files (with lots of options here) \n> diff between workdir and index: git diff\n> diff between index and a tree: git diff --cached <tree-ish>\n\ndiff between workdir and tree: git diff <tree-ish> \n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n\n"},{"id":"295778","messageId":"8aa486160612120328x2ab64c78v6a6d5bc2a64caf26@mail.gmail.com","threadId":"43167","inReplyTo":"fcaeb9bf0612120257p35dc9483ob65eea9ae21b5f7b@mail.gmail.com","subject":"Re: index manipulation quickref","fromName":"Santi Béjar","fromEmail":"sbejar@gmail.com","sentAt":"2006-12-12T11:28:07Z","receivedAt":"2006-12-12T11:28:07Z","isPatch":false,"sender":{"key":"santi@agolina.net","avatar":null},"body":"On 12/12/06, Nguyen Thai Ngoc Duy <pclouds@gmail.com> wrote:\n> Hi,\n>\n> I'm trying to collect all operations related to index from user\n> perspective and corresponding commands. The list may be put to git\n> wiki if people think it can help newbies:\n\nCool. But for \"index-newbies\" not \"git-newbies\" :)\n\nWe could add (if exists) the porcelain-ish equivalent as:\n\nupdate file content to index:\n  git update-index file\n  git add file (the development version)\n\nadd a file to index:\n  git update-index --add file\n  git add file\n\ndelete a file from index:\n  git update-index --remove [--force-remove] file\n  git rm file\n\nread a tree to index:\n  git read-tree treeish\n  git reset commit-ish # It changes also the HEAD\n\nread a file from a tree to index:\n  git ls-tree treeish file | git update-index --index-info --stdin\n  N/A\n\ncopy a file from index to workdir:\n  git checkout-index file\n  git checkout file\n\nrefresh index:\n  git update-index --refresh\n  git status # It does more things\n\ncopy entire index to workdir:\n  git checkout-index\n  git checkout -f\n\noutput a file from index to stdout:\n  git cat-file blob :file (or :n:file, where n=0,1,2,3 are the unmerged stage)\n  ??\n\nlist files in index:\n  git ls-files\n  ??\n\ncompare index and workdir file listing:\n  git ls-files (with lots of options here)\n  git status?\n\ndiff between workdir and index:\n  git diff-files\n  git diff\n\ndiff between index and a tree:\n  git diff-index --cached treeish\n  git diff --cached treeish\n\n"},{"id":"295187","messageId":"7vac1tvuyr.fsf@assigned-by-dhcp.cox.net","threadId":"43167","inReplyTo":"fcaeb9bf0612120257p35dc9483ob65eea9ae21b5f7b@mail.gmail.com","subject":"Re: index manipulation quickref","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-12-12T18:18:36Z","receivedAt":"2006-12-12T18:18:36Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Nguyen Thai Ngoc Duy\" <pclouds@gmail.com> writes:\n\n> I'm trying to collect all operations related to index from user\n> perspective and corresponding commands. The list may be put to git\n> wiki if people think it can help newbies:\n\nI think this goes in the wrong direction.  For \"newbies\" the\nPorcelain-ish set is supposed to be enough and if there is\nsomething missing that they need to do update-index command\nitself or a pipeline that involves update-index to achieve\ncommon tasks, we should enhance Porcelain-ish that captures the\npattern.\n\nI think quick-ref for Porcelain writers would not hurt, but they\nhave manuals.\n"},{"id":"293958","messageId":"fcaeb9bf0612121332m51dea9day2f18c80b94ff4d5d@mail.gmail.com","threadId":"43167","inReplyTo":"7vac1tvuyr.fsf@assigned-by-dhcp.cox.net","subject":"Re: index manipulation quickref","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2006-12-12T21:32:15Z","receivedAt":"2006-12-12T21:32:15Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On 12/13/06, Junio C Hamano <junkio@cox.net> wrote:\n> I think this goes in the wrong direction.  For \"newbies\" the\n> Porcelain-ish set is supposed to be enough and if there is\n> something missing that they need to do update-index command\n> itself or a pipeline that involves update-index to achieve\n> common tasks, we should enhance Porcelain-ish that captures the\n> pattern.\n\nIt is supposed to be porcelain command only. I figure what operation a\nuser may need when manipulating index, then find the corresponding\nporcelain command.\n\nAs you can see, we have porcelain commands for most of operations. The\nmissing piece is reset a file in index (and maybe \"git cat-file\n::file\" -- it's too cryptic). Hopefully \"git reset -- file\" will be\nimplemented soon.\n-- \n"}]}