{"thread":{"id":"17124","subject":"Re: checking out by date","startedAt":"2009-01-12T19:30:39Z","lastAt":"2009-01-12T21:24:36Z","messageCount":3,"participants":["Robin Rosenberg","David Bryson","Boyd Stephen Smith Jr."],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"100983","messageId":"20090112193039.GO25823@eratosthenes.cryptobackpack.org","threadId":"17124","inReplyTo":null,"subject":"checking out by date","fromName":"David Bryson","fromEmail":"david@statichacks.org","sentAt":"2009-01-12T19:30:39Z","receivedAt":"2009-01-12T19:30:39Z","isPatch":false,"sender":{"key":"david@statichacks.org","avatar":"https://gravatar.com/avatar/b8796a0b286799d99dcbaea3fd3e8675648cc094ff10b07bae8fe3bc0ac40b9c?d=mp&s=160"},"body":"Hi All,\n\nI have a very large repository that imported into git from CVS with\nabout 5 years worth of history.\n\nToday I decided to checkout some code from the past:\n\n$ git checkout master@{\"Mon Dec 31  2007\"}\nwarning: Log for 'master' only goes back to Tue, 2 Dec 2008 16:57:15\n-0800.\n\nThen proceeds to checkout a code snapshot from 2 Dec.  To work around\nthis I checked out a specific commit id, by looking at the log:\n\ncommit 3771ec1d6ccf329da378b7633fdef60474eac4b7\nAuthor: XXXXXXXXXXXXXXX\nDate:   Mon Dec 31 23:25:17 2007 +0000\n\n    BugId: none\n    correct wrong commit\n\n\n$ git checkout 3771ec1d6ccf329da378b7633fdef60474eac4b7\n...\nHEAD is now at 3771ec1... BugId: none correct wrong commit\n\nSo what has caused git to be unable to process the date information,\neven though the information is clearly in the history ?  Did I miss\nsomething ?\n\nDave\n"},{"id":"100992","messageId":"200901121358.21342.bss@iguanasuicide.net","threadId":"17124","inReplyTo":"20090112193039.GO25823@eratosthenes.cryptobackpack.org","subject":"Re: checking out by date","fromName":"Boyd Stephen Smith Jr.","fromEmail":"bss@iguanasuicide.net","sentAt":"2009-01-12T19:58:17Z","receivedAt":"2009-01-12T19:58:17Z","isPatch":false,"sender":{"key":"bss@iguanasuicide.net","avatar":"https://gravatar.com/avatar/84b95eeff194b816c1568b1339e63e4b229825298664a9037b9f1ec713ead1e3?d=mp&s=160"},"body":"On Monday 2009 January 12 13:30:39 David Bryson wrote:\n>I have a very large repository that imported into git from CVS with\n>about 5 years worth of history.\n>\n>Today I decided to checkout some code from the past:\n>\n>$ git checkout master@{\"Mon Dec 31  2007\"}\n>warning: Log for 'master' only goes back to Tue, 2 Dec 2008 16:57:15\n>-0800.\n>\n>Then proceeds to checkout a code snapshot from 2 Dec.  To work around\n>this I checked out a specific commit id, by looking at the log:\n>\n>commit 3771ec1d6ccf329da378b7633fdef60474eac4b7\n>Author: XXXXXXXXXXXXXXX\n>Date:   Mon Dec 31 23:25:17 2007 +0000\n>\n>$ git checkout 3771ec1d6ccf329da378b7633fdef60474eac4b7\n>...\n>HEAD is now at 3771ec1... BugId: none correct wrong commit\n>\n>So what has caused git to be unable to process the date information,\n>even though the information is clearly in the history ?  Did I miss\n>something ?\n\nThe ref@{date} format uses the reflogs which are expired regularly, IIRC.  \nAlso, I don't think reflogs are built by cvsimport, so they would only go \nback to the import date.\n\nWhile there is date information in the output of 'git log', some of those \ncommits may never have been pointed to by the named ref, so they wouldn't \nsatisfy the semantics of \"$ref as it was on $date\".  With a linear history, \nthis \"only\" puts you in the middle of a fast-forward, which isn't *that* bad.\n\nHowever, with a non-linear history, taking the ancestor with the latest commit \ndate before the given date might end up checking out a topic branch that \nhadn't yet been merged on that date, which could be incredibly confusing.\n\nIt should be possible to introduce a commit \"spelling\" to enable \ncheckout-by-date, but I don't know of one currently.  Something \nlike \"commitish~{date}\" meaning \"commitish~n where n is the largest value \ns.t. commit_date(commitish~n) <= date\", intentionally taking the first parent \non any merge to discard the merge event.\n\nIf this is a feature we feel is valuable, I don't think it would be that hard \nto code.\n-- \nBoyd Stephen Smith Jr.                     ,= ,-_-. =. \nbss@iguanasuicide.net                     ((_/)o o(\\_))\nICQ: 514984 YM/AIM: DaTwinkDaddy           `-'(. .)`-' \nhttp://iguanasuicide.net/                      \\_/     \n"},{"id":"100173","messageId":"200901122224.37058.robin.rosenberg.lists@dewire.com","threadId":"17124","inReplyTo":"20090112193039.GO25823@eratosthenes.cryptobackpack.org","subject":"Re: checking out by date","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg.lists@dewire.com","sentAt":"2009-01-12T21:24:36Z","receivedAt":"2009-01-12T21:24:36Z","isPatch":false,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"David Bryson <david@statichacks.org> writes:\n> Hi All,\n> \n> I have a very large repository that imported into git from CVS with\n> about 5 years worth of history.\n> \n> Today I decided to checkout some code from the past:\n> \n> $ git checkout master@{\"Mon Dec 31  2007\"}\n> warning: Log for 'master' only goes back to Tue, 2 Dec 2008 16:57:15\n> -0800.\n\ngit checkout $(git rev-list -n1 --before=\"Mon Dec 31  2007 23:59:59\")\n\n-- robin\n"}]}