{"thread":{"id":"4504","subject":"Porcelain specific metadata under .git?","startedAt":"2006-06-14T06:22:40Z","lastAt":"2006-06-17T00:43:18Z","messageCount":6,"participants":["Shawn Pearce","Andreas Ericsson","Jakub Narebski","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"21768","messageId":"20060614062240.GA13886@spearce.org","threadId":"4504","inReplyTo":null,"subject":"Porcelain specific metadata under .git?","fromName":"Shawn Pearce","fromEmail":"spearce@spearce.org","sentAt":"2006-06-14T06:22:40Z","receivedAt":"2006-06-14T06:22:40Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"So I'm reaching a point with my Eclipse plugin[*1*] where its\nactually doing something with a GIT repository and I want to store a\nref (to a tree, not a commit) under .git/refs/eclipse-workspaces to\nhelp the plugin cache state between workbench restarts.  But there\ndoesn't really seem to be any policy to what paths under .git are\navailable for Porcelain and what definately should be off-limits.\n\nI already assume/know that refs/heads and refs/tags are completely\noff-limits as they are for user refs only.\n\nI also think the core GIT tools already assume that anything\ndirectly under .git which is strictly a file and which is named\nentirely with uppercase letters (aside from \"HEAD\") is strictly a\ntemporary/short-lived state type item (e.g. COMMIT_MSG) used by a\nPorcelain.\n\nBut is saying \".git/refs/eclipse-workspaces\" is probably able to\nbe used for this purpose safe?  :-)\n\n\n[*1*] The Eclipse plugin is getting close to something that is worth\nreleasing as an early alpha for other developers.  I think I finally\nfound the last bug in the pack reading code and am now working on the\nbasic operations (add/remove/commit/status).  I hope to have all of\nthat working within a few days, at which point I'll publish/announce\na public GIT repository with the complete source code and an Eclipse\nupdate site for those brave souls who might want to just install it.\n\n-- \nShawn.\n"},{"id":"21778","messageId":"448FEED7.30701@op5.se","threadId":"4504","inReplyTo":"20060614062240.GA13886@spearce.org","subject":"Re: Porcelain specific metadata under .git?","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2006-06-14T11:11:19Z","receivedAt":"2006-06-14T11:11:19Z","isPatch":false,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"Shawn Pearce wrote:\n> \n> I already assume/know that refs/heads and refs/tags are completely\n> off-limits as they are for user refs only.\n> \n> I also think the core GIT tools already assume that anything\n> directly under .git which is strictly a file and which is named\n> entirely with uppercase letters (aside from \"HEAD\") is strictly a\n> temporary/short-lived state type item (e.g. COMMIT_MSG) used by a\n> Porcelain.\n> \n> But is saying \".git/refs/eclipse-workspaces\" is probably able to\n> be used for this purpose safe?  :-)\n> \n\n.git/eclipse/whatever-you-like\n\nwould probably be better. Heads can be stored directly under .git/refs \ntoo. Most likely, nothing will ever be stored under ./git/eclipse by \neither core git or the current (other) porcelains though.\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n"},{"id":"21779","messageId":"e6os3v$r5g$1@sea.gmane.org","threadId":"4504","inReplyTo":"448FEED7.30701@op5.se","subject":"Re: Porcelain specific metadata under .git?","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-06-14T11:32:25Z","receivedAt":"2006-06-14T11:32:25Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Andreas Ericsson wrote:\n\n> Shawn Pearce wrote:\n>> \n>> I already assume/know that refs/heads and refs/tags are completely\n>> off-limits as they are for user refs only.\n>> \n>> I also think the core GIT tools already assume that anything\n>> directly under .git which is strictly a file and which is named\n>> entirely with uppercase letters (aside from \"HEAD\") is strictly a\n>> temporary/short-lived state type item (e.g. COMMIT_MSG) used by a\n>> Porcelain.\n>> \n>> But is saying \".git/refs/eclipse-workspaces\" is probably able to\n>> be used for this purpose safe?  :-)\n>> \n> \n> .git/eclipse/whatever-you-like\n> \n> would probably be better. Heads can be stored directly under .git/refs \n> too. Most likely, nothing will ever be stored under ./git/eclipse by \n> either core git or the current (other) porcelains though.\n\nI think if it is a ref, which one wants to be visible to git-fsck (and\ngit-prune), it should be under .git/refs.\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"21782","messageId":"44900A2F.7050704@op5.se","threadId":"4504","inReplyTo":"e6os3v$r5g$1@sea.gmane.org","subject":"Re: Porcelain specific metadata under .git?","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2006-06-14T13:07:59Z","receivedAt":"2006-06-14T13:07:59Z","isPatch":false,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"Jakub Narebski wrote:\n> Andreas Ericsson wrote:\n> \n> \n>>Shawn Pearce wrote:\n>>\n>>>I already assume/know that refs/heads and refs/tags are completely\n>>>off-limits as they are for user refs only.\n>>>\n>>>I also think the core GIT tools already assume that anything\n>>>directly under .git which is strictly a file and which is named\n>>>entirely with uppercase letters (aside from \"HEAD\") is strictly a\n>>>temporary/short-lived state type item (e.g. COMMIT_MSG) used by a\n>>>Porcelain.\n>>>\n>>>But is saying \".git/refs/eclipse-workspaces\" is probably able to\n>>>be used for this purpose safe?  :-)\n>>>\n>>\n>>.git/eclipse/whatever-you-like\n>>\n>>would probably be better. Heads can be stored directly under .git/refs \n>>too. Most likely, nothing will ever be stored under ./git/eclipse by \n>>either core git or the current (other) porcelains though.\n> \n> \n> I think if it is a ref, which one wants to be visible to git-fsck (and\n> git-prune), it should be under .git/refs.\n> \n\nYes, but I understood him to mean \"it's a tree-sha\" instead of a \nbranch/head thing, which would mean it doesn't fit the .git/refs \ndefinition of ref.\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n"},{"id":"21784","messageId":"7vpshbeug6.fsf@assigned-by-dhcp.cox.net","threadId":"4504","inReplyTo":"44900A2F.7050704@op5.se","subject":"Re: Porcelain specific metadata under .git?","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-06-14T13:30:01Z","receivedAt":"2006-06-14T13:30:01Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Andreas Ericsson <ae@op5.se> writes:\n\n> Yes, but I understood him to mean \"it's a tree-sha\" instead of a\n> branch/head thing, which would mean it doesn't fit the .git/refs\n> definition of ref.\n\nI am not sure what you meant by \"it's a tree-sha\", but if you\nhave an impression that .git/refs define \"ref\" as committish,\nyou are mistaken.  Linus has .git/refs/tags/v2.6.11-tree which\ntags a tree object.  I even have a .git/refs/tags/junio-gpg-pub\nwhich tags a blob (blobish ;-> ?).\n"},{"id":"21929","messageId":"20060617004318.GB25292@spearce.org","threadId":"4504","inReplyTo":"44900A2F.7050704@op5.se","subject":"Re: Porcelain specific metadata under .git?","fromName":"Shawn Pearce","fromEmail":"spearce@spearce.org","sentAt":"2006-06-17T00:43:18Z","receivedAt":"2006-06-17T00:43:18Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Andreas Ericsson <ae@op5.se> wrote:\n> Jakub Narebski wrote:\n> >Andreas Ericsson wrote:\n> >\n> >\n> >>Shawn Pearce wrote:\n> >>\n> >>>I already assume/know that refs/heads and refs/tags are completely\n> >>>off-limits as they are for user refs only.\n> >>>\n> >>>I also think the core GIT tools already assume that anything\n> >>>directly under .git which is strictly a file and which is named\n> >>>entirely with uppercase letters (aside from \"HEAD\") is strictly a\n> >>>temporary/short-lived state type item (e.g. COMMIT_MSG) used by a\n> >>>Porcelain.\n> >>>\n> >>>But is saying \".git/refs/eclipse-workspaces\" is probably able to\n> >>>be used for this purpose safe?  :-)\n> >>>\n> >>\n> >>.git/eclipse/whatever-you-like\n> >>\n> >>would probably be better. Heads can be stored directly under .git/refs \n> >>too. Most likely, nothing will ever be stored under ./git/eclipse by \n> >>either core git or the current (other) porcelains though.\n> >\n> >\n> >I think if it is a ref, which one wants to be visible to git-fsck (and\n> >git-prune), it should be under .git/refs.\n> >\n> \n> Yes, but I understood him to mean \"it's a tree-sha\" instead of a \n> branch/head thing, which would mean it doesn't fit the .git/refs \n> definition of ref.\n\nSorry for the late response to this but I've been busy with real\nwork for the past few days and have not been able to get around to\nfun work. :-)\n\n\nYes, its a tree-sha.  There's no point in generating a commit for\nthis tree as it is serving a purpose similar to the index in core\nGIT.  It is a tree which represents the current directory state,\nor something recently near to it anyway.  Not enough information\nexists to warrant building a commit however, nor is there really\nany suitable parent for such a commit.  Ditto with a tag.\n\nI'm planning on periodically performing a write-tree of the current\nworking directory whenever Eclipse has notified the team provider of\ntracked resources being modified, with the write-tree occuring no\nmore frequently then a user set threshold, or whenever the project\nis closed or the workbench is shutdown.\n\nI figure that if the user hasn't re-modified an already \"known to\nbe changed\" (due to different stat data) file in the last 5 minutes\nand we haven't written a tree out (for any reason) in the last 15\nminutes then maybe we should generate a tree right now as the user\nis likely to commit one soon.  Generating a tree in the background\non a low priority thread while the user is busy thinking will make\ncommits \"go faster\", especially if all I need to do is generate the\ncommit object itself as the tree is already made.  :-)\n\nIt also just makes things easier, as I need the diff-tree code\nanyway so making use of that to also track the working directory\njust seems to make sense.\n\nI want it under .git/refs as I don't really want my in progress\ntree to go away due to a prune issued by the user.  At least not\nuntil I have a different tree stored there anyway.\n\n\nSo I'm going to store them under .git/refs/eclipse/some-path.\n\n-- \nShawn.\n"}]}