From: Thomas Rast <trast@student.ethz.ch>
To: <rdiezmail-temp2@yahoo.de>
Cc: PJ Weisberg <pjweisberg@gmail.com>,
"git@vger.kernel.org" <git@vger.kernel.org>,
"in-git-vger@baka.org" <in-git-vger@baka.org>
Subject: Re: How to check out the repository at a particular point in time
Date: Tue, 23 Aug 2011 11:17:00 +0200 [thread overview]
Message-ID: <201108231117.00314.trast@student.ethz.ch> (raw)
In-Reply-To: <1314085268.42103.YahooMailClassic@web25406.mail.ukl.yahoo.com>
R. Diez wrote:
>
> check out HEAD, it should always work
Please stop using HEAD like this, you'll just confuse your coworkers
(and yourself). HEAD denotes the currently checked out commit.
[Unlike SVN it is *not* the most recent version of anything.] Thus by
definition, 'git checkout HEAD' is a no-op.
The newest commit on a branch is denoted by its branch name, because
as Jens said, a branch is in fact a pointer to its tip[1] commit.
> 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?
Indeed. Especially if forced pushes are allowed, there is no way to
know what was in the repo at a given time unless you have (local)
reflogs enabled on remote branches and going back until the time you
want.
> 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.
Assuming
* you never do a non-fast-forward (i.e., forced) push
* you never have any clock skew
* you always merge features into master (not the other way around)
* you always push immediately after committing on master
you can get there by using 'git log -1 --first-parent --until=...'
as mentioned in my first email.
I personally think that's crazy and -- if you want to avoid the work
of "really" using submodules -- support Jens's suggestion of having
the buildbot automatically assemble an "I tested this" superproject.
[1] or "head" in lowercase (thus "branch head"), but I prefer tip to
avoid confusion
--
Thomas Rast
trast@{inf,student}.ethz.ch
next prev parent reply other threads:[~2011-08-23 9:17 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201108231117.00314.trast@student.ethz.ch \
--to=trast@student.ethz.ch \
--cc=git@vger.kernel.org \
--cc=in-git-vger@baka.org \
--cc=pjweisberg@gmail.com \
--cc=rdiezmail-temp2@yahoo.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).