{"thread":{"id":"21480","subject":"Accessing the reflog remotely","startedAt":"2009-11-04T09:35:02Z","lastAt":"2009-11-04T19:08:46Z","messageCount":8,"participants":["Matthieu Moy","Emanuele Aina","Tomas Carnecky","Nicolas Pitre","Sverre Rabbelier","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"126746","messageId":"vpqljimpr95.fsf@bauges.imag.fr","threadId":"21480","inReplyTo":null,"subject":"Accessing the reflog remotely","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2009-11-04T09:35:02Z","receivedAt":"2009-11-04T09:35:02Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Hi,\n\nI guess the answer is \"no\", but I'll still ask in case ...\n\nIs it possible to access the reflog of a remote repository other than\nlogging into this repository?\n\nMy use-case is the following: I want to checkout \"the last revision\npushed in master on ssh://host/repo/ on day D at midnight\" (to fetch\nthe project of my students ;-) ). If it were locally, I'd do\n\n  git checkout 'origin/master@{Nov 3 00:00:00}'\n\nBut this tells me where _my_ local master was on that date (i.e. the\nlast revision I had pulled).\n\n\nSo, the best I can think of is:\n\nssh host 'cd /repo/ ; git tag final-version \"master@{Nov 3 00:00:00}\"'\ngit fetch --tags\ngit checkout tags/final-version\n\nIs there a better way?\n\nThanks,\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"126747","messageId":"1257329780.3329.2.camel@abelardo.lan","threadId":"21480","inReplyTo":"vpqljimpr95.fsf@bauges.imag.fr","subject":"Re: Accessing the reflog remotely","fromName":"Emanuele Aina","fromEmail":"em@nerd.ocracy.org","sentAt":"2009-11-04T10:16:20Z","receivedAt":"2009-11-04T10:16:20Z","isPatch":false,"sender":{"key":"em@nerd.ocracy.org","avatar":null},"body":"Matthieu Moy provò:\n\n>   git checkout 'origin/master@{Nov 3 00:00:00}'\n> \n> But this tells me where _my_ local master was on that date (i.e. the\n> last revision I had pulled).\n> \n> So, the best I can think of is:\n> \n> ssh host 'cd /repo/ ; git tag final-version \"master@{Nov 3 00:00:00}\"'\n> git fetch --tags\n> git checkout tags/final-version\n\nAt least you can avoid the tag:\n\ngit checkout `ssh host 'GIT_DIR=/repo/ git rev-parse \"master@{Nov 3 00:00:00}\"'`\n\n-- \nBuongiorno.\nComplimenti per l'ottima scelta.\n"},{"id":"126754","messageId":"684BAF22-EBF5-47F0-9363-3E1B60B4A328@dbservice.com","threadId":"21480","inReplyTo":"vpqljimpr95.fsf@bauges.imag.fr","subject":"Re: Accessing the reflog remotely","fromName":"Tomas Carnecky","fromEmail":"tom@dbservice.com","sentAt":"2009-11-04T10:58:20Z","receivedAt":"2009-11-04T10:58:20Z","isPatch":false,"sender":{"key":"tom@dbservice.com","avatar":"https://gravatar.com/avatar/900a300bdd1a8bbe086008ad78210bbee2ad2803b7d50a5cba04c1e9404bd6d2?d=mp&s=160"},"body":"\nOn Nov 4, 2009, at 10:35 AM, Matthieu Moy wrote:\n\n> Hi,\n>\n> I guess the answer is \"no\", but I'll still ask in case ...\n>\n> Is it possible to access the reflog of a remote repository other than\n> logging into this repository?\n>\n> My use-case is the following: I want to checkout \"the last revision\n> pushed in master on ssh://host/repo/ on day D at midnight\" (to fetch\n> the project of my students ;-) ). If it were locally, I'd do\n>\n>  git checkout 'origin/master@{Nov 3 00:00:00}'\n>\n> But this tells me where _my_ local master was on that date (i.e. the\n> last revision I had pulled).\n\n\nKeep in mind that bare repos don't have reflogs by default, so unless  \nyou enabled the reflog manually there is none.\n\ntom\n"},{"id":"126778","messageId":"alpine.LFD.2.00.0911041243350.10340@xanadu.home","threadId":"21480","inReplyTo":"vpqljimpr95.fsf@bauges.imag.fr","subject":"Re: Accessing the reflog remotely","fromName":"Nicolas Pitre","fromEmail":"nico@fluxnic.net","sentAt":"2009-11-04T17:46:48Z","receivedAt":"2009-11-04T17:46:48Z","isPatch":false,"sender":{"key":"nico@fluxnic.net","avatar":"https://avatars.githubusercontent.com/u/702790?v=4"},"body":"On Wed, 4 Nov 2009, Matthieu Moy wrote:\n\n> Hi,\n> \n> I guess the answer is \"no\", but I'll still ask in case ...\n> \n> Is it possible to access the reflog of a remote repository other than\n> logging into this repository?\n\nNo.\n\n> My use-case is the following: I want to checkout \"the last revision\n> pushed in master on ssh://host/repo/ on day D at midnight\" (to fetch\n> the project of my students ;-) ). If it were locally, I'd do\n> \n>   git checkout 'origin/master@{Nov 3 00:00:00}'\n> \n> But this tells me where _my_ local master was on that date (i.e. the\n> last revision I had pulled).\n\nYou could checkout the first revision which committer's date is older \nthan midnight.  Of course that means you have to trust that students \ndidn't mess up with time stamps.\n\n\nNicolas\n"},{"id":"126779","messageId":"fabb9a1e0911040955n6202fdbbpfbcf34cc33c45e73@mail.gmail.com","threadId":"21480","inReplyTo":"vpqljimpr95.fsf@bauges.imag.fr","subject":"Re: Accessing the reflog remotely","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2009-11-04T17:55:57Z","receivedAt":"2009-11-04T17:55:57Z","isPatch":false,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"Heya,\n\nOn Wed, Nov 4, 2009 at 10:35, Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> wrote:\n> My use-case is the following: I want to checkout \"the last revision\n> pushed in master on ssh://host/repo/ on day D at midnight\" (to fetch\n> the project of my students ;-) ). If it were locally, I'd do\n\nI think your best bet here would be to either run a cronjob at the\ntarget time that tags all submissions, or to deny pushes after the\ntarget time with a pre-push hook.\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"126781","messageId":"7vbpjii2ur.fsf@alter.siamese.dyndns.org","threadId":"21480","inReplyTo":"vpqljimpr95.fsf@bauges.imag.fr","subject":"Re: Accessing the reflog remotely","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-11-04T18:03:56Z","receivedAt":"2009-11-04T18:03:56Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:\n\n> I guess the answer is \"no\", but I'll still ask in case ...\n>\n> Is it possible to access the reflog of a remote repository other than\n> logging into this repository?\n>\n> My use-case is the following: I want to checkout \"the last revision\n> pushed in master on ssh://host/repo/ on day D at midnight\" (to fetch\n> the project of my students ;-) ). If it were locally, I'd do\n\nThis won't solve your problem but I'll mention it anyway as it may be\nrelated.\n\nA distribution point repository like this is often bare, and reflogs are\nnot enabled in bare repositories (primarily due to my stupidity^Wbeing\noverly cautious---I was very skeptical about reflogs when we introduced\nit).  It may make sense to enable reflogs everywhere by default in some\nmajor version bump.\n\nAlso a distribution point repository is often served by gitweb and it\nwould be really nice if there were an option to allow its summary view\nto show commits annotated with reflog entries, e.g.\n\n    ----------------------------------------------------------------\n    2 days ago          JCH Merge branch 'maint'\n    (pushed 6 hrs ago)\n    ----------------------------------------------------------------\n    2 days ago          DVL Makefile: add compat/bswap.h to LIB_H\n    ----------------------------------------------------------------\n    3 days ago          JCH Revert \"Don't create the $GIT_DIR/branches directory on init\"\n    (pushed 60 hours ago)\n    ----------------------------------------------------------------\n    4 days ago          JCH fixup tr/stash-format merge\n    ----------------------------------------------------------------\n        ...\n"},{"id":"126794","messageId":"vpqeioeaz53.fsf@bauges.imag.fr","threadId":"21480","inReplyTo":"alpine.LFD.2.00.0911041243350.10340@xanadu.home","subject":"Re: Accessing the reflog remotely","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2009-11-04T19:06:00Z","receivedAt":"2009-11-04T19:06:00Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Nicolas Pitre <nico@fluxnic.net> writes:\n\n> You could checkout the first revision which committer's date is older \n> than midnight.  Of course that means you have to trust that students \n> didn't mess up with time stamps.\n\nNot only that: they could have commited something the day before, and\npushed it the day after. In the particular case I have in mind, the\ndeliverable is an intermediate one, and we insist a lot on testing, so\nthe senario is not unlikely: commit dangerous code the day of the\ndeadline, and push it the day after. So, the reflog is definitely the\nanswer here.\n\nBut thanks anyway!\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"126795","messageId":"vpqaaz2az0h.fsf@bauges.imag.fr","threadId":"21480","inReplyTo":"7vbpjii2ur.fsf@alter.siamese.dyndns.org","subject":"Re: Accessing the reflog remotely","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2009-11-04T19:08:46Z","receivedAt":"2009-11-04T19:08:46Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> A distribution point repository like this is often bare, and reflogs are\n> not enabled in bare repositories (primarily due to my stupidity^Wbeing\n> overly cautious---I was very skeptical about reflogs when we introduced\n> it).\n\nThanks for reminding it (I knew it, but I could very well have\nforgotten at the last minute ...) :-).\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"}]}