All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: How to check out the repository at a particular point in time
@ 2011-08-23  7:41 R. Diez
  2011-08-23  9:17 ` Thomas Rast
  0 siblings, 1 reply; 16+ messages in thread
From: R. Diez @ 2011-08-23  7:41 UTC (permalink / raw)
  To: PJ Weisberg; +Cc: Thomas Rast, git, in-git-vger


> "master" is nothing more than a pointer to a
> particular commit.  The commit has references
> to its parent(s), from which you can build a
> whole history.  In general, Git doesn't
> know the name of the branch a developer had
> checked out when a commit was created.
> In fact, in this example, both branches
> could have been called "master" if they
> lived in different developers' workspaces.

I understand. However, let's see if git can cope with this pretty common scenario:

Say I'm a developer with too many projects and little time. I don't really want to find the commit ID at each release and manually make a note on the project's web site. In fact, I have no "official" releases. The "contract" with my users (or co-developers in my team) is simple: check out HEAD, it should always work. If it doesn't, last week it worked well, check out at that point in time and wait until I fix the HEAD.

Now you're saying I cannot reliably checkout last week's versions because yesterday I did a merge from an older branch? You mean that git stores everything with clean graphs and numeric pointers, so it cannot know what this repository looked like last week?

As the developer, I have full control, I can decide what the branches are called and how the public repository is updated/pushed/whatever. I can control the clock so there are no time skews.

What do I have to do in order to be able to reliably checkout last week's versions without too much administrative work? I just want to get the same result today as if I had done a checkout last week from the public repository and had made a back-up copy of the working directory then.

With say CVS and Subversion, that's piece of cake, they already work that way, I don't need to manually keep track of revision IDs or visually inspect the merge tree.

Thanks for your answers,
  R. Diez

^ permalink raw reply	[flat|nested] 16+ messages in thread
* How to check out the repository at a particular point in time
@ 2011-08-22 12:25 R. Diez
  2011-08-22 13:25 ` Thomas Rast
  0 siblings, 1 reply; 16+ messages in thread
From: R. Diez @ 2011-08-22 12:25 UTC (permalink / raw)
  To: git

Hi all:

I'm writing a daily build script for all the OpenRISC components, so every day I need to check out several git repositories with the source code of many tools that depend on each other.

The hole process takes hours. In order to minimize the risk of repository skew, I thought I could just take the current date and time, clone all repositories to my local PC and check them all out at that particular timestamp.

I figured out that something like git "checkout HEAD@{2011-08-21 10:00:00}" does not really cut it. I'm getting this warning:

  warning: Log for 'HEAD' only goes back to Sun, 21 Aug 2011 10:00:02 +0200.

The reason is, the timestamp was taken at 10:00, and the repository was cloned 2 seconds later, which means that 10:00 is earlier than the repository. That was totally unexpected, but then I found this in the documentation for "gitrevisions":

  Note that this looks up the state of your local ref at
  a given time; e.g., what was in your local master branch last week.
  If you want to look at commits made during certain times,
  see --since and --until. 

I guess that means the HEAD@{date} syntax does not do what I expected. But hey, it's not the first time I find the git docs hard to follow... }8-)

By the way, it would be nice if the gitrevisions documentation could be improved, as I still don't understand what that really means. Say, for example, an hour ago I had temporarily checked out last year's versions, but half an hour ago I went back to this year's versions. If I check out at HEAD@{1 hour ago}, will I get then last year's version, or this year's?

Anyway, my real problem is with the mentioned --until option. "git checkout" does not understand that option, so I guess I need to feed the date to some other git command in order to get the commit ID for "git checkout", right? Can someone help me here?

Or even better, can someone add this kind of explanation to the "git checkout" documentation? If you are used to other version control systems, and wish to checkout the versions at a particular date, that's the documentation page you first look at.

For extra karma points, git checkout could understand the --until option itself.

Many thanks in advance,
  R. Diez

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

end of thread, other threads:[~2011-08-24 16:19 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-23  7:41 How to check out the repository at a particular point in time R. Diez
2011-08-23  9:17 ` Thomas Rast
2011-08-23 10:04   ` PJ Weisberg
2011-08-23 20:30     ` Jens Lehmann
  -- strict thread matches above, loose matches on Subject: below --
2011-08-22 12:25 R. Diez
2011-08-22 13:25 ` Thomas Rast
2011-08-22 15:18   ` R. Diez
2011-08-22 16:56     ` Jens Lehmann
2011-08-23 15:54     ` Michael Witten
2011-08-23 16:05       ` Jonathan Nieder
2011-08-23 16:09         ` Matthieu Moy
2011-08-23 16:23           ` Michael Witten
2011-08-23 16:53             ` Jonathan Nieder
2011-08-24 15:41       ` Andreas Ericsson
2011-08-24 15:48         ` Randal L. Schwartz
2011-08-24 16:18           ` Michael Witten

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.