{"thread":{"id":"25437","subject":"[RFC] Hidden refs","startedAt":"2010-10-13T15:22:11Z","lastAt":"2010-10-13T17:53:39Z","messageCount":8,"participants":["Marc Branchaud","Stephen Bash","Jeff King","Junio C Hamano","Jonathan Nieder"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"153405","messageId":"4CB5CEA3.8020702@xiplink.com","threadId":"25437","inReplyTo":null,"subject":"[RFC] Hidden refs","fromName":"Marc Branchaud","fromEmail":"marcnarc@xiplink.com","sentAt":"2010-10-13T15:22:11Z","receivedAt":"2010-10-13T15:22:11Z","isPatch":false,"sender":{"key":"marcnarc@xiplink.com","avatar":"https://avatars.githubusercontent.com/u/14980203?v=4"},"body":"Hi all,\n\nWe want to have our build system record, in our repo, which commits\ncorrespond to which builds.\n\nNominally, this is a job for tags.  But we don't want to have to look at\nthese tags all the time.  We particularly just want to tag the repo when we\nmake an actual release -- tags are a Big Deal for us.\n\nNotes are an option, though they feel a bit heavy for this application.  And\nalthough we can store the build notes in their own refspace, it would (I\nbelieve) be a little clunky to make commands like checkout and log work with\nthe commits that were noted by the build system.\n\nIt struck me that it would be neat to have hidden refs in the refs/\ndirectory.  I experimented a bit with a \"refs/.builds\" directory:\n\n* \"git update-ref refs/.builds/One\" fails with \"Cannot lock the\n  ref 'refs/.builds/One'.\"  So I created a ref the regular way\n  (refs/blah/One) and copied the \"One\" file into refs/.builds/.\n\n* Commands like show, checkout, and log all worked fine with\n  \"refs/.builds/One\"\n\n* \"git show-ref\" ignores the entries in refs/.builds/.\n\n* So the .builds/ refs don't show up in gitk -- yay!\n\n* \"git push origin +refs/.builds/One fails with \"remote part of refspec is\nnot a valid name in +refs/.builds/One\".\n\n* Completion in bash doesn't work with entries in refs/.builds/.\n\nSo I'm wondering if it makes sense to properly support hidden directories in\nrefs/, and what it would take to do so.  (I image, for example, that things\nwould behave quite differently on Windows...)\n\nThoughts?\n\n\t\tM.\n"},{"id":"153406","messageId":"3305459.485811.1286983945370.JavaMail.root@mail.hq.genarts.com","threadId":"25437","inReplyTo":"4CB5CEA3.8020702@xiplink.com","subject":"Re: [RFC] Hidden refs","fromName":"Stephen Bash","fromEmail":"bash@genarts.com","sentAt":"2010-10-13T15:32:25Z","receivedAt":"2010-10-13T15:32:25Z","isPatch":false,"sender":{"key":"bash@genarts.com","avatar":null},"body":"> So I'm wondering if it makes sense to properly support hidden\n> directories in\n> refs/, and what it would take to do so. (I image, for example, that\n> things\n> would behave quite differently on Windows...)\n> \n> Thoughts?\n\nWe currently use refs/hidden/heads and refs/hidden/tags for hidden refs.  It does require calling 'gitk --branches --tags' rather than 'gitk --all', but otherwise I like the behavior (git branch only lists refs/heads, git tag only lists ref/tags).  And they never get cloned by default (they can still be fetched when needed).\n\nStephen\n"},{"id":"153409","messageId":"4CB5DAC8.7000004@xiplink.com","threadId":"25437","inReplyTo":"3305459.485811.1286983945370.JavaMail.root@mail.hq.genarts.com","subject":"Re: [RFC] Hidden refs","fromName":"Marc Branchaud","fromEmail":"marcnarc@xiplink.com","sentAt":"2010-10-13T16:14:00Z","receivedAt":"2010-10-13T16:14:00Z","isPatch":false,"sender":{"key":"marcnarc@xiplink.com","avatar":"https://avatars.githubusercontent.com/u/14980203?v=4"},"body":"On 10-10-13 11:32 AM, Stephen Bash wrote:\n>> So I'm wondering if it makes sense to properly support hidden \n>> directories in refs/, and what it would take to do so. (I image, for\n>> example, that things would behave quite differently on Windows...)\n>> \n>> Thoughts?\n> \n> We currently use refs/hidden/heads and refs/hidden/tags for hidden refs.\n> It does require calling 'gitk --branches --tags' rather than 'gitk --all',\n> but otherwise I like the behavior (git branch only lists refs/heads, git\n> tag only lists ref/tags).  And they never get cloned by default (they can\n> still be fetched when needed).\n\nHmm, maybe I'm just over-designing.\n\nIt's true that we could just use refs/builds (instead of .builds) and that\nthose refs would need to be explicitly retrieved by anyone who wanted to see\nthem (which is fine).  And after the builds/ refs are fetched and done with,\nit's easy enough to get rid of them with a simple \"rm -r .git/refs/builds\"\n\nIt appears all I'm looking for is a way to avoid that rm command.  Seems a\nbit silly in the end.\n\nThanks for the perspective!\n\n\t\tM.\n"},{"id":"153414","messageId":"20101013173555.GA13188@sigill.intra.peff.net","threadId":"25437","inReplyTo":"4CB5CEA3.8020702@xiplink.com","subject":"Re: [RFC] Hidden refs","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2010-10-13T17:35:55Z","receivedAt":"2010-10-13T17:35:55Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Oct 13, 2010 at 11:22:11AM -0400, Marc Branchaud wrote:\n\n> We want to have our build system record, in our repo, which commits\n> correspond to which builds.\n> \n> Nominally, this is a job for tags.  But we don't want to have to look at\n> these tags all the time.  We particularly just want to tag the repo when we\n> make an actual release -- tags are a Big Deal for us.\n> \n> Notes are an option, though they feel a bit heavy for this application.  And\n> although we can store the build notes in their own refspace, it would (I\n> believe) be a little clunky to make commands like checkout and log work with\n> the commits that were noted by the build system.\n\nKeep in mind that notes and tags are basically inverses as far as\nefficient lookup goes. If you want to map a build name or number to a\ncommit, you would use a ref which points to a commit. But if you want to\nmap a commit sha1 to a build number, you would use notes.\n\n> It struck me that it would be neat to have hidden refs in the refs/\n> directory.  I experimented a bit with a \"refs/.builds\" directory:\n> \n> * \"git update-ref refs/.builds/One\" fails with \"Cannot lock the\n>   ref 'refs/.builds/One'.\"  So I created a ref the regular way\n>   (refs/blah/One) and copied the \"One\" file into refs/.builds/.\n\nYeah, I believe \".\" at the front of a directory component is explicitly\nforbidden by check_ref_format. I don't recall whether there was a\nspecific rationale, or whether it was simply a can of worms we didn't\nwant to explore.\n\n...\n\nLook like it blames to 03feddd (git-check-ref-format: reject funny ref\nnames., 2005-10-13).  This looks like the relevant thread:\n\n  http://article.gmane.org/gmane.comp.version-control.git/9874\n\nbut I didn't read through it carefully.\n\n-Peff\n"},{"id":"153415","messageId":"7vvd56m1ke.fsf@alter.siamese.dyndns.org","threadId":"25437","inReplyTo":"20101013173555.GA13188@sigill.intra.peff.net","subject":"Re: [RFC] Hidden refs","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-10-13T17:42:41Z","receivedAt":"2010-10-13T17:42:41Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> Yeah, I believe \".\" at the front of a directory component is explicitly\n> forbidden by check_ref_format. I don't recall whether there was a\n> specific rationale, or whether it was simply a can of worms we didn't\n> want to explore.\n\nIs \"log foo...bar\" a symmetric difference between foo and bar, or is it an\nassymmetric one from foo and .bar?\n"},{"id":"153417","messageId":"20101013174647.GB13752@sigill.intra.peff.net","threadId":"25437","inReplyTo":"7vvd56m1ke.fsf@alter.siamese.dyndns.org","subject":"Re: [RFC] Hidden refs","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2010-10-13T17:46:48Z","receivedAt":"2010-10-13T17:46:48Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Oct 13, 2010 at 10:42:41AM -0700, Junio C Hamano wrote:\n\n> Jeff King <peff@peff.net> writes:\n> \n> > Yeah, I believe \".\" at the front of a directory component is explicitly\n> > forbidden by check_ref_format. I don't recall whether there was a\n> > specific rationale, or whether it was simply a can of worms we didn't\n> > want to explore.\n> \n> Is \"log foo...bar\" a symmetric difference between foo and bar, or is it an\n> assymmetric one from foo and .bar?\n\nThanks, I was sure there was a simple example of how it would make\nthings ambiguous, but for some reason I couldn't think of one.\n\n-Peff\n"},{"id":"153420","messageId":"7vmxqim167.fsf@alter.siamese.dyndns.org","threadId":"25437","inReplyTo":"20101013174647.GB13752@sigill.intra.peff.net","subject":"Re: [RFC] Hidden refs","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-10-13T17:51:12Z","receivedAt":"2010-10-13T17:51:12Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> On Wed, Oct 13, 2010 at 10:42:41AM -0700, Junio C Hamano wrote:\n>\n>> Jeff King <peff@peff.net> writes:\n>> \n>> > Yeah, I believe \".\" at the front of a directory component is explicitly\n>> > forbidden by check_ref_format. I don't recall whether there was a\n>> > specific rationale, or whether it was simply a can of worms we didn't\n>> > want to explore.\n>> \n>> Is \"log foo...bar\" a symmetric difference between foo and bar, or is it an\n>> assymmetric one from foo and .bar?\n>\n> Thanks, I was sure there was a simple example of how it would make\n> things ambiguous, but for some reason I couldn't think of one.\n\nOf course, it points at an existing bug as well.  --- the example could\nmean an asymmetric difference from foo. to bar ;-)\n"},{"id":"153422","messageId":"20101013175339.GA8686@burratino","threadId":"25437","inReplyTo":"7vmxqim167.fsf@alter.siamese.dyndns.org","subject":"Re: [RFC] Hidden refs","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-13T17:53:39Z","receivedAt":"2010-10-13T17:53:39Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Junio C Hamano wrote:\n>> On Wed, Oct 13, 2010 at 10:42:41AM -0700, Junio C Hamano wrote:\n\n>>> Is \"log foo...bar\" a symmetric difference between foo and bar, or is it an\n[...]\n> Of course, it points at an existing bug as well.  --- the example could\n> mean an asymmetric difference from foo. to bar ;-)\n\nFixed about a year ago, I think. :)  (cbdffe4, check_ref_format():\ntighten refname rules, 2009-03-21, part of v1.6.3)\n"}]}