{"thread":{"id":"14434","subject":"Q: How to tag individual files","startedAt":"2008-07-13T04:21:51Z","lastAt":"2008-07-13T10:20:47Z","messageCount":4,"participants":["Poojan Wagh","Shawn O. Pearce","Petr Baudis"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"83123","messageId":"g5bvte$52j$1@ger.gmane.org","threadId":"14434","inReplyTo":null,"subject":"Q: How to tag individual files","fromName":"Poojan Wagh","fromEmail":"poojanwagh@gmail.com","sentAt":"2008-07-13T04:21:51Z","receivedAt":"2008-07-13T04:21:51Z","isPatch":false,"sender":{"key":"poojanwagh@gmail.com","avatar":null},"body":"The crash course at: http://git.or.cz/course/svn.html says:\n\n> You usually tag commits but if you want, you can tag files (or trees, but that's a bit low-level) as well. \n\nI've done a bit of searching, and I can't for the life of me figure out \nhow to tag an individual file. Help from the group would be much \nappreciated. Thanks.\n\n--\nPoojan Wagh\nhttp://www.circuitdesign.info\n"},{"id":"83124","messageId":"20080713053537.GA32746@spearce.org","threadId":"14434","inReplyTo":"g5bvte$52j$1@ger.gmane.org","subject":"Re: Q: How to tag individual files","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-07-13T05:35:37Z","receivedAt":"2008-07-13T05:35:37Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Poojan Wagh <poojanwagh@gmail.com> wrote:\n> The crash course at: http://git.or.cz/course/svn.html says:\n>\n>> You usually tag commits but if you want, you can tag files (or trees, \n>> but that's a bit low-level) as well. \n>\n> I've done a bit of searching, and I can't for the life of me figure out  \n> how to tag an individual file. Help from the group would be much  \n> appreciated. Thanks.\n\nYou don't tag individual files.  Git is snapshot based.  You tag\nthe entire project at once.\n\nThe comment you quoted was talking about tagging a single listing of\nblobs (a tree) or a single blob (stream of bytes).  This can be handy\nin rare cases.  In the linux kernel for example the prior history\nwas stored by tagging the tree of that prior history, as there was\nno git based history preceeding that snapshot, so there were no\ncommits to tag.  In git.git Junio publishes his GnuPG public key\nas a tagged blob, making it available to validate signed tag objects.\n\nSo you can't tag individual files.  The comment is a bit misleading\nand gets far too low-level for an otherwise high-level conversion\nguide.\n\n-- \nShawn.\n"},{"id":"83126","messageId":"g5c6hs$glo$1@ger.gmane.org","threadId":"14434","inReplyTo":"20080713053537.GA32746@spearce.org","subject":"Re: Q: How to tag individual files","fromName":"Poojan Wagh","fromEmail":"poojanwagh@gmail.com","sentAt":"2008-07-13T06:14:51Z","receivedAt":"2008-07-13T06:14:51Z","isPatch":false,"sender":{"key":"poojanwagh@gmail.com","avatar":null},"body":"Thanks, Shawn, for the clarification. Your explanation--together with \nhttp://www.kernel.org/pub/software/scm/git/docs/user-manual.html#the-object-database-- \nmakes it clear.\n\nSo, to summarize (with the intent of fixing any misunderstanding on my \npart): You can tag the contents of files (blobs), but not files per se, \nbecause:\n1. Git doesn't store files as an object as such. It stores the contents \nof files (\"blobs\")\n2. Git stores directories (which define their constituent file names and \ncontents=>blobs) as \"tree\" objects. So, the association between a file's \nname and a its contents occurs in a tree object.\n\nOne thing I notice about this structure is that a tree object can at \nleast theoretically give me what I want: the ability to have files \norganized with labels (a la gmail) rather than folders--I would like to \nbe able to have a single file show up under many different labels rather \nthan mutually exclusive folders/directories. I know that this won't \nhappen automatically, but it's nice to know that I *could* do it if I \nwanted to.\n\nThanks!\n\nP.S. I also found http://www.gitcasts.com/posts/browsing-git-objects \nuseful for as illustration of all the object structure.\n\nShawn O. Pearce wrote:\n> Poojan Wagh <poojanwagh@gmail.com> wrote:\n>> The crash course at: http://git.or.cz/course/svn.html says:\n>>\n>>> You usually tag commits but if you want, you can tag files (or trees, \n>>> but that's a bit low-level) as well. \n>> I've done a bit of searching, and I can't for the life of me figure out  \n>> how to tag an individual file. Help from the group would be much  \n>> appreciated. Thanks.\n> \n> You don't tag individual files.  Git is snapshot based.  You tag\n> the entire project at once.\n> \n> The comment you quoted was talking about tagging a single listing of\n> blobs (a tree) or a single blob (stream of bytes).  This can be handy\n> in rare cases.  In the linux kernel for example the prior history\n> was stored by tagging the tree of that prior history, as there was\n> no git based history preceeding that snapshot, so there were no\n> commits to tag.  In git.git Junio publishes his GnuPG public key\n> as a tagged blob, making it available to validate signed tag objects.\n> \n> So you can't tag individual files.  The comment is a bit misleading\n> and gets far too low-level for an otherwise high-level conversion\n> guide.\n> \n"},{"id":"83133","messageId":"20080713102047.GH32184@machine.or.cz","threadId":"14434","inReplyTo":"20080713053537.GA32746@spearce.org","subject":"Re: Q: How to tag individual files","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2008-07-13T10:20:47Z","receivedAt":"2008-07-13T10:20:47Z","isPatch":false,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"  Hi,\n\nOn Sun, Jul 13, 2008 at 05:35:37AM +0000, Shawn O. Pearce wrote:\n> Poojan Wagh <poojanwagh@gmail.com> wrote:\n> > The crash course at: http://git.or.cz/course/svn.html says:\n> >\n> >> You usually tag commits but if you want, you can tag files (or trees, \n> >> but that's a bit low-level) as well. \n> >\n> > I've done a bit of searching, and I can't for the life of me figure out  \n> > how to tag an individual file. Help from the group would be much  \n> > appreciated. Thanks.\n..snip..\n> So you can't tag individual files.  The comment is a bit misleading\n> and gets far too low-level for an otherwise high-level conversion\n> guide.\n\n  I have tried to make this less misleading, thanks for noticing. I kept\nthe mention, though, because I think people should not be misled to\nthinking that only commits are tagged, and then get confused when they\nfirst meet v2.6.11.\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nGNU, n. An animal of South Africa, which in its domesticated state\nresembles a horse, a buffalo and a stag. In its wild condition it is\nsomething like a thunderbolt, an earthquake and a cyclone. -- A. Pierce\n"}]}