{"thread":{"id":"421","subject":"Complete http-pull; where should it go?","startedAt":"2005-05-01T19:29:09Z","lastAt":"2005-05-02T02:43:00Z","messageCount":14,"participants":["Daniel Barkalow","Linus Torvalds","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"2309","messageId":"Pine.LNX.4.21.0505011508270.30848-100000@iabervon.org","threadId":"421","inReplyTo":null,"subject":"Complete http-pull; where should it go?","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2005-05-01T19:29:09Z","receivedAt":"2005-05-01T19:29:09Z","isPatch":false,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"I've been working on http-pull, and I've made it able to download the\ntarget commit from ...git/refs/<dir>/<name> (instead of making you figure\nit out yourself), and also write the target it looks up to your local\n.git/refs/<w-d>/<w-n> (which doesn't have to be at all related to the\nsource one. In fact, I just got the latest Linus tree with:\n\ngit-http-pull -t -w heads/linus heads/master \\\n  http://www.kernel.org/pub/scm/git/git.git/\ngit-read-tree $(cat .git/refs/heads/linus)\ngit-checkout-cache -a\ngit-update-cache --refresh\n\n(and I didn't get any of the history, although I could have if I wanted\nto; and I could get it now if I decided I needed it).\n\nMy question is, where does this belong? It's based on adding to the core\nas it has been the knowledge that .git/refs/*/* consists of hex-format\nhash files, both locally and on remote servers. I think this level of\ninformation belongs in the plumbing; at least, if people are to be able to\nuse different git-based systems to access the same repositories, they have\nto agree. And there seems to be that much agreement, and so it makes sense\nto make it part of the core.\n\n(For that matter, people seem to agree that refs/heads/ has heads, and\nrefs/heads/master is the one you want to pull if you don't know\notherwise; I didn't include this information at all)\n\n\t-Daniel\n*This .sig left intentionally blank*\n\n"},{"id":"2310","messageId":"Pine.LNX.4.58.0505011237410.2296@ppc970.osdl.org","threadId":"421","inReplyTo":"Pine.LNX.4.21.0505011508270.30848-100000@iabervon.org","subject":"Re: Complete http-pull; where should it go?","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-05-01T19:44:28Z","receivedAt":"2005-05-01T19:44:28Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Sun, 1 May 2005, Daniel Barkalow wrote:\n>\n> My question is, where does this belong? It's based on adding to the core\n> as it has been the knowledge that .git/refs/*/* consists of hex-format\n> hash files, both locally and on remote servers.\n\nSo the main reason I _don't_ like programs that automatically look up the \nrefs etc is that its' often simply WRONG.\n\nFor example, if I want to know what objects I have in my object directory \nthat are needed for a release, I want to be able to tell fsck to list the \nobjects that are extraneous for that release _regardless_ of the fact that \nI may have .git/refs/*/* files that point to other things.\n\nSo if fsck-cache automatically looks up references in .git/refs/ like in\none of your earlier patches, then instead of adding value to the program,\nyou actually _remove_ value from it by making it less flexible, and\nenforcing a world-view that is not necessarily the only view.\n\nThis is why I want the true _plumbing_ to not care about these things, and \nif you include references to trees, you _list_ them explicitly. \n\nAnd if you want to have a command that takes implied references, then just \nmake a script that does that for you, rather than making the core plumbing \nunderstand it.\n\nThis is a classic \"ease of use\" vs \"power-user\" issue. I'm very\nfundamentally of the opinion that power-users are good, and that ease of\nuse is done by having scripts that turn normal ops into \"power user\"  \noperations.\n\nThat's the unix way, really.\n\n\t\tLinus\n"},{"id":"2314","messageId":"Pine.LNX.4.21.0505011544120.30848-100000@iabervon.org","threadId":"421","inReplyTo":"Pine.LNX.4.58.0505011237410.2296@ppc970.osdl.org","subject":"Re: Complete http-pull; where should it go?","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2005-05-01T20:30:01Z","receivedAt":"2005-05-01T20:30:01Z","isPatch":false,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Sun, 1 May 2005, Linus Torvalds wrote:\n\n> For example, if I want to know what objects I have in my object directory \n> that are needed for a release, I want to be able to tell fsck to list the \n> objects that are extraneous for that release _regardless_ of the fact that \n> I may have .git/refs/*/* files that point to other things.\n>\n> So if fsck-cache automatically looks up references in .git/refs/ like in\n> one of your earlier patches, then instead of adding value to the program,\n> you actually _remove_ value from it by making it less flexible, and\n> enforcing a world-view that is not necessarily the only view.\n\nIt's true that you might not want to include all of the refs; but doesn't\nit make more sense to support the standard arrangement of refs (i.e.,\nthey're in .git/refs/kind/name) for the ones you want to include, rather\nthan having to pull out the hex to pass in yourself?\n\n> This is why I want the true _plumbing_ to not care about these things, and \n> if you include references to trees, you _list_ them explicitly. \n\nRight; what I want to make programs able to do is take explicit\nreferences, instead of only taking the objects they reference. So you say\nheads/master or heads/linus instead of\n\"198b0fb635ed8a007bac0c16eab112c5e2c7995c\".\n\nThe part that makes this important is that the user may be trying to look\nup a reference on a remote machine using the same connection that the\nobjects will come over, and this is impractical without having the program\nknow how to handle reference files.\n\n> And if you want to have a command that takes implied references, then just \n> make a script that does that for you, rather than making the core plumbing \n> understand it.\n\nAgreed; which references to use are up to either the power user or the\nscript, not the core. I'm just interested in having a core implementation\nfor using them when specified.\n\n\t-Daniel\n*This .sig left intentionally blank*\n\n"},{"id":"2317","messageId":"Pine.LNX.4.58.0505011337070.2296@ppc970.osdl.org","threadId":"421","inReplyTo":"Pine.LNX.4.21.0505011544120.30848-100000@iabervon.org","subject":"Re: Complete http-pull; where should it go?","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-05-01T20:46:37Z","receivedAt":"2005-05-01T20:46:37Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Sun, 1 May 2005, Daniel Barkalow wrote:\n> \n> Right; what I want to make programs able to do is take explicit\n> references, instead of only taking the objects they reference. So you\n> say heads/master or heads/linus instead of\n> \"198b0fb635ed8a007bac0c16eab112c5e2c7995c\".\n\nThat's fine. \n\nThis is really just an issue of havign a function that does \"get_sha1()\", \nand then making the things that take command line arguments use that \none instead of \"get_sha1_hex()\".\n\nThen you can have rules like:\n - if it's a hex number, take it\n - if it's a filename,  look it up\n - if \".git/refs + str is a filename, look it up.\n\nSomething like\n\n\tint get_sha1(char *str, unsigned char *result)\n\t{\n\t\tstatic char pathname[PATH_MAX];\n\n\t\tif (get_sha1_hex(str, result) == 0)\n\t\t\treturn 0;\n\t\tif (get_sha1_file(str, result) == 0)\n\t\t\treturn 0;\n\t\tsnprintf(pathname, sizeof(pathname), \".git/refs/%s\", str);\n\t\tif (get_sha1_file(pathname, result) == 0)\n\t\t\treturn 0;\n\t\t...\n\t}\n\nwhere you have\n\n\tint get_sha1_file(char *path, unsigned char *result)\n\t{\n\t\tchar buffer[60];\n\t\tint fd = open(path, O_RDONLY);\n\t\tint len;\n\n\t\tif (fd < 0)\n\t\t\treturn -1;\n\t\tlen = read(fd, buffer, sizeof(buffer));\n\t\tclose(fd);\n\t\tif (len < 40)\n\t\t\treturn -1;\n\t\treturn get_sha1_hex(buffer, result);\n\t}\n\t\t\t\nor whatever.\n\nThe _only_ thing I want to be careful about is that all the _internal_\nstuff still have to use the strict \"get_sha1_hex()\" function, ie we should\nnever _ever_ accept a tree object where the \"sha1\" ends up being anything\nbut the hex thing. So this \"generalized get_sha1()\" would have to be used \nonly on real user input (ie argv[] array and the like).\n\n\t\tLinus\n"},{"id":"2325","messageId":"Pine.LNX.4.21.0505011656270.30848-100000@iabervon.org","threadId":"421","inReplyTo":"Pine.LNX.4.58.0505011337070.2296@ppc970.osdl.org","subject":"Re: Complete http-pull; where should it go?","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2005-05-01T21:25:06Z","receivedAt":"2005-05-01T21:25:06Z","isPatch":false,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Sun, 1 May 2005, Linus Torvalds wrote:\n\n> On Sun, 1 May 2005, Daniel Barkalow wrote:\n> > \n> > Right; what I want to make programs able to do is take explicit\n> > references, instead of only taking the objects they reference. So you\n> > say heads/master or heads/linus instead of\n> > \"198b0fb635ed8a007bac0c16eab112c5e2c7995c\".\n> \n> That's fine. \n> \n> This is really just an issue of havign a function that does \"get_sha1()\", \n> and then making the things that take command line arguments use that \n> one instead of \"get_sha1_hex()\".\n\nI added a get_ref_sha1() that just does the .git/refs/ case; I think that\nmost things that want to accept various forms will also want to know what\nform they got and do something with it, so get_sha1() isn't a big win.\n\nThe biggest thing so far is actually writing the references when the user\nhas specified where to write them, and I wanted to restrict that to a\ntarget of the right format.\n\n> The _only_ thing I want to be careful about is that all the _internal_\n> stuff still have to use the strict \"get_sha1_hex()\" function, ie we should\n> never _ever_ accept a tree object where the \"sha1\" ends up being anything\n> but the hex thing. So this \"generalized get_sha1()\" would have to be used \n> only on real user input (ie argv[] array and the like).\n\nAgreed.\n\n\t-Daniel\n*This .sig left intentionally blank*\n\n"},{"id":"2319","messageId":"7voebuskob.fsf@assigned-by-dhcp.cox.net","threadId":"421","inReplyTo":"Pine.LNX.4.58.0505011337070.2296@ppc970.osdl.org","subject":"Re: Complete http-pull; where should it go?","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-05-01T21:25:40Z","receivedAt":"2005-05-01T21:25:40Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":">>>>> \"LT\" == Linus Torvalds <torvalds@osdl.org> writes:\n\nLT> On Sun, 1 May 2005, Daniel Barkalow wrote:\n>> \n>> Right; what I want to make programs able to do is take explicit\n>> references, instead of only taking the objects they reference. So you\n>> say heads/master or heads/linus instead of\n>> \"198b0fb635ed8a007bac0c16eab112c5e2c7995c\".\n\nLT> That's fine. \n\nLT> This is really just an issue of havign a function that does \"get_sha1()\", \nLT> and then making the things that take command line arguments use that \nLT> one instead of \"get_sha1_hex()\".\n\nLT> Then you can have rules like:\nLT>  - if it's a hex number, take it\nLT>  - if it's a filename,  look it up\nLT>  - if \".git/refs + str is a filename, look it up.\n\nLT> The _only_ thing I want to be careful about is that all the _internal_\nLT> stuff still have to use the strict \"get_sha1_hex()\" function, ie we should\nLT> never _ever_ accept a tree object where the \"sha1\" ends up being anything\nLT> but the hex thing. So this \"generalized get_sha1()\" would have to be used \nLT> only on real user input (ie argv[] array and the like).\n\nI agree with Linus.  Dan, you are welcome to lift the code from\nthe find-in-vicinity() function in jit-util.c in my JIT toolset,\nfound at http://members.cox.net/junkio/.\n\n"},{"id":"2332","messageId":"Pine.LNX.4.58.0505011616230.22864@ppc970.osdl.org","threadId":"421","inReplyTo":"Pine.LNX.4.21.0505011656270.30848-100000@iabervon.org","subject":"Re: Complete http-pull; where should it go?","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-05-01T23:23:58Z","receivedAt":"2005-05-01T23:23:58Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Sun, 1 May 2005, Daniel Barkalow wrote:\n> \n> I added a get_ref_sha1() that just does the .git/refs/ case; I think that\n> most things that want to accept various forms will also want to know what\n> form they got and do something with it, so get_sha1() isn't a big win.\n\nI really really disagree.\n\nFor example, take something like \"git-diff-cache\". I think it's a big\nbonus if you can just write\n\n\tgit-diff-cache HEAD\n\nand it will pick up the sha1 ID from .git/HEAD. \n\nIn general, I think a \"get_sha1()\" that tries as many user-friendly things \nas possible is good for the command line. Within reason. I really don't \nlike the \"try to autocomplete a partial sha1\" thing, but I wouldn't at all \nmind having various helpers like\n\n\tgit-diff-tree HEAD.p1 HEAD\n\nwhere the \".p1\" would just make it look up the first parent of the thing \nin HEAD (which in turn would mean \"look up the sha1 from the .git/HEAD \nfile\".\n\nMany of these are really easy to do, and I think most people would tend to \nprefer having the choice.\n\n\t\tLinus\n"},{"id":"2334","messageId":"Pine.LNX.4.21.0505011923110.30848-100000@iabervon.org","threadId":"421","inReplyTo":"Pine.LNX.4.58.0505011616230.22864@ppc970.osdl.org","subject":"Re: Complete http-pull; where should it go?","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2005-05-01T23:46:09Z","receivedAt":"2005-05-01T23:46:09Z","isPatch":false,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Sun, 1 May 2005, Linus Torvalds wrote:\n\n> On Sun, 1 May 2005, Daniel Barkalow wrote:\n> > \n> > I added a get_ref_sha1() that just does the .git/refs/ case; I think that\n> > most things that want to accept various forms will also want to know what\n> > form they got and do something with it, so get_sha1() isn't a big win.\n> \n> I really really disagree.\n> \n> For example, take something like \"git-diff-cache\". I think it's a big\n> bonus if you can just write\n> \n> \tgit-diff-cache HEAD\n> \n> and it will pick up the sha1 ID from .git/HEAD. \n\nTrue, but with -p, you'd probably want to give lines like\n\n--- HEAD/Makefile\n+++ (cache)/Makefile\n\nwhen it's not just hex (and \"linus/Makefile\" for heads/linus, not\n\"heads/linus/Makefile\", which would break things). I think it's generally\nbest to call each of the things in the list to try and not only use the\nfirst one that understands, but also do program-specific special things\ndepending on which one that was.\n\n> In general, I think a \"get_sha1()\" that tries as many user-friendly things \n> as possible is good for the command line. Within reason. I really don't \n> like the \"try to autocomplete a partial sha1\" thing, but I wouldn't at all \n> mind having various helpers like\n> \n> \tgit-diff-tree HEAD.p1 HEAD\n> \n> where the \".p1\" would just make it look up the first parent of the thing \n> in HEAD (which in turn would mean \"look up the sha1 from the .git/HEAD \n> file\".\n\nMaybe :p1, to use characters that aren't frequently in filenames?\n\n> Many of these are really easy to do, and I think most people would tend to \n> prefer having the choice.\n\nI agree with that, but I'm not sure how useful having one function that\njust looks up the sha1 without further reporting is. In any case, it's an\neasy addition, and it's plausible that similar functions would work for\nany similar information needed.\n\n\t-Daniel\n*This .sig left intentionally blank*\n\n"},{"id":"2333","messageId":"Pine.LNX.4.58.0505011638370.22864@ppc970.osdl.org","threadId":"421","inReplyTo":"Pine.LNX.4.58.0505011616230.22864@ppc970.osdl.org","subject":"Re: Complete http-pull; where should it go?","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-05-01T23:48:04Z","receivedAt":"2005-05-01T23:48:04Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Sun, 1 May 2005, Linus Torvalds wrote:\n> \n> For example, take something like \"git-diff-cache\". I think it's a big\n> bonus if you can just write\n> \n> \tgit-diff-cache HEAD\n> \n> and it will pick up the sha1 ID from .git/HEAD. \n\nOk, I just committed this. Almost all commands that take SHA1 strings from \nthe command line can now use the shortened format. \n\nRight now it only does the \"filename\" version, and it tries to append \n\".git/\" to it if it doesn't work, so you can do\n\n\tgit-diff-cache HEAD\n\nor something like that if you want to. Where \".git/HEAD\" would also have\nworked, or \".git/refs/heads/master\" (or just \"refs/heads/master\").\n\nFor example, if you have a refs/tags directory which has been populated \nwith files that point to the tags, you can do\n\n\tgit-diff-tree -p refs/tags/v2.6.12-rc3 HEAD\n\nand it will do exactly what you'd expect it to do.\n\nI didn't do the \".p1\" for parent thing. It would be easy to add, I just \nhaven't decided on a nice syntax for it (I'd like something that is nice \nand doesn't need quoting, but the \".p1\" seems a bit _too_ ugly).\n\n\t\t\tLinus\n"},{"id":"2338","messageId":"7vsm16qyia.fsf@assigned-by-dhcp.cox.net","threadId":"421","inReplyTo":"Pine.LNX.4.58.0505011638370.22864@ppc970.osdl.org","subject":"Re: Complete http-pull; where should it go?","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-05-02T00:09:49Z","receivedAt":"2005-05-02T00:09:49Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":">>>>> \"LT\" == Linus Torvalds <torvalds@osdl.org> writes:\n\nLT> I didn't do the \".p1\" for parent thing. It would be easy to add, I just \nLT> haven't decided on a nice syntax for it (I'd like something that is nice \nLT> and doesn't need quoting, but the \".p1\" seems a bit _too_ ugly).\n\nShameless plug but could you take a look at how my JIT does it,\nat <http://members.cox.net/junkio/JITNotes.txt>, especially\nscroll down to near the bottom \"Syntax to naming a snapshot or a\ncommit\" section?\n\nI still think this kind of thing belongs to Porcelain not\nPlumbing, though.\n\n"},{"id":"2346","messageId":"Pine.LNX.4.58.0505011840590.2162@ppc970.osdl.org","threadId":"421","inReplyTo":"7vsm16qyia.fsf@assigned-by-dhcp.cox.net","subject":"Re: Complete http-pull; where should it go?","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-05-02T01:50:13Z","receivedAt":"2005-05-02T01:50:13Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Sun, 1 May 2005, Junio C Hamano wrote:\n>\n> Shameless plug but could you take a look at how my JIT does it,\n> at <http://members.cox.net/junkio/JITNotes.txt>, especially\n> scroll down to near the bottom \"Syntax to naming a snapshot or a\n> commit\" section?\n\nHmm.. I actually implemented it, because it's simple to implement, but now \nthat I've tried using it, I just find it to be too much like line noise to \ndo\n\n\tgit-diff-tree -p 0-HEAD HEAD\n\nfor \"parent to current\". The notation \"-HEAD\" also works, but since that\nlooks like a command line flag, it's usually not useful, except when\ncombined with other stuff, ie \"0---HEAD\" is \"three parents up\".\n\n> I still think this kind of thing belongs to Porcelain not\n> Plumbing, though.\n\nI don't entirely disagree, and I suspect that Porcelain ends up using the \npure hex numbers which are always unambiguous.\n\nThat said, I end up still using the raw plumbing, so it's actually nice to \nhave some simple shorthand. I just don't know if the parent thing ends up \nbeing all that useful.\n\nAnyway, it's there. I don't love the parent syntax, but on the other hand,\nI don't know how often I'd even end up using it (while the tag and HEAD\nnames are _very_ useful), so maybe it just doesn't matter.\n\n\t\tLinus\n"},{"id":"2347","messageId":"7v4qdmqt8v.fsf@assigned-by-dhcp.cox.net","threadId":"421","inReplyTo":"Pine.LNX.4.58.0505011840590.2162@ppc970.osdl.org","subject":"Re: Complete http-pull; where should it go?","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-05-02T02:03:28Z","receivedAt":"2005-05-02T02:03:28Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":">>>>> \"LT\" == Linus Torvalds <torvalds@osdl.org> writes:\n\nLT> Hmm.. I actually implemented it, because it's simple to\nLT> implement, but now that I've tried using it, I just find it\nLT> to be too much like line noise to do\n\nLT> \tgit-diff-tree -p 0-HEAD HEAD\n\nLT> for \"parent to current\". The notation \"-HEAD\" also works,\nLT> but since that looks like a command line flag, it's usually\nLT> not useful, except when combined with other stuff, ie\nLT> \"0---HEAD\" is \"three parents up\".\n\nThat's why I said I do not think this belongs to the Plumbing.\n\nJIT command-line would do just \"jit-diff\" to get the diff\nbetween the work tree and the commit (or snapshot) it is based\nupon, without parameter.  Fully spelled out, it would be\n\"jit-diff -1:1\".  This kind of syntax, although is quite useful\nin JIT context (e.g. saying \"jit-patch --2\" to mean \"apply\nchanges between snnapshot 2 and two parents up of it to my\ncurrent work tree\"), I tend to agree that it is a bit too weird\nfor the core Plumbing layer, for which Unixy syntax is more\nsuitable.\n\n"},{"id":"2348","messageId":"Pine.LNX.4.21.0505012205590.30848-100000@iabervon.org","threadId":"421","inReplyTo":"Pine.LNX.4.58.0505011840590.2162@ppc970.osdl.org","subject":"Re: Complete http-pull; where should it go?","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2005-05-02T02:31:33Z","receivedAt":"2005-05-02T02:31:33Z","isPatch":false,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Sun, 1 May 2005, Linus Torvalds wrote:\n\n> That said, I end up still using the raw plumbing, so it's actually nice to \n> have some simple shorthand. I just don't know if the parent thing ends up \n> being all that useful.\n\nI still prefer having get_sha1() handle just hex, refs, and files in\n.git. Actually, just having it handle hex would probably be sufficient,\nsince the Porcelain can patch it cleanly with whatever is locally useful.\n\nAny thoughts on my patches, which actually barely overlap with this\nfunctionality?\n\n\t-Daniel\n*This .sig left intentionally blank*\n\n"},{"id":"2349","messageId":"Pine.LNX.4.58.0505011932220.2162@ppc970.osdl.org","threadId":"421","inReplyTo":"7v4qdmqt8v.fsf@assigned-by-dhcp.cox.net","subject":"Re: Complete http-pull; where should it go?","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-05-02T02:43:00Z","receivedAt":"2005-05-02T02:43:00Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Sun, 1 May 2005, Junio C Hamano wrote:\n> \n> That's why I said I do not think this belongs to the Plumbing.\n\nI've removed the ugly parent format, but to make it easier to script the \nthing I removed, I just pushed out an improvement to \"cat-file\" which \nmakes it use the \"read_object_with_reference()\" helper to cat the object.\n\nThat means that if you use \"git-cat-file tree\" on a tag object, then it\nwill first look up the tag object, then the commit object and finally the\ntree obejct, and it will cat that tree object. Of course, normally you'd\nuse it with a \"commit\" object and get the pleasure of having it \"just\nwork\" with tags too.\n\nSo for example, to get the parent of a commit (whether a tag that points\nto a commit, or a real commit), you'd script something like\n\n\tgit-cat-file commit v2.6.12-rc3 | sed -n '/^parent /{s/parent //;p;q}'\n\nwhich gets the first parent of the commit that was pointed to by the \n\"v2.6.12-rc3\" tag.\n\nIf you want to see the tag itself, you'd just do\n\n\tgit-cat-file tag v2.6.12-rc3\n\nlike before, of course.\n\nAnd \"git-cat-file -t\" always gives the top-level tag, so if you ask the \ntype of \"v2.6.12-rc3\" it will say \"tag\".\n\n\t\t\tLinus\n"}]}