All of lore.kernel.org
 help / color / mirror / Atom feed
* Accessing the reflog remotely
@ 2009-11-04  9:35 Matthieu Moy
  2009-11-04 10:16 ` Emanuele Aina
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Matthieu Moy @ 2009-11-04  9:35 UTC (permalink / raw)
  To: git

Hi,

I guess the answer is "no", but I'll still ask in case ...

Is it possible to access the reflog of a remote repository other than
logging into this repository?

My use-case is the following: I want to checkout "the last revision
pushed in master on ssh://host/repo/ on day D at midnight" (to fetch
the project of my students ;-) ). If it were locally, I'd do

  git checkout 'origin/master@{Nov 3 00:00:00}'

But this tells me where _my_ local master was on that date (i.e. the
last revision I had pulled).


So, the best I can think of is:

ssh host 'cd /repo/ ; git tag final-version "master@{Nov 3 00:00:00}"'
git fetch --tags
git checkout tags/final-version

Is there a better way?

Thanks,

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Accessing the reflog remotely
  2009-11-04  9:35 Accessing the reflog remotely Matthieu Moy
@ 2009-11-04 10:16 ` Emanuele Aina
  2009-11-04 10:58 ` Tomas Carnecky
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Emanuele Aina @ 2009-11-04 10:16 UTC (permalink / raw)
  To: git

Matthieu Moy provò:

>   git checkout 'origin/master@{Nov 3 00:00:00}'
> 
> But this tells me where _my_ local master was on that date (i.e. the
> last revision I had pulled).
> 
> So, the best I can think of is:
> 
> ssh host 'cd /repo/ ; git tag final-version "master@{Nov 3 00:00:00}"'
> git fetch --tags
> git checkout tags/final-version

At least you can avoid the tag:

git checkout `ssh host 'GIT_DIR=/repo/ git rev-parse "master@{Nov 3 00:00:00}"'`

-- 
Buongiorno.
Complimenti per l'ottima scelta.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Accessing the reflog remotely
  2009-11-04  9:35 Accessing the reflog remotely Matthieu Moy
  2009-11-04 10:16 ` Emanuele Aina
@ 2009-11-04 10:58 ` Tomas Carnecky
  2009-11-04 17:46 ` Nicolas Pitre
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Tomas Carnecky @ 2009-11-04 10:58 UTC (permalink / raw)
  To: Matthieu Moy; +Cc: git


On Nov 4, 2009, at 10:35 AM, Matthieu Moy wrote:

> Hi,
>
> I guess the answer is "no", but I'll still ask in case ...
>
> Is it possible to access the reflog of a remote repository other than
> logging into this repository?
>
> My use-case is the following: I want to checkout "the last revision
> pushed in master on ssh://host/repo/ on day D at midnight" (to fetch
> the project of my students ;-) ). If it were locally, I'd do
>
>  git checkout 'origin/master@{Nov 3 00:00:00}'
>
> But this tells me where _my_ local master was on that date (i.e. the
> last revision I had pulled).


Keep in mind that bare repos don't have reflogs by default, so unless  
you enabled the reflog manually there is none.

tom

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Accessing the reflog remotely
  2009-11-04  9:35 Accessing the reflog remotely Matthieu Moy
  2009-11-04 10:16 ` Emanuele Aina
  2009-11-04 10:58 ` Tomas Carnecky
@ 2009-11-04 17:46 ` Nicolas Pitre
  2009-11-04 19:06   ` Matthieu Moy
  2009-11-04 17:55 ` Sverre Rabbelier
  2009-11-04 18:03 ` Junio C Hamano
  4 siblings, 1 reply; 8+ messages in thread
From: Nicolas Pitre @ 2009-11-04 17:46 UTC (permalink / raw)
  To: Matthieu Moy; +Cc: git

On Wed, 4 Nov 2009, Matthieu Moy wrote:

> Hi,
> 
> I guess the answer is "no", but I'll still ask in case ...
> 
> Is it possible to access the reflog of a remote repository other than
> logging into this repository?

No.

> My use-case is the following: I want to checkout "the last revision
> pushed in master on ssh://host/repo/ on day D at midnight" (to fetch
> the project of my students ;-) ). If it were locally, I'd do
> 
>   git checkout 'origin/master@{Nov 3 00:00:00}'
> 
> But this tells me where _my_ local master was on that date (i.e. the
> last revision I had pulled).

You could checkout the first revision which committer's date is older 
than midnight.  Of course that means you have to trust that students 
didn't mess up with time stamps.


Nicolas

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Accessing the reflog remotely
  2009-11-04  9:35 Accessing the reflog remotely Matthieu Moy
                   ` (2 preceding siblings ...)
  2009-11-04 17:46 ` Nicolas Pitre
@ 2009-11-04 17:55 ` Sverre Rabbelier
  2009-11-04 18:03 ` Junio C Hamano
  4 siblings, 0 replies; 8+ messages in thread
From: Sverre Rabbelier @ 2009-11-04 17:55 UTC (permalink / raw)
  To: Matthieu Moy; +Cc: git

Heya,

On Wed, Nov 4, 2009 at 10:35, Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> wrote:
> My use-case is the following: I want to checkout "the last revision
> pushed in master on ssh://host/repo/ on day D at midnight" (to fetch
> the project of my students ;-) ). If it were locally, I'd do

I think your best bet here would be to either run a cronjob at the
target time that tags all submissions, or to deny pushes after the
target time with a pre-push hook.

-- 
Cheers,

Sverre Rabbelier

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Accessing the reflog remotely
  2009-11-04  9:35 Accessing the reflog remotely Matthieu Moy
                   ` (3 preceding siblings ...)
  2009-11-04 17:55 ` Sverre Rabbelier
@ 2009-11-04 18:03 ` Junio C Hamano
  2009-11-04 19:08   ` Matthieu Moy
  4 siblings, 1 reply; 8+ messages in thread
From: Junio C Hamano @ 2009-11-04 18:03 UTC (permalink / raw)
  To: Matthieu Moy; +Cc: git

Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:

> I guess the answer is "no", but I'll still ask in case ...
>
> Is it possible to access the reflog of a remote repository other than
> logging into this repository?
>
> My use-case is the following: I want to checkout "the last revision
> pushed in master on ssh://host/repo/ on day D at midnight" (to fetch
> the project of my students ;-) ). If it were locally, I'd do

This won't solve your problem but I'll mention it anyway as it may be
related.

A distribution point repository like this is often bare, and reflogs are
not enabled in bare repositories (primarily due to my stupidity^Wbeing
overly cautious---I was very skeptical about reflogs when we introduced
it).  It may make sense to enable reflogs everywhere by default in some
major version bump.

Also a distribution point repository is often served by gitweb and it
would be really nice if there were an option to allow its summary view
to show commits annotated with reflog entries, e.g.

    ----------------------------------------------------------------
    2 days ago          JCH Merge branch 'maint'
    (pushed 6 hrs ago)
    ----------------------------------------------------------------
    2 days ago          DVL Makefile: add compat/bswap.h to LIB_H
    ----------------------------------------------------------------
    3 days ago          JCH Revert "Don't create the $GIT_DIR/branches directory on init"
    (pushed 60 hours ago)
    ----------------------------------------------------------------
    4 days ago          JCH fixup tr/stash-format merge
    ----------------------------------------------------------------
        ...

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Accessing the reflog remotely
  2009-11-04 17:46 ` Nicolas Pitre
@ 2009-11-04 19:06   ` Matthieu Moy
  0 siblings, 0 replies; 8+ messages in thread
From: Matthieu Moy @ 2009-11-04 19:06 UTC (permalink / raw)
  To: Nicolas Pitre; +Cc: git

Nicolas Pitre <nico@fluxnic.net> writes:

> You could checkout the first revision which committer's date is older 
> than midnight.  Of course that means you have to trust that students 
> didn't mess up with time stamps.

Not only that: they could have commited something the day before, and
pushed it the day after. In the particular case I have in mind, the
deliverable is an intermediate one, and we insist a lot on testing, so
the senario is not unlikely: commit dangerous code the day of the
deadline, and push it the day after. So, the reflog is definitely the
answer here.

But thanks anyway!

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Accessing the reflog remotely
  2009-11-04 18:03 ` Junio C Hamano
@ 2009-11-04 19:08   ` Matthieu Moy
  0 siblings, 0 replies; 8+ messages in thread
From: Matthieu Moy @ 2009-11-04 19:08 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Junio C Hamano <gitster@pobox.com> writes:

> A distribution point repository like this is often bare, and reflogs are
> not enabled in bare repositories (primarily due to my stupidity^Wbeing
> overly cautious---I was very skeptical about reflogs when we introduced
> it).

Thanks for reminding it (I knew it, but I could very well have
forgotten at the last minute ...) :-).

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-11-04 19:09 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-04  9:35 Accessing the reflog remotely Matthieu Moy
2009-11-04 10:16 ` Emanuele Aina
2009-11-04 10:58 ` Tomas Carnecky
2009-11-04 17:46 ` Nicolas Pitre
2009-11-04 19:06   ` Matthieu Moy
2009-11-04 17:55 ` Sverre Rabbelier
2009-11-04 18:03 ` Junio C Hamano
2009-11-04 19:08   ` Matthieu Moy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.